1
0
forked from Mapan/odoo17e
odoo17e-kedaikipas58/addons/sale_subscription/report/sale_report.py
2024-12-10 09:04:09 +07:00

22 lines
671 B
Python

# -*- coding: utf-8 -*-
# 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
s.subscription_state != '7_upsell'
)
"""
return res