Odoo18-Base/addons/project_stock_landed_costs/models/stock_landed_costs.py
2025-01-06 10:57:38 +07:00

14 lines
474 B
Python

# Part of Odoo. See LICENSE file for full copyright and licensing details.
from odoo import models
class AdjustmentLines(models.Model):
_inherit = 'stock.valuation.adjustment.lines'
def _prepare_account_move_line_values(self):
res = super()._prepare_account_move_line_values()
if self.cost_id.target_model == 'picking':
res['analytic_distribution'] = self.move_id.picking_id.project_id._get_analytic_distribution()
return res