Files
odoo_source/addons/mrp/wizard/stock_warn_insufficient_qty.py
T
Simon Lejeune 96406dc2a9 [REF] mrp: multi company
Ensure proper domains are applied and enforced on relation fields thanks
to the `check_company` attributes.

Make sure unbuild have proper sequence for each companies.

The produce wizard and workorders company is the one of the production.
The BoM line company_id is the one of its bom_id.
Added some tests.

task-1985992
2019-09-03 15:05:03 +00:00

20 lines
607 B
Python

# -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from odoo import api, fields, models
class StockWarnInsufficientQtyUnbuild(models.TransientModel):
_name = 'stock.warn.insufficient.qty.unbuild'
_inherit = 'stock.warn.insufficient.qty'
_description = 'Warn Insufficient Unbuild Quantity'
unbuild_id = fields.Many2one('mrp.unbuild', 'Unbuild')
def _get_reference_document_company_id(self):
return self.unbuild_id.company_id
def action_done(self):
self.ensure_one()
return self.unbuild_id.action_unbuild()