fix: fetch item_tax_template values if fields with fetch_from exisit

This commit is contained in:
Smit Vora
2023-12-17 13:59:22 +05:30
parent a14e7f0e84
commit 24ae45ce84
3 changed files with 6 additions and 0 deletions

View File

@@ -640,6 +640,7 @@ class AccountsController(TransactionBase):
args["doctype"] = self.doctype args["doctype"] = self.doctype
args["name"] = self.name args["name"] = self.name
args["child_doctype"] = item.doctype
args["child_docname"] = item.name args["child_docname"] = item.name
args["ignore_pricing_rule"] = ( args["ignore_pricing_rule"] = (
self.ignore_pricing_rule if hasattr(self, "ignore_pricing_rule") else 0 self.ignore_pricing_rule if hasattr(self, "ignore_pricing_rule") else 0

View File

@@ -482,6 +482,7 @@ erpnext.TransactionController = class TransactionController extends erpnext.taxe
cost_center: item.cost_center, cost_center: item.cost_center,
tax_category: me.frm.doc.tax_category, tax_category: me.frm.doc.tax_category,
item_tax_template: item.item_tax_template, item_tax_template: item.item_tax_template,
child_doctype: item.doctype,
child_docname: item.name, child_docname: item.name,
is_old_subcontracting_flow: me.frm.doc.is_old_subcontracting_flow, is_old_subcontracting_flow: me.frm.doc.is_old_subcontracting_flow,
} }

View File

@@ -8,6 +8,7 @@ import frappe
from frappe import _, throw from frappe import _, throw
from frappe.model import child_table_fields, default_fields from frappe.model import child_table_fields, default_fields
from frappe.model.meta import get_field_precision from frappe.model.meta import get_field_precision
from frappe.model.utils import get_fetch_values
from frappe.query_builder.functions import CombineDatetime, IfNull, Sum from frappe.query_builder.functions import CombineDatetime, IfNull, Sum
from frappe.utils import add_days, add_months, cint, cstr, flt, getdate from frappe.utils import add_days, add_months, cint, cstr, flt, getdate
@@ -608,6 +609,9 @@ def get_item_tax_template(args, item, out):
item_tax_template = _get_item_tax_template(args, item_group_doc.taxes, out) item_tax_template = _get_item_tax_template(args, item_group_doc.taxes, out)
item_group = item_group_doc.parent_item_group item_group = item_group_doc.parent_item_group
if args.get("child_doctype") and item_tax_template:
out.update(get_fetch_values(args.get("child_doctype"), "item_tax_template", item_tax_template))
def _get_item_tax_template(args, taxes, out=None, for_validate=False): def _get_item_tax_template(args, taxes, out=None, for_validate=False):
if out is None: if out is None: