Merge branch 'version-13-hotfix' of https://github.com/frappe/erpnext into price_fetch_optimize

This commit is contained in:
Deepesh Garg
2021-12-20 12:17:37 +05:30
3 changed files with 15 additions and 10 deletions

View File

@@ -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
}
}

View File

@@ -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);

View File

@@ -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)