Files
stock-logistics-warehouse/stock_request_mrp/models/stock_rule.py
hveficent d3d11b12fe [13.0][ADD] stock_request_mrp
[UPD] Update stock_request_mrp.pot

[UPD] README.rst
2023-01-13 12:46:50 +01:00

35 lines
806 B
Python

# Copyright 2020 ForgeFlow S.L. (https://www.forgeflow.com)
# License LGPL-3.0 or later (https://www.gnu.org/licenses/lgpl.html).
from odoo import models
class StockRule(models.Model):
_inherit = "stock.rule"
def _prepare_mo_vals(
self,
product_id,
product_qty,
product_uom,
location_id,
name,
origin,
company_id,
values,
bom,
):
res = super()._prepare_mo_vals(
product_id,
product_qty,
product_uom,
location_id,
name,
origin,
company_id,
values,
bom,
)
if "stock_request_id" in values:
res["stock_request_ids"] = [(4, values["stock_request_id"])]
return res