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

Inputs Method Outputs
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()
                )
                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)

Back to entity