[IMP] stock: changes in change_standard_prize_view.xml and refactored name of variables

bzr revid: mso@mso-20100325110002-zt7uu5x1glclaj45
This commit is contained in:
mso 2010-03-25 16:30:02 +05:30
parent a500c187cc
commit a57878a9c0
2 changed files with 16 additions and 17 deletions

View File

@ -27,10 +27,9 @@ class change_standard_price(osv.osv_memory):
_description = "Change Standard Price"
_columns = {
'new_price': fields.float('Price', required=True),
'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),
'stock_account_input':fields.many2one('account.account', 'Stock Input Account'),
'stock_account_output':fields.many2one('account.account', 'Stock Output Account'),
'stock_journal':fields.many2one('account.journal', 'Stock journal', required=True),
'enable_stock_in_out_acc':fields.boolean('Enable Related Account',),
}
@ -63,12 +62,12 @@ class change_standard_price(osv.osv_memory):
if 'new_price' in fields:
res.update({'new_price': price})
if 'property_stock_account_input' in fields:
res.update({'property_stock_account_input': stock_input_acc})
if 'property_stock_account_output' in fields:
res.update({'property_stock_account_output': stock_output_acc})
if 'property_stock_journal' in fields:
res.update({'property_stock_journal': journal_id})
if 'stock_account_input' in fields:
res.update({'stock_account_input': stock_input_acc})
if 'stock_account_output' in fields:
res.update({'stock_account_output': stock_output_acc})
if 'stock_journal' in fields:
res.update({'stock_journal': journal_id})
if 'enable_stock_in_out_acc' in fields:
res.update({'enable_stock_in_out_acc': True})
@ -112,9 +111,9 @@ class change_standard_price(osv.osv_memory):
loc_ids = location_obj.search(cr, uid, [('account_id','<>',False),('usage','=','internal')])
new_price = res[0].new_price
stock_output_acc = res[0].property_stock_account_output.id
stock_input_acc = res[0].property_stock_account_input.id
journal_id = res[0].property_stock_journal.id
stock_output_acc = res[0].stock_account_output.id
stock_input_acc = res[0].stock_account_input.id
journal_id = res[0].stock_journal.id
move_ids = []
for location in location_obj.browse(cr, uid, loc_ids):

View File

@ -9,12 +9,12 @@
<form string="Change Standard Price">
<field name="new_price" on_change="onchange_price(new_price, context)" context="{'active_id': active_id}"/>
<newline/>
<field name="property_stock_account_input" domain="[('type','&lt;&gt;','view'),('type','&lt;&gt;','consolidation')]" attrs="{'readonly':[('enable_acc','=',False)]}"/>
<field name="stock_account_input" domain="[('type','&lt;&gt;','view'),('type','&lt;&gt;','consolidation')]" attrs="{'readonly':[('enable_stock_in_out_acc','=',False)],'required': [('enable_stock_in_out_acc','=',True)]}"/>
<newline/>
<field name="property_stock_account_output" domain="[('type','&lt;&gt;','view'),('type','&lt;&gt;','consolidation')]" attrs="{'readonly':[('enable_acc','=',True)]}"/>
<field name="stock_account_output" domain="[('type','&lt;&gt;','view'),('type','&lt;&gt;','consolidation')]" attrs="{'readonly':[('enable_stock_in_out_acc','=',True)],'required': [('enable_stock_in_out_acc','=',False)]}"/>
<newline/>
<field name="property_stock_journal"/>
<field name="enable_acc" invisible="1"/>
<field name="stock_journal"/>
<field name="enable_stock_in_out_acc" invisible="1"/>
<group col="2" colspan="4">
<button special="cancel" string="Cancel" icon="gtk-cancel"/>
<button name="change_price" string="Change" type="object" icon="gtk-ok"/>