From f66e6aacd42182684a4a2e0311f8a88a38f0be32 Mon Sep 17 00:00:00 2001 From: Anand Doshi Date: Thu, 24 Sep 2015 14:59:06 +0530 Subject: [PATCH 1/7] [fix] [patch] convert_applicable_territory --- erpnext/patches/v6_3/convert_applicable_territory.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/erpnext/patches/v6_3/convert_applicable_territory.py b/erpnext/patches/v6_3/convert_applicable_territory.py index 483bf8a5957..9ab84ba7f60 100644 --- a/erpnext/patches/v6_3/convert_applicable_territory.py +++ b/erpnext/patches/v6_3/convert_applicable_territory.py @@ -1,12 +1,14 @@ import frappe def execute(): + frappe.reload_doctype("Price List Country") + frappe.reload_doctype("Price List") + frappe.reload_doctype("Shipping Rule") + # for price list countries = frappe.db.sql_list("select name from tabCountry") for doctype in ("Price List", "Shipping Rule"): - frappe.reload_doctype(doctype) - for at in frappe.db.sql("""select name, parent, territory from `tabApplicable Territory` where parenttype = %s """, doctype, as_dict=True): if at.territory in countries: From b3f12c31090db2912ab886909e91c73718f5cd47 Mon Sep 17 00:00:00 2001 From: Anand Doshi Date: Thu, 24 Sep 2015 15:01:27 +0530 Subject: [PATCH 2/7] [fix] [patch] convert_applicable_territory --- erpnext/patches/v6_3/convert_applicable_territory.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/erpnext/patches/v6_3/convert_applicable_territory.py b/erpnext/patches/v6_3/convert_applicable_territory.py index 9ab84ba7f60..74a8b8cffd3 100644 --- a/erpnext/patches/v6_3/convert_applicable_territory.py +++ b/erpnext/patches/v6_3/convert_applicable_territory.py @@ -1,7 +1,7 @@ import frappe def execute(): - frappe.reload_doctype("Price List Country") + frappe.reload_doc("stock", "doctype", "price_list_country") frappe.reload_doctype("Price List") frappe.reload_doctype("Shipping Rule") From e74d7ca33e514db7ad491736fb8193f7c53d7216 Mon Sep 17 00:00:00 2001 From: Anand Doshi Date: Thu, 24 Sep 2015 15:04:15 +0530 Subject: [PATCH 3/7] [fix] [patch] tax rule --- erpnext/patches/v5_8/tax_rule.py | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/erpnext/patches/v5_8/tax_rule.py b/erpnext/patches/v5_8/tax_rule.py index b710ddcbe44..5caabe7feac 100644 --- a/erpnext/patches/v5_8/tax_rule.py +++ b/erpnext/patches/v5_8/tax_rule.py @@ -5,23 +5,25 @@ from __future__ import unicode_literals import frappe 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) - + for d in customers: tr = frappe.new_doc("Tax Rule") tr.tax_type = "Sales" tr.customer = d.name tr.sales_tax_template = d.default_taxes_and_charges 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) - + for d in suppliers: tr = frappe.new_doc("Tax Rule") tr.tax_type = "Purchase" tr.supplier = d.name tr.purchase_tax_template = d.default_taxes_and_charges - tr.save() \ No newline at end of file + tr.save() From 953e97536a3e0c6d1ebc17770ea38358839b62be Mon Sep 17 00:00:00 2001 From: Anand Doshi Date: Thu, 24 Sep 2015 15:05:06 +0530 Subject: [PATCH 4/7] [fix] [patch] tax rule --- erpnext/patches/v5_8/tax_rule.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/erpnext/patches/v5_8/tax_rule.py b/erpnext/patches/v5_8/tax_rule.py index 5caabe7feac..80a23642935 100644 --- a/erpnext/patches/v5_8/tax_rule.py +++ b/erpnext/patches/v5_8/tax_rule.py @@ -5,7 +5,7 @@ from __future__ import unicode_literals import frappe def execute(): - frappe.reload_doc("account", "doctype", "tax_rule") + frappe.reload_doc("accounts", "doctype", "tax_rule") customers = frappe.db.sql("""select name, default_taxes_and_charges from tabCustomer where ifnull(default_taxes_and_charges, '') != '' """, as_dict=1) From bba0a5d38f83d82e80ec0a28266b89bab0e05537 Mon Sep 17 00:00:00 2001 From: Anand Doshi Date: Thu, 24 Sep 2015 15:11:24 +0530 Subject: [PATCH 5/7] [fix] [patch] tax rule --- erpnext/accounts/doctype/tax_rule/tax_rule.py | 20 ++++++------------- 1 file changed, 6 insertions(+), 14 deletions(-) diff --git a/erpnext/accounts/doctype/tax_rule/tax_rule.py b/erpnext/accounts/doctype/tax_rule/tax_rule.py index bcbd5595d40..bff18980b62 100644 --- a/erpnext/accounts/doctype/tax_rule/tax_rule.py +++ b/erpnext/accounts/doctype/tax_rule/tax_rule.py @@ -18,32 +18,24 @@ class TaxRule(Document): def validate(self): self.validate_tax_template() - self.validate_customer_group() - self.validate_supplier_type() self.validate_date() self.validate_filters() def validate_tax_template(self): if self.tax_type== "Sales": self.purchase_tax_template = self.supplier = self.supplier_type= None + if self.customer: + self.customer_group = None + else: self.sales_tax_template= self.customer = self.customer_group= None + if self.supplier: + self.supplier_type = None + if not (self.sales_tax_template or self.purchase_tax_template): frappe.throw(_("Tax Template is mandatory.")) - def validate_customer_group(self): - if self.customer and self.customer_group: - if not frappe.db.get_value("Customer", self.customer, "customer_group") == self.customer_group: - frappe.throw(_("Customer {0} does not belong to customer group {1}"). \ - format(self.customer, self.customer_group), IncorrectCustomerGroup) - - def validate_supplier_type(self): - if self.supplier and self.supplier_type: - if not frappe.db.get_value("Supplier", self.supplier, "supplier_type") == self.supplier_type: - frappe.throw(_("Supplier {0} does not belong to Supplier Type {1}"). \ - format(self.supplier, self.supplier_type), IncorrectSupplierType) - def validate_date(self): if self.from_date and self.to_date and self.from_date > self.to_date: frappe.throw(_("From Date cannot be greater than To Date")) From e75d947867ed5c60a315c1ba73c58eef982f59da Mon Sep 17 00:00:00 2001 From: Anand Doshi Date: Thu, 24 Sep 2015 15:22:12 +0530 Subject: [PATCH 6/7] [fix] [patch] convert applicable territory --- erpnext/patches/v6_3/convert_applicable_territory.py | 1 + 1 file changed, 1 insertion(+) diff --git a/erpnext/patches/v6_3/convert_applicable_territory.py b/erpnext/patches/v6_3/convert_applicable_territory.py index 74a8b8cffd3..b693ce5c3f5 100644 --- a/erpnext/patches/v6_3/convert_applicable_territory.py +++ b/erpnext/patches/v6_3/convert_applicable_territory.py @@ -2,6 +2,7 @@ import frappe def execute(): frappe.reload_doc("stock", "doctype", "price_list_country") + frappe.reload_doc("accounts", "doctype", "shipping_rule_country") frappe.reload_doctype("Price List") frappe.reload_doctype("Shipping Rule") From 7f96c20f5ba2b61917a949cfcc4624ce11a00028 Mon Sep 17 00:00:00 2001 From: Anand Doshi Date: Thu, 24 Sep 2015 15:53:05 +0600 Subject: [PATCH 7/7] bumped to version 6.3.1 --- erpnext/__version__.py | 2 +- erpnext/hooks.py | 2 +- setup.py | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/erpnext/__version__.py b/erpnext/__version__.py index 3a54c17e0ff..2a74e2987ed 100644 --- a/erpnext/__version__.py +++ b/erpnext/__version__.py @@ -1,2 +1,2 @@ from __future__ import unicode_literals -__version__ = '6.3.0' +__version__ = '6.3.1' diff --git a/erpnext/hooks.py b/erpnext/hooks.py index f6daf77072c..e5e3903980f 100644 --- a/erpnext/hooks.py +++ b/erpnext/hooks.py @@ -29,7 +29,7 @@ blogs. """ app_icon = "icon-th" app_color = "#e74c3c" -app_version = "6.3.0" +app_version = "6.3.1" github_link = "https://github.com/frappe/erpnext" error_report_email = "support@erpnext.com" diff --git a/setup.py b/setup.py index 0b523227c76..a6c21646079 100644 --- a/setup.py +++ b/setup.py @@ -1,6 +1,6 @@ from setuptools import setup, find_packages -version = "6.3.0" +version = "6.3.1" with open("requirements.txt", "r") as f: install_requires = f.readlines()