From c5931e4b1ef0a838c3bcb7b38645d157a1b46cc0 Mon Sep 17 00:00:00 2001 From: mro-admin <60629808+mro-admin@users.noreply.github.com> Date: Fri, 17 Dec 2021 05:36:08 -0800 Subject: [PATCH 1/3] fix: convert asynchronous field update to synchronous (#28906) Co-authored-by: Dan Navarro on Ubuntu Work --- erpnext/public/js/utils.js | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/erpnext/public/js/utils.js b/erpnext/public/js/utils.js index 7840c58d891..ee74f351d17 100755 --- a/erpnext/public/js/utils.js +++ b/erpnext/public/js/utils.js @@ -430,12 +430,9 @@ erpnext.utils.select_alternate_items = function(opts) { qty = row.qty; } row[item_field] = d.alternate_item; - frm.script_manager.trigger(item_field, row.doctype, row.name) - .then(() => { - frappe.model.set_value(row.doctype, row.name, 'qty', qty); - frappe.model.set_value(row.doctype, row.name, - opts.original_item_field, d.item_code); - }); + frappe.model.set_value(row.doctype, row.name, 'qty', qty); + frappe.model.set_value(row.doctype, row.name, opts.original_item_field, d.item_code); + frm.trigger(item_field, row.doctype, row.name); }); refresh_field(opts.child_docname); From d3c62821fb97018d873aac852e07f78f58d0229d Mon Sep 17 00:00:00 2001 From: "mergify[bot]" <37929162+mergify[bot]@users.noreply.github.com> Date: Sat, 18 Dec 2021 12:07:45 +0530 Subject: [PATCH 2/3] fix: Add Invoice Number field to list view in Opening Invoice Creation Tool (#28941) --- .../opening_invoice_creation_tool_item.json | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/erpnext/accounts/doctype/opening_invoice_creation_tool_item/opening_invoice_creation_tool_item.json b/erpnext/accounts/doctype/opening_invoice_creation_tool_item/opening_invoice_creation_tool_item.json index 4ce8cb95b18..07c78631358 100644 --- a/erpnext/accounts/doctype/opening_invoice_creation_tool_item/opening_invoice_creation_tool_item.json +++ b/erpnext/accounts/doctype/opening_invoice_creation_tool_item/opening_invoice_creation_tool_item.json @@ -103,10 +103,18 @@ { "fieldname": "dimension_col_break", "fieldtype": "Column Break" + }, + { + "description": "Reference number of the invoice from the previous system", + "fieldname": "invoice_number", + "fieldtype": "Data", + "in_list_view": 1, + "label": "Invoice Number" } ], "istable": 1, - "modified": "2019-07-25 15:00:00.460695", + "links": [], + "modified": "2021-12-17 19:25:06.053187", "modified_by": "Administrator", "module": "Accounts", "name": "Opening Invoice Creation Tool Item", @@ -116,4 +124,4 @@ "sort_field": "modified", "sort_order": "DESC", "track_changes": 1 -} \ No newline at end of file +} From 0724a148e63ad6c63958a2aa5e711fe615736c75 Mon Sep 17 00:00:00 2001 From: Ankush Menat Date: Sat, 18 Dec 2021 21:34:25 +0530 Subject: [PATCH 3/3] fix: incorrect rounding off near zero (#28948) --- erpnext/stock/stock_ledger.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/erpnext/stock/stock_ledger.py b/erpnext/stock/stock_ledger.py index d2e840faf02..90c6ae67fb3 100644 --- a/erpnext/stock/stock_ledger.py +++ b/erpnext/stock/stock_ledger.py @@ -1157,7 +1157,7 @@ def _round_off_if_near_zero(number: float, precision: int = 6) -> float: """ Rounds off the number to zero only if number is close to zero for decimal specified in precision. Precision defaults to 6. """ - if flt(number) < (1.0 / (10**precision)): - return 0 + if abs(0.0 - flt(number)) < (1.0 / (10**precision)): + return 0.0 return flt(number)