diff --git a/india_compliance/gst_india/overrides/subcontracting_transaction.py b/india_compliance/gst_india/overrides/subcontracting_transaction.py index 7a4fd947eb..a19abb259f 100644 --- a/india_compliance/gst_india/overrides/subcontracting_transaction.py +++ b/india_compliance/gst_india/overrides/subcontracting_transaction.py @@ -67,6 +67,14 @@ def after_mapping(doc, method, source_doc): item.item_tax_template = out.get("item_tax_template") +def after_mapping_stock_entry(doc, method, source_doc): + if source_doc.doctype == "Subcontracting Order": + return + + doc.taxes_and_charges = "" + doc.taxes = [] + + def set_taxes(doc): accounts = get_gst_accounts_by_type(doc.company, "Output", throw=False) if not accounts: @@ -84,7 +92,6 @@ def set_taxes(doc): .where(sales.account_head == accounts.get("igst_account")) .where(sales_template.disabled == 0) .orderby(sales_template.is_default, order=Order.desc) - .limit(1) .run(pluck=True) )[0] diff --git a/india_compliance/hooks.py b/india_compliance/hooks.py index b9eb9278da..0935d86640 100644 --- a/india_compliance/hooks.py +++ b/india_compliance/hooks.py @@ -234,6 +234,7 @@ "Stock Entry": { "onload": "india_compliance.gst_india.overrides.subcontracting_transaction.onload", "validate": "india_compliance.gst_india.overrides.subcontracting_transaction.validate", + "after_mapping": "india_compliance.gst_india.overrides.subcontracting_transaction.after_mapping_stock_entry", }, "Subcontracting Order": { "validate": "india_compliance.gst_india.overrides.subcontracting_transaction.validate",