[IMP] asset: set to draft
bzr revid: fp@tinyerp.com-20111221220636-s13fj8ayikhn1j9j
This commit is contained in:
commit
f8e926b6cc
|
@ -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
|
||||
|
|
|
@ -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>
|
||||
|
|
Loading…
Reference in New Issue