mirror of
https://github.com/frappe/frappe_docker.git
synced 2026-06-22 15:55:09 +00:00
fix: remove v16-incompatible supplier tax field set_value
ERPNext v16 dropped the per-supplier default_purchase_taxes_and_charges _template column. URD tax bypass is now entirely handled by the server script (Before Save on Purchase Invoice) via the is_urd_purchase flag. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
parent
356fec8c38
commit
1f5bb6d942
1 changed files with 7 additions and 17 deletions
|
|
@ -457,23 +457,13 @@ def create_suppliers():
|
||||||
|
|
||||||
frappe.db.commit()
|
frappe.db.commit()
|
||||||
|
|
||||||
# Set URD tax default — look up by title+company (name includes abbr)
|
# ERPNext v16 removed the per-supplier default tax template field.
|
||||||
urd_template = "No GST - URD Purchase"
|
# URD tax bypass is handled instead by the server script:
|
||||||
urd_full = exists_filter("Purchase Taxes and Charges Template",
|
# "Furnitex - Clear GST on URD Purchase" (Before Save on Purchase Invoice)
|
||||||
{"title": urd_template, "company": COMPANY})
|
# Tick the "URD Purchase (No GST)" checkbox on any invoice to auto-clear taxes.
|
||||||
if urd_full:
|
urd_suppliers_count = frappe.db.count("Supplier",
|
||||||
urd_suppliers = frappe.db.sql(
|
{"supplier_group": "Local Market Vendor (Unregistered)"})
|
||||||
"""SELECT name FROM `tabSupplier`
|
ok(f"URD tax via server script — {urd_suppliers_count} URD suppliers registered")
|
||||||
WHERE supplier_group = 'Local Market Vendor (Unregistered)'""",
|
|
||||||
as_dict=1
|
|
||||||
)
|
|
||||||
for s in urd_suppliers:
|
|
||||||
frappe.db.set_value(
|
|
||||||
"Supplier", s.name,
|
|
||||||
"default_purchase_taxes_and_charges_template", urd_full
|
|
||||||
)
|
|
||||||
frappe.db.commit()
|
|
||||||
ok(f"Set '{urd_full}' as default tax on {len(urd_suppliers)} URD supplier(s)")
|
|
||||||
|
|
||||||
|
|
||||||
# ─────────────────────────────────────────────────────────────
|
# ─────────────────────────────────────────────────────────────
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue