[minor] duplicate row id from same prevdoc
diff --git a/accounts/doctype/purchase_invoice/purchase_invoice.py b/accounts/doctype/purchase_invoice/purchase_invoice.py
index fac976e..539cef5 100644
--- a/accounts/doctype/purchase_invoice/purchase_invoice.py
+++ b/accounts/doctype/purchase_invoice/purchase_invoice.py
@@ -196,7 +196,8 @@
"Purchase Order Item": {
"ref_dn_field": "po_detail",
"compare_fields": [["project_name", "="], ["item_code", "="], ["uom", "="]],
- "is_child_table": True
+ "is_child_table": True,
+ "allow_duplicate_prev_row_id": True
},
"Purchase Receipt": {
"ref_dn_field": "purchase_receipt",
@@ -214,7 +215,8 @@
"Purchase Order Item": {
"ref_dn_field": "po_detail",
"compare_fields": [["import_rate", "="]],
- "is_child_table": True
+ "is_child_table": True,
+ "allow_duplicate_prev_row_id": True
},
"Purchase Receipt Item": {
"ref_dn_field": "pr_detail",
diff --git a/accounts/doctype/sales_invoice/sales_invoice.py b/accounts/doctype/sales_invoice/sales_invoice.py
index d875247..8f33eb3 100644
--- a/accounts/doctype/sales_invoice/sales_invoice.py
+++ b/accounts/doctype/sales_invoice/sales_invoice.py
@@ -388,7 +388,8 @@
"Sales Order Item": {
"ref_dn_field": "so_detail",
"compare_fields": [["export_rate", "="]],
- "is_child_table": True
+ "is_child_table": True,
+ "allow_duplicate_prev_row_id": True
},
"Delivery Note Item": {
"ref_dn_field": "dn_detail",
diff --git a/accounts/doctype/sales_invoice/test_sales_invoice.py b/accounts/doctype/sales_invoice/test_sales_invoice.py
index ec4535b..7b32ea0 100644
--- a/accounts/doctype/sales_invoice/test_sales_invoice.py
+++ b/accounts/doctype/sales_invoice/test_sales_invoice.py
@@ -607,8 +607,6 @@
self.assertEquals(new_si.doc.invoice_period_to_date,
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
diff --git a/utilities/transaction_base.py b/utilities/transaction_base.py
index 6628601..b688200 100644
--- a/utilities/transaction_base.py
+++ b/utilities/transaction_base.py
@@ -308,7 +308,7 @@
self.compare_values({key: [ref_dn]}, val["compare_fields"], d)
if ref_dn not in item_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) +
_(": Duplicate row from same ") + key, raise_exception=1)
elif ref_dn: