[IMP] Usability Issue: Distribution Models Form view and Analytic Account Form view

bzr revid: ara@tinyerp.com-20101222125549-ha0i2b3ipucl3rfu
This commit is contained in:
ARA (OpenERP)
2010-12-22 18:25:49 +05:30
parent 36a998b4ae
commit 305ec9080e
2 changed files with 5 additions and 20 deletions
@@ -76,33 +76,20 @@ class account_analytic_account(osv.osv):
}
_defaults = {
'pricelist_id': lambda self, cr, uid, ctx: ctx.get('pricelist_id', False),
'state': 'draft'
}
def set_close(self, cr, uid, ids, context=None):
self.write(cr, uid, ids, {'state':'close'}, context=context)
return True
return self.write(cr, uid, ids, {'state':'close'}, context=context)
def set_cancel(self, cr, uid, ids, context=None):
self.write(cr, uid, ids, {'state':'cancelled'}, context=context)
return True
return self.write(cr, uid, ids, {'state':'cancelled'}, context=context)
def set_open(self, cr, uid, ids, context=None):
self.write(cr, uid, ids, {'state':'open'}, context=context)
return True
return self.write(cr, uid, ids, {'state':'open'}, context=context)
def set_pending(self, cr, uid, ids, context=None):
self.write(cr, uid, ids, {'state':'pending'}, context=context)
return True
def set_template(self, cr, uid, ids, context=None):
self.write(cr, uid, ids, {'state':'template'}, context=context)
return True
def reset_account(self, cr, uid, ids, context=None):
self.write(cr, uid, ids, {'state':'open'}, context=context)
return True
return self.write(cr, uid, ids, {'state':'pending'}, context=context)
account_analytic_account()
@@ -18,11 +18,9 @@
<group col="9" colspan="8">
<field name="state" readonly="1"/>
<button name="set_cancel" string="Cancel" type="object" states="open,pending" icon="gtk-cancel"/>
<button name="set_template" string="Set as Template" type="object" states="open" icon="gtk-convert"/>
<button name="set_open" string="Reactivate Account" type="object" states="pending,cancelled,close" icon="gtk-ok"/>
<button name="set_pending" string="Pending" type="object" states="open" icon="gtk-media-pause"/>
<button name="set_close" string="Close" type="object" states="open,pending" icon="terp-dialog-close"/>
<button name="reset_account" string="Reset as Account" type="object" states="template" icon="gtk-convert"/>
</group>
</group>
</field>