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