2018-02-09 14:30:59 +01:00
|
|
|
# Copyright 2017 Eficent Business and IT Consulting Services S.L.
|
|
|
|
# (www.eficent.com)
|
2017-01-21 21:21:45 +01: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 fields, models
|
2017-01-21 21:21:45 +01:00
|
|
|
|
|
|
|
|
|
|
|
class AccountMoveLine(models.Model):
|
|
|
|
|
2019-12-24 09:09:12 +01:00
|
|
|
_inherit = "account.move.line"
|
2017-01-21 21:21:45 +01:00
|
|
|
|
2018-02-09 14:30:59 +01:00
|
|
|
purchase_line_id = fields.Many2one(
|
2019-12-24 09:09:12 +01:00
|
|
|
comodel_name="purchase.order.line",
|
|
|
|
string="Purchase Order Line",
|
|
|
|
ondelete="set null",
|
|
|
|
index=True,
|
2018-02-09 14:30:59 +01:00
|
|
|
)
|
2019-07-29 12:32:21 +02:00
|
|
|
|
|
|
|
purchase_id = fields.Many2one(
|
2019-12-24 09:09:12 +01:00
|
|
|
comodel_name="purchase.order",
|
|
|
|
related="purchase_line_id.order_id",
|
|
|
|
string="Purchase Order",
|
|
|
|
store=True,
|
|
|
|
index=True,
|
2019-07-29 12:32:21 +02:00
|
|
|
)
|