From fd2a1a0ba0b707f66c61881dcedc6e9694c4531d Mon Sep 17 00:00:00 2001 From: ruthra kumar Date: Tue, 31 Dec 2024 16:48:13 +0530 Subject: [PATCH] refactor: use correct method parameters --- .../accounts/doctype/sales_invoice/test_sales_invoice.py | 8 ++++---- erpnext/controllers/taxes_and_totals.py | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/erpnext/accounts/doctype/sales_invoice/test_sales_invoice.py b/erpnext/accounts/doctype/sales_invoice/test_sales_invoice.py index a981927a1f46..b7546a9ce332 100644 --- a/erpnext/accounts/doctype/sales_invoice/test_sales_invoice.py +++ b/erpnext/accounts/doctype/sales_invoice/test_sales_invoice.py @@ -2819,8 +2819,8 @@ def test_item_tax_net_range(self): sales_invoice = create_sales_invoice(item="T Shirt", rate=700, do_not_submit=True) item_tax_map = get_item_tax_map( - doc=sales_invoice, - tax_template=sales_invoice.items[0].item_tax_template, + company=sales_invoice.company, + item_tax_template=sales_invoice.items[0].item_tax_template, ) self.assertEqual(sales_invoice.items[0].item_tax_template, "_Test Account Excise Duty @ 12 - _TC") @@ -2832,8 +2832,8 @@ def test_item_tax_net_range(self): sales_invoice.save() item_tax_map = get_item_tax_map( - doc=sales_invoice, - tax_template=sales_invoice.items[0].item_tax_template, + company=sales_invoice.company, + item_tax_template=sales_invoice.items[0].item_tax_template, ) self.assertEqual(sales_invoice.items[0].item_tax_template, "_Test Account Excise Duty @ 10 - _TC") diff --git a/erpnext/controllers/taxes_and_totals.py b/erpnext/controllers/taxes_and_totals.py index 95a6f7734030..5b6a7b1506b3 100644 --- a/erpnext/controllers/taxes_and_totals.py +++ b/erpnext/controllers/taxes_and_totals.py @@ -134,8 +134,8 @@ def validate_item_tax_template(self): def update_item_tax_map(self): for item in self.doc.items: item.item_tax_rate = get_item_tax_map( - doc=self.doc, - tax_template=item.item_tax_template, + company=self.doc.get("company"), + item_tax_template=item.item_tax_template, as_json=True, )