[IMP] asset: set to draft

bzr revid: fp@tinyerp.com-20111221220636-s13fj8ayikhn1j9j
This commit is contained in:
Fabien Pinckaers 2011-12-21 23:06:36 +01:00
commit f8e926b6cc
2 changed files with 5 additions and 1 deletions

View File

@ -184,6 +184,9 @@ 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=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

@ -114,8 +114,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>