mirror of
https://github.com/frappe/erpnext.git
synced 2026-05-31 18:59:08 +00:00
[minor] merge conflict
This commit is contained in:
@@ -27,6 +27,14 @@ class DocType(TransactionBase):
|
||||
else:
|
||||
self.doc.name = make_autoname(self.doc.naming_series + '.#####')
|
||||
|
||||
def update_address(self):
|
||||
webnotes.conn.sql("""update `tabAddress` set supplier_name=%s, modified=NOW()
|
||||
where supplier=%s""", (self.doc.supplier_name, self.doc.name))
|
||||
|
||||
def update_contact(self):
|
||||
webnotes.conn.sql("""update `tabContact` set supplier_name=%s, modified=NOW()
|
||||
where supplier=%s""", (self.doc.supplier_name, self.doc.name))
|
||||
|
||||
def update_credit_days_limit(self):
|
||||
webnotes.conn.sql("""update tabAccount set credit_days = %s where name = %s""",
|
||||
(cint(self.doc.credit_days), self.doc.name + " - " + self.get_company_abbr()))
|
||||
@@ -35,6 +43,9 @@ class DocType(TransactionBase):
|
||||
if not self.doc.naming_series:
|
||||
self.doc.naming_series = ''
|
||||
|
||||
self.update_address()
|
||||
self.update_contact()
|
||||
|
||||
# create account head
|
||||
self.create_account_head()
|
||||
|
||||
@@ -151,10 +162,19 @@ class DocType(TransactionBase):
|
||||
def before_rename(self, olddn, newdn, merge=False):
|
||||
from accounts.utils import rename_account_for
|
||||
rename_account_for("Supplier", olddn, newdn, merge)
|
||||
|
||||
|
||||
def after_rename(self, olddn, newdn, merge=False):
|
||||
set_field = ''
|
||||
if webnotes.defaults.get_global_default('supp_master_name') == 'Supplier Name':
|
||||
webnotes.conn.set(self.doc, "supplier_name", newdn)
|
||||
self.update_contact()
|
||||
set_field = ", supplier_name=%(newdn)s"
|
||||
self.update_supplier_address(newdn, set_field)
|
||||
|
||||
def update_supplier_address(self, newdn, set_field):
|
||||
webnotes.conn.sql("""update `tabAddress` set address_title=%(newdn)s
|
||||
{set_field} where supplier=%(newdn)s"""\
|
||||
.format(set_field=set_field), ({"newdn": newdn}))
|
||||
|
||||
@webnotes.whitelist()
|
||||
def get_dashboard_info(supplier):
|
||||
|
||||
Reference in New Issue
Block a user