Skip to content

Commit

Permalink
fix(minor): set tax values for item variants (backport #37674) (#37738)
Browse files Browse the repository at this point in the history
* fix: copy all child fields to item variant

(cherry picked from commit 5deba1b)

* fix: only update if variant table empty

(cherry picked from commit d436a40)

---------

Co-authored-by: Gursheen Anand <[email protected]>
  • Loading branch information
mergify[bot] and GursheenK authored Oct 29, 2023
1 parent 3f296ee commit fabcfc1
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion erpnext/stock/doctype/item/item.py
Original file line number Diff line number Diff line change
Expand Up @@ -280,7 +280,7 @@ def update_template_tables(self):

# add item taxes from template
for d in template.get("taxes"):
self.append("taxes", {"item_tax_template": d.item_tax_template})
self.append("taxes", d)

# copy re-order table if empty
if not self.get("reorder_levels"):
Expand Down
2 changes: 1 addition & 1 deletion erpnext/stock/get_item_details.py
Original file line number Diff line number Diff line change
Expand Up @@ -302,7 +302,7 @@ def get_basic_details(args, item, overwrite_warehouse=True):
if not item:
item = frappe.get_doc("Item", args.get("item_code"))

if item.variant_of:
if item.variant_of and not item.taxes:
item.update_template_tables()

item_defaults = get_item_defaults(item.name, args.company)
Expand Down

0 comments on commit fabcfc1

Please sign in to comment.