diff options
| author | Rémy Voet (ryv) <ryv@odoo.com> | 2020-10-26 10:12:28 +0000 |
|---|---|---|
| committer | Rémy Voet (ryv) <ryv@odoo.com> | 2020-11-06 08:06:11 +0000 |
| commit | 82cae5e87f103d4fee075fef6125e7558432470c (patch) | |
| tree | 98d32e558303020f7d57e2e185ab6907fb0efb80 /addons/mrp | |
| parent | 8c40c6c7fb622c672e0aa645efc7b34c9724237e (diff) | |
[FIX] mrp: company BoM form
Add to `check_company` on `bom_id` of operation, to avoid company issue
after in MO when we create `mrp.workcenter.productivity.loss`.
Also remove the readonly on `company_id` to get the possibility of
modify it if the company_id of BoM change.
Diffstat (limited to 'addons/mrp')
| -rw-r--r-- | addons/mrp/models/mrp_routing.py | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/addons/mrp/models/mrp_routing.py b/addons/mrp/models/mrp_routing.py index aa5624689d9..2d928307887 100644 --- a/addons/mrp/models/mrp_routing.py +++ b/addons/mrp/models/mrp_routing.py @@ -16,13 +16,11 @@ class MrpRoutingWorkcenter(models.Model): 'Sequence', default=100, help="Gives the sequence order when displaying a list of routing Work Centers.") bom_id = fields.Many2one( - 'mrp.bom', 'Bill of Material', + 'mrp.bom', 'Bill of Material', check_company=True, index=True, ondelete='cascade', help="The Bill of Material this operation is linked to") company_id = fields.Many2one( - 'res.company', 'Company', - readonly=True, store=True, - default=lambda self: self.env.company) + 'res.company', 'Company', default=lambda self: self.env.company) worksheet_type = fields.Selection([ ('pdf', 'PDF'), ('google_slide', 'Google Slide'), ('text', 'Text')], string="Work Sheet", default="pdf", |
