2
0
account-financial-tools/account_move_line_purchase_info/models/account_move.py

24 lines
635 B
Python
Raw Normal View History

# Copyright 2017 Eficent Business and IT Consulting Services S.L.
# (www.eficent.com)
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html).
2017-11-13 12:40:59 +01:00
from odoo import fields, models
class AccountMoveLine(models.Model):
_inherit = 'account.move.line'
purchase_line_id = fields.Many2one(
comodel_name='purchase.order.line',
string='Purchase Order Line',
ondelete='set null', index=True,
)
2019-07-29 12:32:21 +02:00
purchase_id = fields.Many2one(
comodel_name='purchase.order',
related='purchase_line_id.order_id',
string='Purchase Order',
store=True, index=True,
)