mirror of
https://github.com/itsdave-de/msp.git
synced 2025-05-06 07:25:13 +02:00
wip
This commit is contained in:
parent
2067d06066
commit
f1cb58de37
14
msp/hooks.py
14
msp/hooks.py
@ -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
|
||||
# ---------------
|
||||
|
118
msp/public/js/customer_quick_entry.js
Normal file
118
msp/public/js/customer_quick_entry.js
Normal 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
0
msp/public/v
Normal file
Loading…
x
Reference in New Issue
Block a user