mirror of
https://github.com/frappe/erpnext.git
synced 2025-12-03 18:35:36 +00:00
fix: manually added weight per unit reset to zero after save (#27330)
(cherry picked from commit 7b4a65484a)
# Conflicts:
# erpnext/public/js/controllers/transaction.js
# erpnext/stock/get_item_details.py
This commit is contained in:
@@ -526,7 +526,10 @@ erpnext.TransactionController = erpnext.taxes_and_totals.extend({
|
||||
|
||||
item.weight_per_unit = 0;
|
||||
item.weight_uom = '';
|
||||
<<<<<<< HEAD
|
||||
item.conversion_factor = 0;
|
||||
=======
|
||||
>>>>>>> 7b4a65484a (fix: manually added weight per unit reset to zero after save (#27330))
|
||||
|
||||
if(['Sales Invoice'].includes(this.frm.doc.doctype)) {
|
||||
update_stock = cint(me.frm.doc.update_stock);
|
||||
|
||||
@@ -329,6 +329,7 @@ def get_basic_details(args, item, overwrite_warehouse=True):
|
||||
# Set stock UOM in args, so that it can be used while fetching item price
|
||||
args.stock_uom = item.stock_uom
|
||||
|
||||
<<<<<<< HEAD
|
||||
if args.get("batch_no") and item.name != frappe.get_cached_value(
|
||||
"Batch", args.get("batch_no"), "item"
|
||||
):
|
||||
@@ -388,6 +389,45 @@ def get_basic_details(args, item, overwrite_warehouse=True):
|
||||
"grant_commission": item.get("grant_commission"),
|
||||
}
|
||||
)
|
||||
=======
|
||||
out = frappe._dict({
|
||||
"item_code": item.name,
|
||||
"item_name": item.item_name,
|
||||
"description": cstr(item.description).strip(),
|
||||
"image": cstr(item.image).strip(),
|
||||
"warehouse": warehouse,
|
||||
"income_account": get_default_income_account(args, item_defaults, item_group_defaults, brand_defaults),
|
||||
"expense_account": expense_account or get_default_expense_account(args, item_defaults, item_group_defaults, brand_defaults) ,
|
||||
"discount_account": None or get_default_discount_account(args, item_defaults),
|
||||
"cost_center": get_default_cost_center(args, item_defaults, item_group_defaults, brand_defaults),
|
||||
'has_serial_no': item.has_serial_no,
|
||||
'has_batch_no': item.has_batch_no,
|
||||
"batch_no": args.get("batch_no"),
|
||||
"uom": args.uom,
|
||||
"min_order_qty": flt(item.min_order_qty) if args.doctype == "Material Request" else "",
|
||||
"qty": flt(args.qty) or 1.0,
|
||||
"stock_qty": flt(args.qty) or 1.0,
|
||||
"price_list_rate": 0.0,
|
||||
"base_price_list_rate": 0.0,
|
||||
"rate": 0.0,
|
||||
"base_rate": 0.0,
|
||||
"amount": 0.0,
|
||||
"base_amount": 0.0,
|
||||
"net_rate": 0.0,
|
||||
"net_amount": 0.0,
|
||||
"discount_percentage": 0.0,
|
||||
"supplier": get_default_supplier(args, item_defaults, item_group_defaults, brand_defaults),
|
||||
"update_stock": args.get("update_stock") if args.get('doctype') in ['Sales Invoice', 'Purchase Invoice'] else 0,
|
||||
"delivered_by_supplier": item.delivered_by_supplier if args.get("doctype") in ["Sales Order", "Sales Invoice"] else 0,
|
||||
"is_fixed_asset": item.is_fixed_asset,
|
||||
"last_purchase_rate": item.last_purchase_rate if args.get("doctype") in ["Purchase Order"] else 0,
|
||||
"transaction_date": args.get("transaction_date"),
|
||||
"against_blanket_order": args.get("against_blanket_order"),
|
||||
"bom_no": item.get("default_bom"),
|
||||
"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")
|
||||
})
|
||||
>>>>>>> 7b4a65484a (fix: manually added weight per unit reset to zero after save (#27330))
|
||||
|
||||
if item.get("enable_deferred_revenue") or item.get("enable_deferred_expense"):
|
||||
out.update(calculate_service_end_date(args, item))
|
||||
|
||||
Reference in New Issue
Block a user