mirror of
https://github.com/frappe/erpnext.git
synced 2026-05-16 03:29:16 +00:00
Merge branch 'responsive' of github.com:webnotes/erpnext into responsive
Conflicts: selling/doctype/quotation/quotation.py utilities/transaction_base.py
This commit is contained in:
@@ -42,8 +42,6 @@ def delete_masters():
|
||||
print "Deleting masters...."
|
||||
masters = {
|
||||
'Workstation': ['Default Workstation'],
|
||||
'Warehouse Type': ['Default Warehouse Type', 'Fixed Asset', 'Rejected', 'Reserved',
|
||||
'Sample', 'Stores', 'WIP Warehouse'],
|
||||
'Warehouse': ['Default Warehouse'],
|
||||
'UOM': ['Kg', 'Mtr', 'Box', 'Ltr', 'Nos', 'Ft', 'Pair', 'Set'],
|
||||
'Territory': ['All Territories', 'Default Territory'],
|
||||
@@ -139,7 +137,6 @@ def reset_global_defaults():
|
||||
'default_item_group': 'Default',
|
||||
'default_stock_uom': 'Nos',
|
||||
'default_valuation_method': 'FIFO',
|
||||
'default_warehouse_type': 'Default Warehouse Type',
|
||||
'tolerance': None,
|
||||
'acc_frozen_upto': None,
|
||||
'bde_auth_role': None,
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
{
|
||||
"creation": "2013-05-24 14:24:48",
|
||||
"docstatus": 0,
|
||||
"modified": "2013-05-24 14:24:48",
|
||||
"modified": "2013-07-10 14:54:11",
|
||||
"modified_by": "Administrator",
|
||||
"owner": "Administrator"
|
||||
},
|
||||
@@ -16,6 +16,7 @@
|
||||
},
|
||||
{
|
||||
"doctype": "DocField",
|
||||
"in_list_view": 1,
|
||||
"name": "__common__",
|
||||
"parent": "Note User",
|
||||
"parentfield": "fields",
|
||||
|
||||
@@ -274,24 +274,29 @@ class TransactionBase(StatusUpdater):
|
||||
|
||||
def validate_with_previous_doc(self, source_dt, ref):
|
||||
for key, val in ref.items():
|
||||
is_child = val.get("is_child_table")
|
||||
ref_doc = {}
|
||||
for d in self.doclist.get({"doctype": source_dt}):
|
||||
if d.fields.get(val["ref_dn_field"]):
|
||||
ref_doc.setdefault(key, d.fields[val["ref_dn_field"]])
|
||||
|
||||
if val.get("is_child_table"):
|
||||
self.compare_values(ref_doc, val["compare_fields"], d)
|
||||
else:
|
||||
ref_dn = d.fields.get(val["ref_dn_field"])
|
||||
if ref_dn:
|
||||
if is_child:
|
||||
self.compare_values({key: [ref_dn]}, val["compare_fields"], d)
|
||||
elif ref_dn:
|
||||
ref_doc.setdefault(key, [])
|
||||
if ref_dn not in ref_doc[key]:
|
||||
ref_doc[key].append(ref_dn)
|
||||
if ref_doc:
|
||||
self.compare_values(ref_doc, val["compare_fields"])
|
||||
|
||||
def compare_values(self, ref_doc, fields, doc=None):
|
||||
for ref_doctype, ref_docname in ref_doc.items():
|
||||
prevdoc_values = webnotes.conn.get_value(ref_doctype, ref_docname,
|
||||
[d[0] for d in fields], as_dict=1)
|
||||
|
||||
for field, condition in fields:
|
||||
if prevdoc_values[field] is not None:
|
||||
self.validate_value(field, condition, prevdoc_values[field], doc)
|
||||
for ref_doctype, ref_dn_list in ref_doc.items():
|
||||
for ref_docname in ref_dn_list:
|
||||
prevdoc_values = webnotes.conn.get_value(ref_doctype, ref_docname,
|
||||
[d[0] for d in fields], as_dict=1)
|
||||
|
||||
for field, condition in fields:
|
||||
if prevdoc_values[field] is not None:
|
||||
self.validate_value(field, condition, prevdoc_values[field], doc)
|
||||
|
||||
def get_default_address_and_contact(party_field, party_name, fetch_shipping_address=False):
|
||||
out = {}
|
||||
|
||||
Reference in New Issue
Block a user