mirror of
https://github.com/frappe/erpnext.git
synced 2026-06-01 19:29:10 +00:00
[minor] duplicate row id from same prevdoc
This commit is contained in:
@@ -196,7 +196,8 @@ class DocType(BuyingController):
|
|||||||
"Purchase Order Item": {
|
"Purchase Order Item": {
|
||||||
"ref_dn_field": "po_detail",
|
"ref_dn_field": "po_detail",
|
||||||
"compare_fields": [["project_name", "="], ["item_code", "="], ["uom", "="]],
|
"compare_fields": [["project_name", "="], ["item_code", "="], ["uom", "="]],
|
||||||
"is_child_table": True
|
"is_child_table": True,
|
||||||
|
"allow_duplicate_prev_row_id": True
|
||||||
},
|
},
|
||||||
"Purchase Receipt": {
|
"Purchase Receipt": {
|
||||||
"ref_dn_field": "purchase_receipt",
|
"ref_dn_field": "purchase_receipt",
|
||||||
@@ -214,7 +215,8 @@ class DocType(BuyingController):
|
|||||||
"Purchase Order Item": {
|
"Purchase Order Item": {
|
||||||
"ref_dn_field": "po_detail",
|
"ref_dn_field": "po_detail",
|
||||||
"compare_fields": [["import_rate", "="]],
|
"compare_fields": [["import_rate", "="]],
|
||||||
"is_child_table": True
|
"is_child_table": True,
|
||||||
|
"allow_duplicate_prev_row_id": True
|
||||||
},
|
},
|
||||||
"Purchase Receipt Item": {
|
"Purchase Receipt Item": {
|
||||||
"ref_dn_field": "pr_detail",
|
"ref_dn_field": "pr_detail",
|
||||||
|
|||||||
@@ -388,7 +388,8 @@ class DocType(SellingController):
|
|||||||
"Sales Order Item": {
|
"Sales Order Item": {
|
||||||
"ref_dn_field": "so_detail",
|
"ref_dn_field": "so_detail",
|
||||||
"compare_fields": [["export_rate", "="]],
|
"compare_fields": [["export_rate", "="]],
|
||||||
"is_child_table": True
|
"is_child_table": True,
|
||||||
|
"allow_duplicate_prev_row_id": True
|
||||||
},
|
},
|
||||||
"Delivery Note Item": {
|
"Delivery Note Item": {
|
||||||
"ref_dn_field": "dn_detail",
|
"ref_dn_field": "dn_detail",
|
||||||
|
|||||||
@@ -607,8 +607,6 @@ class TestSalesInvoice(unittest.TestCase):
|
|||||||
self.assertEquals(new_si.doc.invoice_period_to_date,
|
self.assertEquals(new_si.doc.invoice_period_to_date,
|
||||||
unicode(add_months(base_si.doc.invoice_period_to_date, no_of_months)))
|
unicode(add_months(base_si.doc.invoice_period_to_date, no_of_months)))
|
||||||
|
|
||||||
self.assertEquals(getdate(new_si.doc.posting_date).day,
|
|
||||||
base_si.doc.repeat_on_day_of_month)
|
|
||||||
|
|
||||||
return new_si
|
return new_si
|
||||||
|
|
||||||
|
|||||||
@@ -308,7 +308,7 @@ class TransactionBase(StatusUpdater):
|
|||||||
self.compare_values({key: [ref_dn]}, val["compare_fields"], d)
|
self.compare_values({key: [ref_dn]}, val["compare_fields"], d)
|
||||||
if ref_dn not in item_ref_dn:
|
if ref_dn not in item_ref_dn:
|
||||||
item_ref_dn.append(ref_dn)
|
item_ref_dn.append(ref_dn)
|
||||||
else:
|
elif not val.get("allow_duplicate_prev_row_id"):
|
||||||
webnotes.msgprint(_("Row ") + cstr(d.idx + 1) +
|
webnotes.msgprint(_("Row ") + cstr(d.idx + 1) +
|
||||||
_(": Duplicate row from same ") + key, raise_exception=1)
|
_(": Duplicate row from same ") + key, raise_exception=1)
|
||||||
elif ref_dn:
|
elif ref_dn:
|
||||||
|
|||||||
Reference in New Issue
Block a user