mirror of
https://github.com/OCA/manufacture.git
synced 2025-01-28 16:37:15 +02:00
[IMP] mrp_bom_version: use new api correctly
This commit is contained in:
@@ -6,7 +6,13 @@ MRP - BoM Version
|
||||
=================
|
||||
|
||||
This module provides a state in the BoM whether to allow their use in
|
||||
manufacturing, to do the following states are defined:
|
||||
manufacturing.
|
||||
|
||||
|
||||
Usage
|
||||
=====
|
||||
|
||||
The following states are defined:
|
||||
|
||||
* **Draft**:
|
||||
The form will be available for data entry, and may move to "active" state.
|
||||
@@ -31,9 +37,6 @@ to be unique.
|
||||
changing state to draft
|
||||
|
||||
|
||||
Usage
|
||||
=====
|
||||
|
||||
.. image:: https://odoo-community.org/website/image/ir.attachment/5784_f2813bd/datas
|
||||
:alt: Try me on Runbot
|
||||
:target: https://runbot.odoo-community.org/runbot/129/8.0
|
||||
|
||||
@@ -78,10 +78,11 @@ class MrpBom(models.Model):
|
||||
|
||||
@api.multi
|
||||
def button_draft(self):
|
||||
self.ensure_one()
|
||||
self.active = (self.company_id.active_draft if self.company_id else
|
||||
self.env.user.company_id.active_draft)
|
||||
self.state = 'draft'
|
||||
self.write({
|
||||
'active': (self.company_id.active_draft if self.company_id else
|
||||
self.env.user.company_id.active_draft),
|
||||
'state': 'draft',
|
||||
})
|
||||
|
||||
@api.multi
|
||||
def button_new_version(self):
|
||||
@@ -108,7 +109,6 @@ class MrpBom(models.Model):
|
||||
|
||||
@api.multi
|
||||
def button_activate(self):
|
||||
self.ensure_one()
|
||||
self.write({
|
||||
'active': True,
|
||||
'state': 'active'
|
||||
@@ -116,7 +116,6 @@ class MrpBom(models.Model):
|
||||
|
||||
@api.multi
|
||||
def button_historical(self):
|
||||
self.ensure_one()
|
||||
self.write({
|
||||
'active': False,
|
||||
'state': 'historical',
|
||||
|
||||
Reference in New Issue
Block a user