2020-04-09 11:09:34 +02:00
|
|
|
# Copyright 2019 ForgeFlow S.L.
|
|
|
|
# (https://www.forgeflow.com)
|
|
|
|
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html).
|
|
|
|
|
2023-03-16 10:19:41 +01:00
|
|
|
from odoo import models
|
2020-04-09 11:09:34 +02:00
|
|
|
|
|
|
|
|
|
|
|
class StockMove(models.Model):
|
|
|
|
_inherit = "stock.move"
|
|
|
|
|
|
|
|
def _prepare_account_move_line(
|
2023-03-16 10:19:41 +01:00
|
|
|
self, qty, cost, credit_account_id, debit_account_id, svl_id, description
|
2020-04-09 11:09:34 +02:00
|
|
|
):
|
|
|
|
res = super(StockMove, self)._prepare_account_move_line(
|
2023-03-16 10:19:41 +01:00
|
|
|
qty, cost, credit_account_id, debit_account_id, svl_id, description
|
2020-04-09 11:09:34 +02:00
|
|
|
)
|
|
|
|
for line in res:
|
|
|
|
line[2]["purchase_line_id"] = self.purchase_line_id.id
|
|
|
|
return res
|