Skip to content

Commit

Permalink
Merge PR #703 into 16.0
Browse files Browse the repository at this point in the history
Signed-off-by AaronHForgeFlow
  • Loading branch information
OCA-git-bot committed Oct 21, 2024
2 parents 7bca0fd + d2a5231 commit f005aa0
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 f005aa0

Please sign in to comment.