Skip to content

Commit

Permalink
[4873][FIX] stock_analytic (#161)
Browse files Browse the repository at this point in the history
[4873][FIX] stock_analytic (#161)
  • Loading branch information
kanda999 authored Oct 23, 2024
1 parent 60f6499 commit d1b320e
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion stock_analytic/models/stock_move.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,24 @@
# Copyright 2023 Quartile Limited
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).

from odoo import api, models
from odoo import api, fields, models


class StockMove(models.Model):
_name = "stock.move"
_inherit = ["stock.move", "analytic.mixin"]

analytic_distribution = fields.Json(
inverse="_inverse_analytic_distribution",
)

def _inverse_analytic_distribution(self):
"""If analytic distribution is set on move, write it on all move lines"""
for move in self:
move.move_line_ids.write(
{"analytic_distribution": move.analytic_distribution}
)

def _prepare_account_move_line(
self, qty, cost, credit_account_id, debit_account_id, svl_id, description
):
Expand Down

0 comments on commit d1b320e

Please sign in to comment.