mirror of
https://github.com/bringout/oca-ocb-mrp.git
synced 2026-04-26 12:12:01 +02:00
19.0 vanilla
This commit is contained in:
parent
accf5918df
commit
6e65e8c877
688 changed files with 225434 additions and 199401 deletions
|
|
@ -1,8 +1,6 @@
|
|||
# -*- coding: utf-8 -*-
|
||||
# Part of Odoo. See LICENSE file for full copyright and licensing details.
|
||||
|
||||
from odoo import fields, models, _
|
||||
from odoo.exceptions import UserError
|
||||
from odoo import fields, models
|
||||
|
||||
|
||||
class StockQuant(models.Model):
|
||||
|
|
@ -11,7 +9,7 @@ class StockQuant(models.Model):
|
|||
is_subcontract = fields.Boolean(store=False, search='_search_is_subcontract')
|
||||
|
||||
def _search_is_subcontract(self, operator, value):
|
||||
if operator not in ['=', '!='] or not isinstance(value, bool):
|
||||
raise UserError(_('Operation not supported'))
|
||||
|
||||
return [('location_id.is_subcontracting_location', operator, value)]
|
||||
if operator != 'in':
|
||||
return NotImplemented
|
||||
subcontracting_location_ids = self.env.companies.subcontracting_location_id.child_internal_location_ids.ids
|
||||
return [('location_id', operator, subcontracting_location_ids)]
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue