diff --git a/css/all-app.css b/css/all-app.css index c42f3706eb7..ff022b795f1 100644 --- a/css/all-app.css +++ b/css/all-app.css @@ -3349,9 +3349,6 @@ div.list-row { border-bottom: 1px solid #eee; padding: 5px 0px; } -div.list-row:hover { - background-color: #eef -} div.list-row .label { margin-right: 4px; diff --git a/css/all-web.css b/css/all-web.css index 416e9022e03..146d4782112 100644 --- a/css/all-web.css +++ b/css/all-web.css @@ -1720,9 +1720,6 @@ div.list-row { border-bottom: 1px solid #eee; padding: 5px 0px; } -div.list-row:hover { - background-color: #eef -} div.list-row .label { margin-right: 4px; diff --git a/erpnext/accounts/doctype/sales_invoice/sales_invoice.js b/erpnext/accounts/doctype/sales_invoice/sales_invoice.js index a2d9f6a753d..4e7a51a261a 100644 --- a/erpnext/accounts/doctype/sales_invoice/sales_invoice.js +++ b/erpnext/accounts/doctype/sales_invoice/sales_invoice.js @@ -171,6 +171,7 @@ cur_frm.cscript.customer = function(doc,dt,dn,onload) { get_server_fields('get_cust_and_due_date','','',doc,dt,dn,1, function(doc, dt, dn) { cur_frm.refresh(); + cur_frm.cscript.price_list_name(doc, dt, dn); }); } diff --git a/erpnext/accounts/doctype/sales_invoice/sales_invoice.py b/erpnext/accounts/doctype/sales_invoice/sales_invoice.py index 1878526b61f..19a8c74565e 100644 --- a/erpnext/accounts/doctype/sales_invoice/sales_invoice.py +++ b/erpnext/accounts/doctype/sales_invoice/sales_invoice.py @@ -126,7 +126,6 @@ class DocType(TransactionBase): if self.doc.debit_to: self.doc.customer = webnotes.conn.get_value('Account',self.doc.debit_to,'master_name') - # get_obj('Sales Common').get_customer_details(self, inv_det_reqd = 0) # Pull Details of Delivery Note or Sales Order Selected @@ -467,8 +466,6 @@ class DocType(TransactionBase): sales_com_obj.validate_max_discount(self, 'entries') #verify whether rate is not greater than tolerance sales_com_obj.get_allocated_sum(self) # this is to verify that the allocated % of sales persons is 100% sales_com_obj.validate_fiscal_year(self.doc.fiscal_year,self.doc.posting_date,'Posting Date') - if not self.doc.customer: - get_obj('Sales Common').get_customer_details(self, inv_det_reqd = 0) self.validate_customer() self.validate_debit_to_acc() self.validate_debit_acc() diff --git a/erpnext/knowledge_base/page/__init__.py b/erpnext/knowledge_base/page/__init__.py deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/erpnext/knowledge_base/page/question_view/__init__.py b/erpnext/knowledge_base/page/question_view/__init__.py deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/erpnext/knowledge_base/page/questions/__init__.py b/erpnext/knowledge_base/page/questions/__init__.py deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/erpnext/selling/doctype/customer/customer.txt b/erpnext/selling/doctype/customer/customer.txt index 59105b345bb..29144928097 100644 --- a/erpnext/selling/doctype/customer/customer.txt +++ b/erpnext/selling/doctype/customer/customer.txt @@ -3,9 +3,9 @@ # These values are common in all dictionaries { - 'creation': '2012-03-27 14:36:07', + 'creation': '2012-04-13 11:56:26', 'docstatus': 0, - 'modified': '2012-03-27 18:47:38', + 'modified': '2012-04-19 17:12:24', 'modified_by': u'Administrator', 'owner': u'Administrator' }, @@ -27,7 +27,7 @@ 'show_in_menu': 0, 'subject': u'eval:"%(customer_name)s"=="%(name)s" ? "" : "%(customer_name)s"', 'tag_fields': u'customer_group,customer_type', - 'version': 435 + 'version': 1 }, # These values are common for all DocField @@ -57,6 +57,46 @@ 'name': u'Customer' }, + # DocPerm + { + 'cancel': 0, + 'create': 0, + 'doctype': u'DocPerm', + 'permlevel': 1, + 'role': u'Sales Manager', + 'write': 0 + }, + + # DocPerm + { + 'cancel': 0, + 'create': 0, + 'doctype': u'DocPerm', + 'permlevel': 0, + 'role': u'Sales Manager', + 'write': 0 + }, + + # DocPerm + { + 'cancel': 0, + 'create': 0, + 'doctype': u'DocPerm', + 'permlevel': 1, + 'role': u'Sales User', + 'write': 0 + }, + + # DocPerm + { + 'cancel': 0, + 'create': 0, + 'doctype': u'DocPerm', + 'permlevel': 0, + 'role': u'Sales User', + 'write': 0 + }, + # DocPerm { 'cancel': 1, @@ -77,46 +117,6 @@ 'write': 0 }, - # DocPerm - { - 'cancel': 0, - 'create': 0, - 'doctype': u'DocPerm', - 'permlevel': 1, - 'role': u'Sales Manager', - 'write': 0 - }, - - # DocPerm - { - 'cancel': 0, - 'create': 0, - 'doctype': u'DocPerm', - 'permlevel': 0, - 'role': u'Sales Manager', - 'write': 0 - }, - - # DocPerm - { - 'cancel': 0, - 'create': 0, - 'doctype': u'DocPerm', - 'permlevel': 1, - 'role': u'Sales User', - 'write': 0 - }, - - # DocPerm - { - 'cancel': 0, - 'create': 0, - 'doctype': u'DocPerm', - 'permlevel': 0, - 'role': u'Sales User', - 'write': 0 - }, - # DocField { 'colour': u'White:FFF', @@ -340,6 +340,16 @@ 'search_index': 1 }, + # DocField + { + 'doctype': u'DocField', + 'fieldname': u'default_price_list', + 'fieldtype': u'Link', + 'label': u'Default Price List', + 'options': u'Price List', + 'permlevel': 0 + }, + # DocField { 'colour': u'White:FFF', diff --git a/erpnext/selling/doctype/quotation/quotation.js b/erpnext/selling/doctype/quotation/quotation.js index f423a840891..4be1f9a2fde 100644 --- a/erpnext/selling/doctype/quotation/quotation.js +++ b/erpnext/selling/doctype/quotation/quotation.js @@ -96,8 +96,9 @@ cur_frm.cscript.refresh = function(doc, cdt, cdn) { //customer cur_frm.cscript.customer = function(doc,dt,dn) { var callback = function(r,rt) { - var doc = locals[cur_frm.doctype][cur_frm.docname]; - cur_frm.refresh(); + var doc = locals[cur_frm.doctype][cur_frm.docname]; + cur_frm.refresh(); + cur_frm.cscript.price_list_name(doc, dt, dn); } if(doc.customer) $c_obj(make_doclist(doc.doctype, doc.name), diff --git a/erpnext/selling/doctype/sales_common/sales_common.js b/erpnext/selling/doctype/sales_common/sales_common.js index a2ff51550fc..2347d720de6 100644 --- a/erpnext/selling/doctype/sales_common/sales_common.js +++ b/erpnext/selling/doctype/sales_common/sales_common.js @@ -76,24 +76,6 @@ cur_frm.cscript.update_item_details = function(doc, dt, dn, callback) { } - -// ============== Customer and its primary contact Details ============================ -cur_frm.cscript.customer = function(doc, cdt, cdn) { - if(doc.customer){ - if (!doc.company) { - msgprint("Please select company to proceed"); - doc.customer = ''; - refresh_field('customer'); - } else { - var callback = function(r, rt){ - cur_frm.refresh(); - } - $c_obj(make_doclist(doc.doctype, doc.name), 'get_customer_details', '',callback); - } - } -} - - var set_dynamic_label_par = function(doc, cdt, cdn, base_curr) { //parent flds par_cols_base = {'net_total': 'Net Total', 'other_charges_total': 'Taxes and Charges Total', diff --git a/erpnext/selling/doctype/sales_common/sales_common.py b/erpnext/selling/doctype/sales_common/sales_common.py index b70382c575a..f9f8adbaba2 100644 --- a/erpnext/selling/doctype/sales_common/sales_common.py +++ b/erpnext/selling/doctype/sales_common/sales_common.py @@ -119,24 +119,6 @@ class DocType(TransactionBase): acc_head = webnotes.conn.sql("select name from `tabAccount` where name = '%s' and docstatus != 2" % (cstr(obj.doc.customer) + " - " + get_value('Company', obj.doc.company, 'abbr'))) obj.doc.debit_to = acc_head and acc_head[0][0] or '' - - # Get Customer Details along with its primary contact details - # ============================================================== - def get_customer_details(self, obj = '', inv_det_reqd = 1): - details = webnotes.conn.sql("select customer_name,address, territory, customer_group, default_sales_partner, default_commission_rate from `tabCustomer` where name = '%s' and docstatus != 2" %(obj.doc.customer), as_dict = 1) - obj.doc.customer_name = details and details[0]['customer_name'] or '' - obj.doc.customer_address = details and details[0]['address'] or '' - obj.doc.territory = details and details[0]['territory'] or '' - obj.doc.customer_group = details and details[0]['customer_group'] or '' - obj.doc.sales_partner = details and details[0]['default_sales_partner'] or '' - obj.doc.commission_rate = details and flt(details[0]['default_commission_rate']) or '' - if obj.doc.doctype != 'Sales Invoice': - obj.doc.delivery_address = details and details[0]['address'] or '' - self.get_contact_details(obj,primary = 1) # get primary contact details - self.get_sales_person_details(obj) # get default sales person details - - if obj.doc.doctype == 'Sales Invoice' and inv_det_reqd: - self.get_invoice_details(obj) # get invoice details # Get Item Details diff --git a/erpnext/selling/doctype/sales_order/sales_order.js b/erpnext/selling/doctype/sales_order/sales_order.js index 91d3fd59add..8ed16a306a5 100644 --- a/erpnext/selling/doctype/sales_order/sales_order.js +++ b/erpnext/selling/doctype/sales_order/sales_order.js @@ -99,6 +99,8 @@ cur_frm.cscript.customer = function(doc,dt,dn) { var callback2 = function(r, rt) { if(doc.customer) unhide_field(['customer_address', 'contact_person', 'customer_name', 'address_display', 'contact_display', 'contact_mobile', 'contact_email', 'territory','customer_group','shipping_address']); cur_frm.refresh(); + cur_frm.cscript.price_list_name(doc, dt, dn); + } var doc = locals[cur_frm.doctype][cur_frm.docname]; get_server_fields('get_shipping_address',doc.customer,'',doc, dt, dn, 0, callback2); diff --git a/erpnext/selling/doctype/sales_order/sales_order.py b/erpnext/selling/doctype/sales_order/sales_order.py index 6fa737c58f8..8210d10b7a8 100644 --- a/erpnext/selling/doctype/sales_order/sales_order.py +++ b/erpnext/selling/doctype/sales_order/sales_order.py @@ -74,13 +74,6 @@ class DocType(TransactionBase): get_obj('DocType Mapper', 'Project-Sales Order').dt_map('Project', 'Sales Order', self.doc.project_name, self.doc, self.doclist, "[['Project', 'Sales Order']]") - # Get Customer Details - # --------------------- - #def get_customer_details(self): - # sales_com_obj = get_obj('Sales Common') - # sales_com_obj.get_customer_details(self) - # sales_com_obj.get_shipping_details(self) - # Get contact person details based on customer selected # ------------------------------------------------------ def get_contact_details(self): diff --git a/erpnext/setup/doctype/customer_group/customer_group.txt b/erpnext/setup/doctype/customer_group/customer_group.txt index c5ee40e03b9..ceda674306a 100644 --- a/erpnext/setup/doctype/customer_group/customer_group.txt +++ b/erpnext/setup/doctype/customer_group/customer_group.txt @@ -3,9 +3,9 @@ # These values are common in all dictionaries { - 'creation': '2012-03-27 14:36:19', + 'creation': '2012-04-13 11:56:30', 'docstatus': 0, - 'modified': '2012-03-27 14:36:19', + 'modified': '2012-04-19 17:50:43', 'modified_by': u'Administrator', 'owner': u'Administrator' }, @@ -26,7 +26,7 @@ 'section_style': u'Simple', 'server_code_error': u' ', 'show_in_menu': 0, - 'version': 34 + 'version': 1 }, # These values are common for all DocField @@ -56,6 +56,56 @@ 'name': u'Customer Group' }, + # DocPerm + { + 'cancel': 0, + 'create': 0, + 'doctype': u'DocPerm', + 'permlevel': 1, + 'role': u'Sales Manager', + 'write': 0 + }, + + # DocPerm + { + 'cancel': 0, + 'create': 0, + 'doctype': u'DocPerm', + 'permlevel': 0, + 'role': u'Sales Manager', + 'write': 0 + }, + + # DocPerm + { + 'cancel': 0, + 'create': 0, + 'doctype': u'DocPerm', + 'permlevel': 1, + 'role': u'Sales Master Manager', + 'write': 0 + }, + + # DocPerm + { + 'cancel': 0, + 'create': 0, + 'doctype': u'DocPerm', + 'permlevel': 1, + 'role': u'Sales User', + 'write': 0 + }, + + # DocPerm + { + 'cancel': 0, + 'create': 0, + 'doctype': u'DocPerm', + 'permlevel': 0, + 'role': u'Sales User', + 'write': 0 + }, + # DocPerm { 'cancel': 1, @@ -66,56 +116,6 @@ 'write': 1 }, - # DocPerm - { - 'cancel': 0, - 'create': 0, - 'doctype': u'DocPerm', - 'permlevel': 1, - 'role': u'Sales Manager', - 'write': 0 - }, - - # DocPerm - { - 'cancel': 0, - 'create': 0, - 'doctype': u'DocPerm', - 'permlevel': 0, - 'role': u'Sales Manager', - 'write': 0 - }, - - # DocPerm - { - 'cancel': 0, - 'create': 0, - 'doctype': u'DocPerm', - 'permlevel': 1, - 'role': u'Sales Master Manager', - 'write': 0 - }, - - # DocPerm - { - 'cancel': 0, - 'create': 0, - 'doctype': u'DocPerm', - 'permlevel': 1, - 'role': u'Sales User', - 'write': 0 - }, - - # DocPerm - { - 'cancel': 0, - 'create': 0, - 'doctype': u'DocPerm', - 'permlevel': 0, - 'role': u'Sales User', - 'write': 0 - }, - # DocField { 'doctype': u'DocField', @@ -182,6 +182,16 @@ 'reqd': 1 }, + # DocField + { + 'doctype': u'DocField', + 'fieldname': u'default_price_list', + 'fieldtype': u'Link', + 'label': u'Default Price List', + 'options': u'Price List', + 'permlevel': 0 + }, + # DocField { 'doctype': u'DocField', diff --git a/erpnext/stock/doctype/delivery_note/delivery_note.js b/erpnext/stock/doctype/delivery_note/delivery_note.js index e030fc1b000..f0fd8016130 100644 --- a/erpnext/stock/doctype/delivery_note/delivery_note.js +++ b/erpnext/stock/doctype/delivery_note/delivery_note.js @@ -79,6 +79,7 @@ cur_frm.cscript.customer = function(doc,dt,dn,onload) { var doc = locals[cur_frm.doctype][cur_frm.docname]; if(doc.customer) unhide_field(['customer_address','contact_person','customer_name','address_display','contact_display','contact_mobile','contact_email','territory','customer_group','shipping_address']); cur_frm.refresh(); + cur_frm.cscript.price_list_name(doc, dt, dn); } var args = onload ? 'onload':'' if(doc.customer) $c_obj(make_doclist(doc.doctype, doc.name), 'get_default_customer_shipping_address', args, callback); @@ -257,18 +258,21 @@ cur_frm.fields_dict['territory'].get_query = function(doc,cdt,cdn) { //------------------------for printing without amount---------- var set_print_hide= function(doc, cdt, cdn){ + var dn_fields = wn.meta.docfield_map['Delivery Note']; + var dn_item_fields = wn.meta.docfield_map['Delivery Note Item']; + if (doc.print_without_amount) { - fields['Delivery Note']['currency'].print_hide = 1; - fields['Delivery Note Item']['export_rate'].print_hide = 1; - fields['Delivery Note Item']['adj_rate'].print_hide = 1; - fields['Delivery Note Item']['ref_rate'].print_hide = 1; - fields['Delivery Note Item']['export_amount'].print_hide = 1; + dn_fields['currency'].print_hide = 1; + dn_item_fields['export_rate'].print_hide = 1; + dn_item_fields['adj_rate'].print_hide = 1; + dn_item_fields['ref_rate'].print_hide = 1; + dn_item_fields['export_amount'].print_hide = 1; } else { - fields['Delivery Note']['currency'].print_hide = 0; - fields['Delivery Note Item']['export_rate'].print_hide = 0; - fields['Delivery Note Item']['adj_rate'].print_hide = 0; - fields['Delivery Note Item']['ref_rate'].print_hide = 0; - fields['Delivery Note Item']['export_amount'].print_hide = 0; + dn_fields['currency'].print_hide = 0; + dn_item_fields['export_rate'].print_hide = 0; + dn_item_fields['adj_rate'].print_hide = 0; + dn_item_fields['ref_rate'].print_hide = 0; + dn_item_fields['export_amount'].print_hide = 0; } } diff --git a/erpnext/knowledge_base/__init__.py b/erpnext/utilities/doctype/answer/__init__.py similarity index 100% rename from erpnext/knowledge_base/__init__.py rename to erpnext/utilities/doctype/answer/__init__.py diff --git a/erpnext/knowledge_base/doctype/answer/answer.txt b/erpnext/utilities/doctype/answer/answer.txt similarity index 98% rename from erpnext/knowledge_base/doctype/answer/answer.txt rename to erpnext/utilities/doctype/answer/answer.txt index 6d664f21022..75c3f332dac 100644 --- a/erpnext/knowledge_base/doctype/answer/answer.txt +++ b/erpnext/utilities/doctype/answer/answer.txt @@ -18,7 +18,7 @@ 'colour': u'White:FFF', 'doctype': 'DocType', 'in_create': 1, - 'module': u'Knowledge Base', + 'module': u'Utilities', 'name': '__common__', 'read_only': 1, 'section_style': u'Simple', @@ -99,4 +99,4 @@ 'label': u'Users Voted', 'print_hide': 1 } -] \ No newline at end of file +] diff --git a/erpnext/knowledge_base/doctype/__init__.py b/erpnext/utilities/doctype/question/__init__.py similarity index 100% rename from erpnext/knowledge_base/doctype/__init__.py rename to erpnext/utilities/doctype/question/__init__.py diff --git a/erpnext/knowledge_base/doctype/question/question.py b/erpnext/utilities/doctype/question/question.py similarity index 100% rename from erpnext/knowledge_base/doctype/question/question.py rename to erpnext/utilities/doctype/question/question.py diff --git a/erpnext/knowledge_base/doctype/question/question.txt b/erpnext/utilities/doctype/question/question.txt similarity index 98% rename from erpnext/knowledge_base/doctype/question/question.txt rename to erpnext/utilities/doctype/question/question.txt index 01a86ee1795..11738672a7f 100644 --- a/erpnext/knowledge_base/doctype/question/question.txt +++ b/erpnext/utilities/doctype/question/question.txt @@ -18,7 +18,7 @@ 'colour': u'White:FFF', 'doctype': 'DocType', 'in_create': 1, - 'module': u'Knowledge Base', + 'module': u'Utilities', 'name': '__common__', 'read_only': 1, 'section_style': u'Simple', @@ -155,4 +155,4 @@ 'oldfieldname': u'file_list', 'oldfieldtype': u'Text' } -] \ No newline at end of file +] diff --git a/erpnext/knowledge_base/doctype/answer/__init__.py b/erpnext/utilities/doctype/question_control/__init__.py similarity index 100% rename from erpnext/knowledge_base/doctype/answer/__init__.py rename to erpnext/utilities/doctype/question_control/__init__.py diff --git a/erpnext/knowledge_base/doctype/question_control/question_control.txt b/erpnext/utilities/doctype/question_control/question_control.txt similarity index 94% rename from erpnext/knowledge_base/doctype/question_control/question_control.txt rename to erpnext/utilities/doctype/question_control/question_control.txt index b1443363c2c..b037b67d72e 100644 --- a/erpnext/knowledge_base/doctype/question_control/question_control.txt +++ b/erpnext/utilities/doctype/question_control/question_control.txt @@ -15,7 +15,7 @@ 'colour': u'White:FFF', 'doctype': 'DocType', 'issingle': 1, - 'module': u'Knowledge Base', + 'module': u'Utilities', 'name': '__common__', 'section_style': u'Simple', 'server_code_error': u' ', @@ -27,4 +27,4 @@ 'doctype': 'DocType', 'name': u'Question Control' } -] \ No newline at end of file +] diff --git a/erpnext/knowledge_base/page/kb_common/kb_common.js b/erpnext/utilities/page/kb_common/kb_common.js similarity index 92% rename from erpnext/knowledge_base/page/kb_common/kb_common.js rename to erpnext/utilities/page/kb_common/kb_common.js index 6fb4d387418..d77a938e0ed 100644 --- a/erpnext/knowledge_base/page/kb_common/kb_common.js +++ b/erpnext/utilities/page/kb_common/kb_common.js @@ -56,7 +56,7 @@ KBItemToolbar = function(args, kb) { console.log(1); this.innerHTML = 'deleting...'; this.disabled = 1; - $c_page('knowledge_base', 'questions', 'delete', { + $c_page('utilities', 'questions', 'delete', { dt: me.doctype, dn: me.det.name}, function(r,rt) { // reload the list kb.list.run() @@ -78,9 +78,9 @@ EditableText = function(args) { me.$w = $(repl('