[IMP]when sale order is cancelled,now it can be reset as draft

bzr revid: kbh@tinyerp.com-20121029062903-13oxndmzs3r7ti2p
This commit is contained in:
Khushboo Bhatt (Open ERP) 2012-10-29 11:59:03 +05:30
parent e5a7eb11bc
commit e48a9a3029
2 changed files with 6 additions and 0 deletions

View File

@ -580,6 +580,11 @@ class sale_order(osv.osv):
self.write(cr, uid, ids, {'state': 'cancel'})
return True
def action_draft(self, cr, uid, ids, context=None):
"""Resets Sale Order as draft.
"""
return self.write(cr, uid, ids, {'state':'draft'}, context=context)
def action_button_confirm(self, cr, uid, ids, context=None):
assert len(ids) == 1, 'This option should only be used for a single id at a time.'
wf_service = netsvc.LocalService('workflow')

View File

@ -164,6 +164,7 @@
<field name="arch" type="xml">
<form string="Sales Order" version="7.0">
<header>
<button name="action_draft" string="Reset to Draft" states="cancel" type="object"/>
<button name="invoice_recreate" states="invoice_except" string="Recreate Invoice" groups="base.group_user"/>
<button name="invoice_corrected" states="invoice_except" string="Ignore Exception" groups="base.group_user"/>
<button name="action_quotation_send" string="Send by Mail" type="object" states="draft" class="oe_highlight" groups="base.group_user"/>