Skip to content

Commit

Permalink
fix: manually added weight per unit reset to zero after save
Browse files Browse the repository at this point in the history
  • Loading branch information
rohitwaghchaure committed Sep 3, 2021
1 parent 71b7c63 commit 253cf8d
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
4 changes: 4 additions & 0 deletions erpnext/public/js/controllers/transaction.js
Original file line number Diff line number Diff line change
Expand Up @@ -487,6 +487,10 @@ erpnext.TransactionController = class TransactionController extends erpnext.taxe
var me = this;
var item = frappe.get_doc(cdt, cdn);
var update_stock = 0, show_batch_dialog = 0;

item.weight_per_unit = 0;
item.weight_uom = '';

if(['Sales Invoice'].includes(this.frm.doc.doctype)) {
update_stock = cint(me.frm.doc.update_stock);
show_batch_dialog = update_stock;
Expand Down
4 changes: 2 additions & 2 deletions erpnext/stock/get_item_details.py
Original file line number Diff line number Diff line change
Expand Up @@ -316,8 +316,8 @@ def get_basic_details(args, item, overwrite_warehouse=True):
"transaction_date": args.get("transaction_date"),
"against_blanket_order": args.get("against_blanket_order"),
"bom_no": item.get("default_bom"),
"weight_per_unit": item.get("weight_per_unit"),
"weight_uom": item.get("weight_uom")
"weight_per_unit": args.get("weight_per_unit") or item.get("weight_per_unit"),
"weight_uom": args.get("weight_uom") or item.get("weight_uom")
})

if item.get("enable_deferred_revenue") or item.get("enable_deferred_expense"):
Expand Down

0 comments on commit 253cf8d

Please sign in to comment.