Skip to content

Commit

Permalink
Merge PR #706 into 17.0
Browse files Browse the repository at this point in the history
Signed-off-by AaronHForgeFlow
  • Loading branch information
OCA-git-bot committed Oct 23, 2024
2 parents a3b8d65 + b43d912 commit 07b2235
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 07b2235

Please sign in to comment.