[fix] [minor] rename fix for customer and supplier
This commit is contained in:
parent
ba82163d53
commit
5d3da6c095
@ -151,6 +151,16 @@ class DocType(TransactionBase):
|
|||||||
def before_rename(self, olddn, newdn, merge=False):
|
def before_rename(self, olddn, newdn, merge=False):
|
||||||
from accounts.utils import rename_account_for
|
from accounts.utils import rename_account_for
|
||||||
rename_account_for("Supplier", olddn, newdn, merge)
|
rename_account_for("Supplier", olddn, newdn, merge)
|
||||||
|
self.rename_address(olddn, newdn)
|
||||||
|
self.rename_contact(olddn, newdn)
|
||||||
|
|
||||||
|
def rename_address(self, olddn, newdn):
|
||||||
|
webnotes.conn.sql("""update `tabAddress` set supplier_name=%s,
|
||||||
|
address_title=%s where supplier=%s""", (newdn, newdn, olddn))
|
||||||
|
|
||||||
|
def rename_contact(self,olddn, newdn):
|
||||||
|
webnotes.conn.sql("""update `tabContact` set supplier_name=%s
|
||||||
|
where supplier=%s""", (newdn, olddn))
|
||||||
|
|
||||||
def after_rename(self, olddn, newdn, merge=False):
|
def after_rename(self, olddn, newdn, merge=False):
|
||||||
if webnotes.defaults.get_global_default('supp_master_name') == 'Supplier Name':
|
if webnotes.defaults.get_global_default('supp_master_name') == 'Supplier Name':
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
{
|
{
|
||||||
"creation": "2013-01-22 15:11:38",
|
"creation": "2013-01-22 15:11:38",
|
||||||
"docstatus": 0,
|
"docstatus": 0,
|
||||||
"modified": "2013-12-09 16:25:50",
|
"modified": "2013-12-09 16:56:41",
|
||||||
"modified_by": "Administrator",
|
"modified_by": "Administrator",
|
||||||
"owner": "Administrator"
|
"owner": "Administrator"
|
||||||
},
|
},
|
||||||
@ -102,6 +102,7 @@
|
|||||||
"doctype": "DocField",
|
"doctype": "DocField",
|
||||||
"fieldname": "with_operations",
|
"fieldname": "with_operations",
|
||||||
"fieldtype": "Check",
|
"fieldtype": "Check",
|
||||||
|
"hidden": 0,
|
||||||
"label": "With Operations"
|
"label": "With Operations"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@ -125,6 +126,7 @@
|
|||||||
"doctype": "DocField",
|
"doctype": "DocField",
|
||||||
"fieldname": "operations",
|
"fieldname": "operations",
|
||||||
"fieldtype": "Section Break",
|
"fieldtype": "Section Break",
|
||||||
|
"hidden": 0,
|
||||||
"label": "Operations",
|
"label": "Operations",
|
||||||
"oldfieldtype": "Section Break"
|
"oldfieldtype": "Section Break"
|
||||||
},
|
},
|
||||||
|
|||||||
@ -146,6 +146,16 @@ class DocType(TransactionBase):
|
|||||||
def before_rename(self, olddn, newdn, merge=False):
|
def before_rename(self, olddn, newdn, merge=False):
|
||||||
from accounts.utils import rename_account_for
|
from accounts.utils import rename_account_for
|
||||||
rename_account_for("Customer", olddn, newdn, merge)
|
rename_account_for("Customer", olddn, newdn, merge)
|
||||||
|
self.rename_address(olddn, newdn)
|
||||||
|
self.rename_contact(olddn, newdn)
|
||||||
|
|
||||||
|
def rename_address(self, olddn, newdn):
|
||||||
|
webnotes.conn.sql("""update `tabAddress` set customer_name=%s,
|
||||||
|
address_title=%s where customer=%s""", (newdn, newdn, olddn))
|
||||||
|
|
||||||
|
def rename_contact(self,olddn, newdn):
|
||||||
|
webnotes.conn.sql("""update `tabContact` set customer_name=%s
|
||||||
|
where customer=%s""", (newdn, olddn))
|
||||||
|
|
||||||
def after_rename(self, olddn, newdn, merge=False):
|
def after_rename(self, olddn, newdn, merge=False):
|
||||||
if webnotes.defaults.get_global_default('cust_master_name') == 'Customer Name':
|
if webnotes.defaults.get_global_default('cust_master_name') == 'Customer Name':
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user