[fix] maintain same rate throughout purchase cycle optional
This commit is contained in:
parent
2166b24abb
commit
173e874610
@ -195,8 +195,7 @@ class DocType(BuyingController):
|
|||||||
},
|
},
|
||||||
"Purchase Order Item": {
|
"Purchase Order Item": {
|
||||||
"ref_dn_field": "po_detail",
|
"ref_dn_field": "po_detail",
|
||||||
"compare_fields": [["import_rate", "="], ["project_name", "="], ["item_code", "="],
|
"compare_fields": [["project_name", "="], ["item_code", "="], ["uom", "="]],
|
||||||
["uom", "="]],
|
|
||||||
"is_child_table": True
|
"is_child_table": True
|
||||||
},
|
},
|
||||||
"Purchase Receipt": {
|
"Purchase Receipt": {
|
||||||
@ -205,12 +204,26 @@ class DocType(BuyingController):
|
|||||||
},
|
},
|
||||||
"Purchase Receipt Item": {
|
"Purchase Receipt Item": {
|
||||||
"ref_dn_field": "pr_detail",
|
"ref_dn_field": "pr_detail",
|
||||||
"compare_fields": [["import_rate", "="], ["project_name", "="], ["item_code", "="],
|
"compare_fields": [["project_name", "="], ["item_code", "="], ["uom", "="]],
|
||||||
["uom", "="]],
|
|
||||||
"is_child_table": True
|
"is_child_table": True
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
|
if cint(webnotes.defaults.get_global_default('maintain_same_rate')):
|
||||||
|
super(DocType, self).validate_with_previous_doc(self.tname, {
|
||||||
|
"Purchase Order Item": {
|
||||||
|
"ref_dn_field": "po_detail",
|
||||||
|
"compare_fields": [["import_rate", "="]],
|
||||||
|
"is_child_table": True
|
||||||
|
},
|
||||||
|
"Purchase Receipt Item": {
|
||||||
|
"ref_dn_field": "pr_detail",
|
||||||
|
"compare_fields": [["import_rate", "="]],
|
||||||
|
"is_child_table": True
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
|
|
||||||
def set_aging_date(self):
|
def set_aging_date(self):
|
||||||
if self.doc.is_opening != 'Yes':
|
if self.doc.is_opening != 'Yes':
|
||||||
self.doc.aging_date = self.doc.posting_date
|
self.doc.aging_date = self.doc.posting_date
|
||||||
|
@ -94,12 +94,22 @@ class DocType(BuyingController):
|
|||||||
},
|
},
|
||||||
"Purchase Order Item": {
|
"Purchase Order Item": {
|
||||||
"ref_dn_field": "prevdoc_detail_docname",
|
"ref_dn_field": "prevdoc_detail_docname",
|
||||||
"compare_fields": [["import_rate", "="], ["project_name", "="], ["warehouse", "="],
|
"compare_fields": [["project_name", "="], ["warehouse", "="],
|
||||||
["uom", "="], ["item_code", "="]],
|
["uom", "="], ["item_code", "="]],
|
||||||
"is_child_table": True
|
"is_child_table": True
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
|
if cint(webnotes.defaults.get_global_default('maintain_same_rate')):
|
||||||
|
super(DocType, self).validate_with_previous_doc(self.tname, {
|
||||||
|
"Purchase Order Item": {
|
||||||
|
"ref_dn_field": "prevdoc_detail_docname",
|
||||||
|
"compare_fields": [["import_rate", "="]],
|
||||||
|
"is_child_table": True
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
|
|
||||||
def po_required(self):
|
def po_required(self):
|
||||||
if webnotes.conn.get_single_value("Buying Settings", "po_required") == 'Yes':
|
if webnotes.conn.get_single_value("Buying Settings", "po_required") == 'Yes':
|
||||||
for d in getlist(self.doclist,'purchase_receipt_details'):
|
for d in getlist(self.doclist,'purchase_receipt_details'):
|
||||||
|
Loading…
x
Reference in New Issue
Block a user