refactor: pass typed arguments to get_item_details methods (#44230)
* refactor: pass proper types to get_item_details methods * chore: excempt previous commit from git blame
This commit is contained in:
@@ -14,7 +14,7 @@ from frappe.utils import nowdate, today, unique
|
||||
from pypika import Order
|
||||
|
||||
import erpnext
|
||||
from erpnext.stock.get_item_details import _get_item_tax_template
|
||||
from erpnext.stock.get_item_details import ItemDetailsCtx, _get_item_tax_template
|
||||
|
||||
|
||||
# searches for active employees
|
||||
@@ -813,14 +813,16 @@ def get_tax_template(doctype, txt, searchfield, start, page_len, filters):
|
||||
valid_from = filters.get("valid_from")
|
||||
valid_from = valid_from[1] if isinstance(valid_from, list) else valid_from
|
||||
|
||||
args = {
|
||||
"item_code": filters.get("item_code"),
|
||||
"posting_date": valid_from,
|
||||
"tax_category": filters.get("tax_category"),
|
||||
"company": company,
|
||||
}
|
||||
ctx = ItemDetailsCtx(
|
||||
{
|
||||
"item_code": filters.get("item_code"),
|
||||
"posting_date": valid_from,
|
||||
"tax_category": filters.get("tax_category"),
|
||||
"company": company,
|
||||
}
|
||||
)
|
||||
|
||||
taxes = _get_item_tax_template(args, taxes, for_validate=True)
|
||||
taxes = _get_item_tax_template(ctx, taxes, for_validate=True)
|
||||
return [(d,) for d in set(taxes)]
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user