mirror of
https://github.com/frappe/erpnext.git
synced 2026-09-18 19:07:55 +00:00
fix(stock): accept dict for doc arg in apply_price_list
The type-hint refactor rejected the doc dict sent by the form controller; broaden the annotation to match ctx and fix the cts= kwarg typo in transaction_base.
This commit is contained in:
@@ -1594,7 +1594,7 @@ def get_batch_qty(batch_no: str, warehouse: str, item_code: str):
|
|||||||
|
|
||||||
@frappe.whitelist()
|
@frappe.whitelist()
|
||||||
@erpnext.normalize_ctx_input(ItemDetailsCtx)
|
@erpnext.normalize_ctx_input(ItemDetailsCtx)
|
||||||
def apply_price_list(ctx: ItemDetailsCtx, as_doc: bool = False, doc: Document | str | None = None):
|
def apply_price_list(ctx: ItemDetailsCtx, as_doc: bool = False, doc: Document | str | dict | None = None):
|
||||||
"""Apply pricelist on a document-like dict object and return as
|
"""Apply pricelist on a document-like dict object and return as
|
||||||
{'parent': dict, 'children': list}
|
{'parent': dict, 'children': list}
|
||||||
|
|
||||||
|
|||||||
@@ -575,7 +575,7 @@ class TransactionBase(StatusUpdater):
|
|||||||
"is_internal_customer": self.is_internal_customer,
|
"is_internal_customer": self.is_internal_customer,
|
||||||
}
|
}
|
||||||
# TODO: test method call impact on document
|
# TODO: test method call impact on document
|
||||||
apply_price_list(cts=args, as_doc=True, doc=self)
|
apply_price_list(ctx=args, as_doc=True, doc=self)
|
||||||
|
|
||||||
|
|
||||||
def delete_events(ref_type, ref_name):
|
def delete_events(ref_type, ref_name):
|
||||||
|
|||||||
Reference in New Issue
Block a user