Odoo Mindscape. Understand Odoo faster. Explore modules, fields, dependencies and version differences in one place instead of digging through the source code.

Module: Opportunity to Quotation

Entity: crm.lead

Compute Method: _compute_sale_data

View 19.0 View 20.0
Inputs Method Outputs
  • company_currency
  • order_ids
for lead in self:
            company_currency = lead.company_currency or self.env.company.currency_id
            sale_orders = lead.order_ids.filtered_domain(self._get_lead_sale_order_domain())
            lead.sale_amount_total = sum(
                order.currency_id._convert(
-                     order.amount_untaxed, company_currency, order.company_id, order.date_order or fields.Date.today()
+                     order.amount_total, company_currency, order.company_id, order.date_order,
                )
                for order in sale_orders
            )
            lead.quotation_count = len(lead.order_ids.filtered_domain(self._get_lead_quotation_domain()))
            lead.sale_order_count = len(sale_orders)
  • sale_amount_total
  • quotation_count
  • sale_order_count

Back to entity