Files
enterprise-addons/sale_subscription/report/sale_report.py
T

24 lines
752 B
Python

# Part of Odoo. See LICENSE file for full copyright and licensing details.
from odoo import models
class SaleReport(models.Model):
_inherit = 'sale.report'
def _where_sale(self):
res = super()._where_sale()
# Do not add upsell information to the sales report
# as it will be updated on the original sale order.
# Note: this analysis may not be accurate because
# it does not take account of discounts, for example.
res += """
AND (
s.subscription_state IS NULL OR
(t.recurring_invoice IS False AND
s.subscription_state = '7_upsell') OR
s.subscription_state != '7_upsell'
)
"""
return res