Files
odoo-usability/account_invoice_margin/models/account_invoice_report.py
Alexis de Lattre e009106e12 [MIG] account_invoice_margin from v14 to v16
The is not more accidental invalidation in the Odoo ORM, so I switch to
computed field for standard price company currency on invoice line. No
more inherit of create() and write()
2025-01-16 17:08:37 +01:00

18 lines
559 B
Python

# Copyright 2018-2025 Akretion France (https://www.akretion.com)
# @author Alexis de Lattre <alexis.delattre@akretion.com>
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
from odoo import api, fields, models
class AccountInvoiceReport(models.Model):
_inherit = 'account.invoice.report'
margin = fields.Float(string='Margin', readonly=True)
@api.model
def _select(self):
select_str = super()._select()
select_str += ", line.margin_company_currency * currency_table.rate AS margin"
return select_str