Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: different UOM not allowed in delivery note #45206

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 7 additions & 7 deletions erpnext/accounts/doctype/sales_invoice/sales_invoice.py
Original file line number Diff line number Diff line change
Expand Up @@ -605,14 +605,14 @@ def update_status_updater_args(self):
"target_parent_dt": "Sales Order",
"target_parent_field": "per_delivered",
"target_field": "delivered_qty",
"target_ref_field": "qty",
"source_field": "qty",
"target_ref_field": "stock_qty",
"source_field": "stock_qty",
"join_field": "so_detail",
"percent_join_field": "sales_order",
"status_field": "delivery_status",
"keyword": "Delivered",
"second_source_dt": "Delivery Note Item",
"second_source_field": "qty",
"second_source_field": "stock_qty",
"second_join_field": "so_detail",
"overflow_type": "delivery",
"extra_cond": """ and exists(select name from `tabSales Invoice`
Expand All @@ -630,9 +630,9 @@ def update_status_updater_args(self):
"join_field": "so_detail",
"target_field": "returned_qty",
"target_parent_dt": "Sales Order",
"source_field": "-1 * qty",
"source_field": "-1 * stock_qty",
"second_source_dt": "Delivery Note Item",
"second_source_field": "-1 * qty",
"second_source_field": "-1 * stock_qty",
"second_join_field": "so_detail",
"extra_cond": """ and exists (select name from `tabSales Invoice` where name=`tabSales Invoice Item`.parent and update_stock=1 and is_return=1)""",
}
Expand Down Expand Up @@ -916,7 +916,7 @@ def validate_with_previous_doc(self):
},
"Sales Order Item": {
"ref_dn_field": "so_detail",
"compare_fields": [["item_code", "="], ["uom", "="], ["conversion_factor", "="]],
"compare_fields": [["item_code", "="]],
"is_child_table": True,
"allow_duplicate_prev_row_id": True,
},
Expand All @@ -931,7 +931,7 @@ def validate_with_previous_doc(self):
},
"Delivery Note Item": {
"ref_dn_field": "dn_detail",
"compare_fields": [["item_code", "="], ["uom", "="], ["conversion_factor", "="]],
"compare_fields": [["item_code", "="]],
"is_child_table": True,
"allow_duplicate_prev_row_id": True,
},
Expand Down
18 changes: 9 additions & 9 deletions erpnext/stock/doctype/delivery_note/delivery_note.py
Original file line number Diff line number Diff line change
Expand Up @@ -154,13 +154,13 @@ def __init__(self, *args, **kwargs):
"target_field": "delivered_qty",
"target_parent_dt": "Sales Order",
"target_parent_field": "per_delivered",
"target_ref_field": "qty",
"source_field": "qty",
"target_ref_field": "stock_qty",
"source_field": "stock_qty",
"percent_join_field": "against_sales_order",
"status_field": "delivery_status",
"keyword": "Delivered",
"second_source_dt": "Sales Invoice Item",
"second_source_field": "qty",
"second_source_field": "stock_qty",
"second_join_field": "so_detail",
"overflow_type": "delivery",
"second_source_extra_cond": """ and exists(select name from `tabSales Invoice`
Expand All @@ -172,8 +172,8 @@ def __init__(self, *args, **kwargs):
"join_field": "si_detail",
"target_field": "delivered_qty",
"target_parent_dt": "Sales Invoice",
"target_ref_field": "qty",
"source_field": "qty",
"target_ref_field": "stock_qty",
"source_field": "stock_qty",
"percent_join_field": "against_sales_invoice",
"overflow_type": "delivery",
"no_allowance": 1,
Expand All @@ -188,9 +188,9 @@ def __init__(self, *args, **kwargs):
"join_field": "so_detail",
"target_field": "returned_qty",
"target_parent_dt": "Sales Order",
"source_field": "-1 * qty",
"source_field": "-1 * stock_qty",
"second_source_dt": "Sales Invoice Item",
"second_source_field": "-1 * qty",
"second_source_field": "-1 * stock_qty",
"second_join_field": "so_detail",
"extra_cond": """ and exists (select name from `tabDelivery Note`
where name=`tabDelivery Note Item`.parent and is_return=1)""",
Expand Down Expand Up @@ -293,7 +293,7 @@ def validate_with_previous_doc(self):
},
"Sales Order Item": {
"ref_dn_field": "so_detail",
"compare_fields": [["item_code", "="], ["uom", "="], ["conversion_factor", "="]],
"compare_fields": [["item_code", "="], ["stock_uom", "="]],
"is_child_table": True,
"allow_duplicate_prev_row_id": True,
},
Expand All @@ -308,7 +308,7 @@ def validate_with_previous_doc(self):
},
"Sales Invoice Item": {
"ref_dn_field": "si_detail",
"compare_fields": [["item_code", "="], ["uom", "="], ["conversion_factor", "="]],
"compare_fields": [["item_code", "="], ["stock_uom", "="]],
"is_child_table": True,
"allow_duplicate_prev_row_id": True,
},
Expand Down
Loading