2018-02-09 14:30:59 +01:00
|
|
|
# Copyright 2017 Eficent Business and IT Consulting Services S.L.
|
|
|
|
# (www.eficent.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
|
2017-03-14 13:33:13 +01:00
|
|
|
def _prepare_account_move_line(self, qty, cost,
|
2017-01-21 13:21:45 -07:00
|
|
|
credit_account_id, debit_account_id):
|
2017-03-14 13:33:13 +01:00
|
|
|
res = super(StockMove, self)._prepare_account_move_line(
|
|
|
|
qty, cost, credit_account_id, debit_account_id)
|
2017-01-21 13:21:45 -07:00
|
|
|
for line in res:
|
2017-03-14 13:33:13 +01:00
|
|
|
line[2]['purchase_line_id'] = self.purchase_line_id.id
|
2017-01-21 13:21:45 -07:00
|
|
|
return res
|