2
0
account-financial-tools/account_move_line_sale_info/models/account_move.py
2023-08-03 16:26:06 +02:00

24 lines
573 B
Python

# Copyright 2020 ForgeFlow S.L.
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html).
from odoo import fields, models
class AccountMoveLine(models.Model):
_inherit = 'account.move.line'
sale_line_id = fields.Many2one(
comodel_name='sale.order.line',
string='Sale Order Line',
ondelete='set null', index=True,
)
sale_id = fields.Many2one(
comodel_name='sale.order',
related='sale_line_id.order_id',
string='Sales Order',
ondelete='set null',
store=True, index=True,
)