mirror of
https://github.com/frappe/erpnext.git
synced 2026-09-17 10:36:31 +00:00
[Fix] Tax rule is not working for the parent customer groups (#10458)
This commit is contained in:
committed by
Makarand Bauskar
parent
222e86bb13
commit
6b1624cfee
@@ -18,3 +18,10 @@ class CustomerGroup(NestedSet):
|
||||
def validate_name_with_customer(self):
|
||||
if frappe.db.exists("Customer", self.name):
|
||||
frappe.msgprint(_("An Customer exists with same name"), raise_exception=1)
|
||||
|
||||
def get_parent_customer_groups(customer_group):
|
||||
lft, rgt = frappe.db.get_value("Customer Group", customer_group, ['lft', 'rgt'])
|
||||
|
||||
return frappe.db.sql("""select name from `tabCustomer Group`
|
||||
where lft <= %s and rgt >= %s
|
||||
order by lft asc""", (lft, rgt), as_dict=True)
|
||||
Reference in New Issue
Block a user