Files
stock-rma/rma_analytic/models/stock_rule.py
2023-07-19 06:54:43 +00:00

34 lines
772 B
Python

# Copyright (C) 2017-22 ForgeFlow 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,
company_id,
values,
):
res = super()._get_stock_move_values(
product_id,
product_qty,
product_uom,
location_id,
name,
origin,
company_id,
values,
)
if "analytic_account_id" in values:
res["analytic_account_id"] = values.get("analytic_account_id")
return res