mirror of
https://github.com/frappe/erpnext.git
synced 2026-06-01 19:29:10 +00:00
validate fields value with reference docs
This commit is contained in:
@@ -110,7 +110,8 @@ class DeliveryNote(SellingController):
|
|||||||
def validate_with_previous_doc(self):
|
def validate_with_previous_doc(self):
|
||||||
items = self.get("items")
|
items = self.get("items")
|
||||||
|
|
||||||
for fn in (("Sales Order", "against_sales_order"), ("Sales Invoice", "against_sales_invoice")):
|
for fn in (("Sales Order", "against_sales_order", "so_detail"),
|
||||||
|
("Sales Invoice", "against_sales_invoice", "si_detail")):
|
||||||
if filter(None, [getattr(d, fn[1], None) for d in items]):
|
if filter(None, [getattr(d, fn[1], None) for d in items]):
|
||||||
super(DeliveryNote, self).validate_with_previous_doc({
|
super(DeliveryNote, self).validate_with_previous_doc({
|
||||||
fn[0]: {
|
fn[0]: {
|
||||||
@@ -123,7 +124,7 @@ class DeliveryNote(SellingController):
|
|||||||
if cint(frappe.defaults.get_global_default('maintain_same_sales_rate')):
|
if cint(frappe.defaults.get_global_default('maintain_same_sales_rate')):
|
||||||
super(DeliveryNote, self).validate_with_previous_doc({
|
super(DeliveryNote, self).validate_with_previous_doc({
|
||||||
fn[0] + " Item": {
|
fn[0] + " Item": {
|
||||||
"ref_dn_field": "so_detail",
|
"ref_dn_field": fn[2],
|
||||||
"compare_fields": [["rate", "="]],
|
"compare_fields": [["rate", "="]],
|
||||||
"is_child_table": True
|
"is_child_table": True
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user