mirror of
https://github.com/frappe/erpnext.git
synced 2026-05-12 17:51:20 +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,
|
child: item,
|
||||||
args: {
|
args: {
|
||||||
doc: me.frm.doc,
|
doc: me.frm.doc,
|
||||||
args: {
|
ctx: {
|
||||||
item_code: item.item_code,
|
item_code: item.item_code,
|
||||||
barcode: item.barcode,
|
barcode: item.barcode,
|
||||||
serial_no: item.serial_no,
|
serial_no: item.serial_no,
|
||||||
@@ -1910,7 +1910,7 @@ erpnext.TransactionController = class TransactionController extends erpnext.taxe
|
|||||||
me.in_apply_price_list = true;
|
me.in_apply_price_list = true;
|
||||||
return this.frm.call({
|
return this.frm.call({
|
||||||
method: "erpnext.stock.get_item_details.apply_price_list",
|
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) {
|
callback: function(r) {
|
||||||
if (!r.exc) {
|
if (!r.exc) {
|
||||||
frappe.run_serially([
|
frappe.run_serially([
|
||||||
|
|||||||
@@ -1297,7 +1297,7 @@ def apply_price_list(ctx: ItemDetailsCtx, as_doc=False, doc=None):
|
|||||||
children = []
|
children = []
|
||||||
|
|
||||||
if "items" in ctx:
|
if "items" in ctx:
|
||||||
item_list = ctx.items
|
item_list = ctx.get("items")
|
||||||
ctx.update(parent)
|
ctx.update(parent)
|
||||||
|
|
||||||
for item in item_list:
|
for item in item_list:
|
||||||
@@ -1309,8 +1309,8 @@ def apply_price_list(ctx: ItemDetailsCtx, as_doc=False, doc=None):
|
|||||||
if as_doc:
|
if as_doc:
|
||||||
ctx.price_list_currency = (parent.price_list_currency,)
|
ctx.price_list_currency = (parent.price_list_currency,)
|
||||||
ctx.plc_conversion_rate = parent.plc_conversion_rate
|
ctx.plc_conversion_rate = parent.plc_conversion_rate
|
||||||
if ctx.items:
|
if ctx.get("items"):
|
||||||
for i, item in enumerate(ctx.items):
|
for i, item in enumerate(ctx.get("items")):
|
||||||
for fieldname in children[i]:
|
for fieldname in children[i]:
|
||||||
# if the field exists in the original doc
|
# if the field exists in the original doc
|
||||||
# update the value
|
# update the value
|
||||||
|
|||||||
Reference in New Issue
Block a user