[IMP] stock: Removed unnecessary code in change_standard_price wizard and name of an variable has been changed

bzr revid: mso@mso-20100325085749-7v012mfw2s5ppot8
This commit is contained in:
mso 2010-03-25 14:27:49 +05:30
parent b2c2c36791
commit 8c323b03d1
1 changed files with 6 additions and 22 deletions

View File

@ -30,24 +30,8 @@ class change_standard_price(osv.osv_memory):
'property_stock_account_input':fields.many2one('account.account', 'Stock Input Account', required=True),
'property_stock_account_output':fields.many2one('account.account', 'Stock Output Account', required=True),
'property_stock_journal':fields.many2one('account.journal', 'Stock journal', required=True),
# 'property_stock_account_input': fields.property('account.account',
# type='many2one', relation='account.account',
# string='Stock Input Account', method=True, view_load=True,
# help='This account will be used, instead of the default one, to value input stock'),
# 'property_stock_account_output': fields.property('account.account',
# type='many2one', relation='account.account',
# string='Stock Output Account', method=True, view_load=True,
# help='This account will be used, instead of the default one, to value output stock'),
#
# 'property_stock_journal': fields.property('account.journal',
# relation='account.journal', type='many2one',
# string='Stock journal', method=True, view_load=True,
# required = True,
# help="This journal will be used for the accounting move generated by stock move"),
'enable_acc':fields.boolean('Enable Related Account',),
'property_stock_journal':fields.many2one('account.journal', 'Stock journal', required=True),
'enable_stock_in_out_acc':fields.boolean('Enable Related Account',),
}
def default_get(self, cr, uid, fields, context):
@ -85,8 +69,8 @@ class change_standard_price(osv.osv_memory):
res.update({'property_stock_account_output': stock_output_acc})
if 'property_stock_journal' in fields:
res.update({'property_stock_journal': journal_id})
if 'enable_acc' in fields:
res.update({'enable_acc': True})
if 'enable_stock_in_out_acc' in fields:
res.update({'enable_stock_in_out_acc': True})
return res
@ -96,9 +80,9 @@ class change_standard_price(osv.osv_memory):
price = product_obj.standard_price
diff = price - new_price
if diff > 0 :
return {'value' : {'enable_acc':False}}
return {'value' : {'enable_stock_in_out_acc':False}}
else :
return {'value' : {'enable_acc':True}}
return {'value' : {'enable_stock_in_out_acc':True}}
def change_price(self, cr, uid, ids, context):
"""