[fix] [minor] validate same sales rate patch

This commit is contained in:
Nabin Hait 2013-07-18 13:25:47 +05:30
parent 60d9a5e2ee
commit 67e6c80437
2 changed files with 5 additions and 6 deletions

View File

@ -3,11 +3,11 @@ def execute():
webnotes.reload_doc("selling", "doctype", "selling_settings")
ss = webnotes.bean("Selling Settings")
same_rate = webnotes.conn.sql("""select field, value from `tabSingles`
where doctype = 'Global Defaults' and field = 'maintain_same_sales_rate'""")
if same_rate:
ss.doc.maintain_same_sales_rate = same_rate[1]
same_rate = webnotes.conn.get_value("Global Defaults", "maintain_same_sales_rate")
if same_rate or same_rate == 0:
ss.doc.maintain_same_sales_rate = same_rate
else:
ss.doc.maintain_same_sales_rate = 1
ss.save()

View File

@ -33,7 +33,6 @@ keydict = {
'account_url':'account_url',
'session_expiry': 'session_expiry',
'disable_rounded_total': 'disable_rounded_total',
'maintain_same_sales_rate' : 'maintain_same_sales_rate',
}
class DocType: