mirror of
https://github.com/frappe/erpnext.git
synced 2026-02-17 08:35:00 +00:00
fix: use of ctx (#44253)
* fix: rename args to ctx in caller
* fix: use `.get("items")` to avoid conflict with `.items()` method
This commit is contained in:
@@ -531,7 +531,7 @@ erpnext.TransactionController = class TransactionController extends erpnext.taxe
|
||||
child: item,
|
||||
args: {
|
||||
doc: me.frm.doc,
|
||||
args: {
|
||||
ctx: {
|
||||
item_code: item.item_code,
|
||||
barcode: item.barcode,
|
||||
serial_no: item.serial_no,
|
||||
@@ -1910,7 +1910,7 @@ erpnext.TransactionController = class TransactionController extends erpnext.taxe
|
||||
me.in_apply_price_list = true;
|
||||
return this.frm.call({
|
||||
method: "erpnext.stock.get_item_details.apply_price_list",
|
||||
args: { args: args, doc: me.frm.doc },
|
||||
args: { ctx: args, doc: me.frm.doc },
|
||||
callback: function(r) {
|
||||
if (!r.exc) {
|
||||
frappe.run_serially([
|
||||
|
||||
@@ -1297,7 +1297,7 @@ def apply_price_list(ctx: ItemDetailsCtx, as_doc=False, doc=None):
|
||||
children = []
|
||||
|
||||
if "items" in ctx:
|
||||
item_list = ctx.items
|
||||
item_list = ctx.get("items")
|
||||
ctx.update(parent)
|
||||
|
||||
for item in item_list:
|
||||
@@ -1309,8 +1309,8 @@ def apply_price_list(ctx: ItemDetailsCtx, as_doc=False, doc=None):
|
||||
if as_doc:
|
||||
ctx.price_list_currency = (parent.price_list_currency,)
|
||||
ctx.plc_conversion_rate = parent.plc_conversion_rate
|
||||
if ctx.items:
|
||||
for i, item in enumerate(ctx.items):
|
||||
if ctx.get("items"):
|
||||
for i, item in enumerate(ctx.get("items")):
|
||||
for fieldname in children[i]:
|
||||
# if the field exists in the original doc
|
||||
# update the value
|
||||
|
||||
Reference in New Issue
Block a user