2019-12-24 10:29:45 +01:00
|
|
|
# Copyright 2019 ForgeFlow S.L.
|
|
|
|
# (https://www.forgeflow.com)
|
2017-01-21 13:21:45 -07:00
|
|
|
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html).
|
|
|
|
|
2017-11-13 12:40:59 +01:00
|
|
|
from odoo import api, models
|
2017-01-21 13:21:45 -07:00
|
|
|
|
|
|
|
|
2017-03-14 13:33:13 +01:00
|
|
|
class StockMove(models.Model):
|
|
|
|
_inherit = "stock.move"
|
2017-01-21 13:21:45 -07:00
|
|
|
|
|
|
|
@api.model
|
2019-12-24 09:09:12 +01:00
|
|
|
def _prepare_account_move_line(
|
2019-12-24 10:29:45 +01:00
|
|
|
self, qty, cost, credit_account_id, debit_account_id, description
|
2019-12-24 09:09:12 +01:00
|
|
|
):
|
2017-03-14 13:33:13 +01:00
|
|
|
res = super(StockMove, self)._prepare_account_move_line(
|
2019-12-24 10:29:45 +01:00
|
|
|
qty, cost, credit_account_id, debit_account_id, description
|
2019-12-24 09:09:12 +01:00
|
|
|
)
|
2017-01-21 13:21:45 -07:00
|
|
|
for line in res:
|
2019-12-24 09:09:12 +01:00
|
|
|
line[2]["purchase_line_id"] = self.purchase_line_id.id
|
2017-01-21 13:21:45 -07:00
|
|
|
return res
|