mirror of
https://github.com/OCA/stock-logistics-warehouse.git
synced 2025-01-21 14:27:28 +02:00
43 lines
1.0 KiB
Python
43 lines
1.0 KiB
Python
# Copyright 2017 Eficent Business and IT Consulting Services, S.L.
|
|
# 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 _get_stock_move_values(
|
|
self,
|
|
product_id,
|
|
product_qty,
|
|
product_uom,
|
|
location_id,
|
|
name,
|
|
origin,
|
|
values,
|
|
group_id,
|
|
):
|
|
result = super(StockRule, self)._get_stock_move_values(
|
|
product_id,
|
|
product_qty,
|
|
product_uom,
|
|
location_id,
|
|
name,
|
|
origin,
|
|
values,
|
|
group_id,
|
|
)
|
|
if values.get("stock_request_id", False):
|
|
result["allocation_ids"] = [
|
|
(
|
|
0,
|
|
0,
|
|
{
|
|
"stock_request_id": values.get("stock_request_id"),
|
|
"requested_product_uom_qty": product_qty,
|
|
},
|
|
)
|
|
]
|
|
return result
|