[FIX] account : account assets - reset to draft missing

lp bug: https://launchpad.net/bugs/900783 fixed

bzr revid: bde@tinyerp.com-20111209055959-cbr1c796797olb6r
This commit is contained in:
Bharat (OpenERP) 2011-12-09 11:29:59 +05:30
parent 59b89d88fd
commit e3066c96da
2 changed files with 7 additions and 1 deletions

View File

@ -184,6 +184,11 @@ class account_asset_asset(osv.osv):
def set_to_close(self, cr, uid, ids, context=None):
return self.write(cr, uid, ids, {'state': 'close'}, context=context)
def set_to_draft(self, cr, uid, ids, context=None):
return self.write(cr, uid, ids, {
'state':'draft'
}, context)
def _amount_residual(self, cr, uid, ids, name, args, context=None):
cr.execute("""SELECT
l.asset_id as id, round(SUM(abs(l.debit-l.credit))) AS amount

View File

@ -116,8 +116,9 @@
<newline/>
<separator string="" colspan="4"/>
<field name="state" readonly="1" colspan="2"/>
<group colspan="2" col="2">
<group colspan="2" col="4">
<button name="validate" states="draft" string="Confirm Asset" type="object" icon="terp-camera_test"/>
<button name="set_to_draft" states="open" string="Set to Draft" type="object" icon="gtk-convert"/>
<button name="set_to_close" states="open" string="Set to Close" type="object" icon="gtk-close"/>
</group>
</page>