[IMP] sale: unlock button

Add similar behavior to the one available in Purchase.
This commit is contained in:
Nicolas Martinelli
2017-02-16 09:15:55 +01:00
parent 66fc48e89c
commit bdccf5bd64
2 changed files with 5 additions and 0 deletions
+4
View File
@@ -442,6 +442,10 @@ class SaleOrder(models.Model):
def action_done(self):
self.write({'state': 'done'})
@api.multi
def action_unlock(self):
self.write({'state': 'sale'})
@api.model
def _prepare_procurement_group(self):
return {'name': self.name}
+1
View File
@@ -165,6 +165,7 @@
<button name="action_draft" states="cancel" type="object" string="Set to Quotation"/>
<button name="action_done" type="object" string="Lock" states="sale"
help="If the sale is locked, you can not modify it anymore. However, you will still be able to invoice or deliver."/>
<button name="action_unlock" type="object" string="Unlock" states="done" groups="sales_team.group_sale_manager"/>
<field name="state" widget="statusbar" statusbar_visible="draft,sent,sale"/>
</header>
<sheet>