mirror of
https://github.com/frappe/erpnext.git
synced 2026-03-17 09:17:15 +00:00
fix: review changes
This commit is contained in:
@@ -18,12 +18,14 @@ class Contract(Document):
|
||||
name = self.party_name
|
||||
|
||||
if self.contract_template:
|
||||
name += " - {} Agreement".format(self.contract_template)
|
||||
name = f"{name} - {self.contract_template} Agreement"
|
||||
|
||||
# If identical, append contract name with the next number in the iteration
|
||||
if frappe.db.exists("Contract", name):
|
||||
count = len(frappe.get_all("Contract", filters={"name": ["like", "%{}%".format(name)]}))
|
||||
name = "{} - {}".format(name, count)
|
||||
count = frappe.db.count('Contract', filters={
|
||||
'name': ('like', f"%{name}%"),
|
||||
})
|
||||
name = f"{name} - {count}"
|
||||
|
||||
self.name = _(name)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user