[fix] [patch] tax rule
This commit is contained in:
parent
b3f12c3109
commit
e74d7ca33e
@ -5,23 +5,25 @@ from __future__ import unicode_literals
|
|||||||
import frappe
|
import frappe
|
||||||
|
|
||||||
def execute():
|
def execute():
|
||||||
customers = frappe.db.sql("""select name, default_taxes_and_charges from tabCustomer where
|
frappe.reload_doc("account", "doctype", "tax_rule")
|
||||||
|
|
||||||
|
customers = frappe.db.sql("""select name, default_taxes_and_charges from tabCustomer where
|
||||||
ifnull(default_taxes_and_charges, '') != '' """, as_dict=1)
|
ifnull(default_taxes_and_charges, '') != '' """, as_dict=1)
|
||||||
|
|
||||||
for d in customers:
|
for d in customers:
|
||||||
tr = frappe.new_doc("Tax Rule")
|
tr = frappe.new_doc("Tax Rule")
|
||||||
tr.tax_type = "Sales"
|
tr.tax_type = "Sales"
|
||||||
tr.customer = d.name
|
tr.customer = d.name
|
||||||
tr.sales_tax_template = d.default_taxes_and_charges
|
tr.sales_tax_template = d.default_taxes_and_charges
|
||||||
tr.save()
|
tr.save()
|
||||||
|
|
||||||
|
|
||||||
suppliers = frappe.db.sql("""select name, default_taxes_and_charges from tabSupplier where
|
|
||||||
|
suppliers = frappe.db.sql("""select name, default_taxes_and_charges from tabSupplier where
|
||||||
ifnull(default_taxes_and_charges, '') != '' """, as_dict=1)
|
ifnull(default_taxes_and_charges, '') != '' """, as_dict=1)
|
||||||
|
|
||||||
for d in suppliers:
|
for d in suppliers:
|
||||||
tr = frappe.new_doc("Tax Rule")
|
tr = frappe.new_doc("Tax Rule")
|
||||||
tr.tax_type = "Purchase"
|
tr.tax_type = "Purchase"
|
||||||
tr.supplier = d.name
|
tr.supplier = d.name
|
||||||
tr.purchase_tax_template = d.default_taxes_and_charges
|
tr.purchase_tax_template = d.default_taxes_and_charges
|
||||||
tr.save()
|
tr.save()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user