Debian Codegraph @

addons/pos_sale_margin/report/sale_report.py

raw symbols SCIP
1 # -*- coding: utf-8 -*-
2 # Part of Odoo. See LICENSE file for full copyright and licensing details.
3
4 from odoo import models
5
6
7 class SaleReport(models.Model):
8 _inherit = "sale.report"
9
10 def _fill_pos_fields(self, additional_fields):
11 values = super()._fill_pos_fields(additional_fields)
12 values['margin'] = 'SUM((l.price_subtotal - COALESCE(l.total_cost,0)) / CASE COALESCE(pos.currency_rate, 0) WHEN 0 THEN 1.0 ELSE pos.currency_rate END)'
13 return values