mirror of
https://github.com/frappe/erpnext.git
synced 2026-09-17 18:45:20 +00:00
feat(Selling): Added Territory wise treeview to 'Customer Acquistion and Loyalty' report
This commit is contained in:
@@ -3,8 +3,6 @@
|
||||
|
||||
from __future__ import unicode_literals
|
||||
import frappe
|
||||
|
||||
|
||||
from frappe.utils import flt
|
||||
from frappe import _
|
||||
|
||||
@@ -14,6 +12,9 @@ class Territory(NestedSet):
|
||||
nsm_parent_field = 'parent_territory'
|
||||
|
||||
def validate(self):
|
||||
if frappe.db.sql("SELECT COUNT(name) FROM `tabTerritory` WHERE parent IS NULL")[0][0] > 1:
|
||||
frappe.throw('Only one Root Territory is allowed, please select a Parent Territory!')
|
||||
|
||||
for d in self.get('targets') or []:
|
||||
if not flt(d.target_qty) and not flt(d.target_amount):
|
||||
frappe.throw(_("Either target qty or target amount is mandatory"))
|
||||
|
||||
Reference in New Issue
Block a user