mirror of
https://github.com/bringout/oca-technical.git
synced 2026-04-20 22:52:03 +02:00
Initial commit: OCA Technical packages (595 packages)
This commit is contained in:
commit
2cc02aac6e
24950 changed files with 2318079 additions and 0 deletions
|
|
@ -0,0 +1,22 @@
|
|||
# Copyright 2018 ForgeFlow S.L. (http://www.forgeflow.com)
|
||||
# License LGPL-3.0 or later (https://www.gnu.org/licenses/lgpl.html).
|
||||
|
||||
from odoo import api, models
|
||||
|
||||
|
||||
class MultiLevelMrp(models.TransientModel):
|
||||
_inherit = "mrp.multi.level"
|
||||
|
||||
@api.model
|
||||
def _exclude_from_mrp(self, product, mrp_area):
|
||||
"""Exclude from MRP scheduler products that are buffered."""
|
||||
res = super()._exclude_from_mrp(product, mrp_area)
|
||||
ddmrp = self.env["stock.buffer"].search(
|
||||
[
|
||||
("location_id", "=", mrp_area.location_id.id), # child of?
|
||||
("product_id", "=", product.id),
|
||||
]
|
||||
)
|
||||
if ddmrp and not self.env.context.get("mrp_explosion"):
|
||||
return True
|
||||
return res
|
||||
Loading…
Add table
Add a link
Reference in a new issue