Merge pull request #6 from itsdave-de/wip

wip
This commit is contained in:
itsdaveit 2022-06-13 11:29:38 +02:00 committed by GitHub
commit ff1b5b4a8b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 124 additions and 8 deletions

View File

@ -16,7 +16,7 @@ app_license = "GPLv3"
# include js, css files in header of desk.html
# app_include_css = "/assets/msp/css/msp.css"
# app_include_js = "/assets/msp/js/msp.js"
app_include_js = "/assets/msp/js/customer_quick_entry.js"
# include js, css files in header of web template
# web_include_css = "/assets/msp/css/msp.css"
@ -79,13 +79,11 @@ app_license = "GPLv3"
# ---------------
# Hook on document methods and events
# doc_events = {
# "*": {
# "on_update": "method",
# "on_cancel": "method",
# "on_trash": "method"
# }
# }
doc_events = {
"Customer": {
"on_update": "msp.msp.customer_quick_entry.custom_customer_info"
}
}
# Scheduled Tasks
# ---------------

View File

@ -0,0 +1,118 @@
frappe.provide('frappe.ui.form');
frappe.ui.form.CustomerQuickEntryForm = frappe.ui.form.QuickEntryForm.extend({
init: function(doctype, after_insert, init_callback, doc, force) {
this._super(doctype, after_insert, init_callback, doc, force);
this.skip_redirect_on_error = true;
},
render_dialog: function() {
this.mandatory = this.mandatory.concat(this.get_variant_fields());
this._super();
console.log("hi")
let me = this
console.log(me)
me.dialog.fields_dict.customer_name.$input[0].onchange = function() {
me.inputHandler(this)
}
},
inputHandler: function(obj) {
console.log("test")
console.log(obj.value)
},
get_variant_fields: function() {
var variant_fields = [{
fieldtype: "Section Break",
label: __("Primary Contact Details"),
collapsible: 1
},
{
label: __("Salutation"),
fieldname: "contact_salutation",
fieldtype: "Link",
options: "Salutation"
},
{
label: __("First Name"),
fieldname: "first_name",
fieldtype: "Data"
},
{
label: __("Last Name"),
fieldname: "last_name",
fieldtype: "Data"
},
{
fieldtype: "Column Break"
},
{
label: __("Mobile Number"),
fieldname: "mobile_no",
fieldtype: "Data"
},
{
label: __("Phone Number"),
fieldname: "phone",
fieldtype: "Data"
},
{
label: __("Email Id"),
fieldname: "email_id",
fieldtype: "Data"
},
{
fieldtype: "Section Break",
label: __("Primary Address Details"),
collapsible: 1
},
{
label: __("Address Line 1"),
fieldname: "address_line1",
fieldtype: "Data"
},
{
label: __("Address Line 2"),
fieldname: "address_line2",
fieldtype: "Data"
},
{
label: __("ZIP Code"),
fieldname: "pincode",
fieldtype: "Data"
},
{
fieldtype: "Column Break"
},
{
label: __("City"),
fieldname: "city",
fieldtype: "Data"
},
{
label: __("State"),
fieldname: "state",
fieldtype: "Data",
hidden: 1
},
{
label: __("Country"),
fieldname: "country",
fieldtype: "Link",
options: "Country",
default: "Germany"
},
{
label: __("Customer POS Id"),
fieldname: "customer_pos_id",
fieldtype: "Data",
hidden: 1
}];
return variant_fields;
},
})

0
msp/public/v Normal file
View File