Skip to Content
Menu
This question has been flagged
2 Replies
2979 Views

Hello everyone!

I'm new to Odoo. I am trying out Odoo Community v15 on a local machine for my enterprise. With the CRM and Sales modules, I have learnt that Sales Quotes can be created directly from the Opportunity details screen. However, when creating a quotation, the expected revenue does not change to it's final price, and my employees have to change it manually.

I can't seem to find a way to have that field update automatically, based on the total sum of costs from both quotes and confirmed orders. Is there a configuration I may have missed? Or should I implement that function with code? If so, how would I do that?

Thanks in advance.

Avatar
Discard
Best Answer

You can totally do it, with automatization rules. Im using this rule in Odoo v17 Entrepice.

1. Model: Sale Order
2. Activate: When saving
3. Match: all.
4. Apply: in all.
5. Update: non.

*Acctions*

Execute code:

today = datetime.datetime.today()

quotation_domain = [('state', 'not in', ('cancel',))]

for so in records:

    company_currency = so.opportunity_id.company_currency or env.company.currency_id

    lead = so.opportunity_id

    sale_orders = lead.order_ids.filtered_domain(quotation_domain)

    sale_amount_total = sum(

        order.currency_id._convert(

            order.amount_untaxed, company_currency, order.company_id, order.date_order or today

        )

        for order in sale_orders

    )

    lead.write({'expected_revenue':sale_amount_total})



Let me know if you need further explanation.

Avatar
Discard
Best Answer

Hello, 

No, There is no any kind of setting or configuration that based on quote amount, It will update the Expected Revenue field.

You have to manually put the Expected Revenue into Opportunity.

Thanks & Regards,



CandidRoot Solutions Pvt. Ltd.

Mobile: (+91) 8849036209
Email: info@candidroot.com
Skype: live:candidroot
Web: https://www.candidroot.com
Address: 1229-1230, Iconic Shyamal, Near Shyamal Cross Road, Ahmedabad, Gujarat

Avatar
Discard
Related Posts Replies Views Activity
1
Apr 20
3369
3
Oct 15
5897
0
Dec 24
1065
0
Sep 24
1083
1
Jul 23
2024