Skip to Content

Contributors

Re: Seeking Advice on Migrating Custom Pricing Logic to Built-in Features in Odoo 17

Thank U very much Pedro, when I tried to implement the approach 
mentioned before I faced some obstacles (mainly due to when price list 
rules are of same specificity Odoo picks the most expensive) then I 
played with the configuration until finally got it by myself. Your 
confirmation gives me peace of mind. Thanks again for taking the time to 
collaborate.

On 2/23/25 05:23, Pedro M. Baeza wrote:

> You have to set pricelists setting as advanced price rules, define all 

> the lines for specific prices, and add an extra final rule for "All 

> products", Computation = Formula, Based on = Other Pricelist, and 

> select the base pricelist.

>

> Regards.

>

> _______________________________________________

> Mailing-List: https://odoo-community.org/groups/contributors-15

> Post to: mailto:contributors@odoo-community.org

> Unsubscribe: https://odoo-community.org/groups?unsubscribe

>

by Ing. Rolando Pérez Rebollo - 11:51 - 23 Feb 2025

Reference

  • Seeking Advice on Migrating Custom Pricing Logic to Built-in Features in Odoo 17

    Dear Community,

    I hope this message finds you well. I’m reaching out for advice on improving an Odoo 17 setup related to pricing strategies.

    Current Scenario

    The customer has configured 5 pricelists, with each partner assigned to one of them. Additionally, a simple custom development—let’s call it "On Sale"—has been implemented. This feature allows setting:

    • A customer
    • A product
    • A fixed price
    • A date interval

    When a product is selected in a sale order line, the system queries the "On Sale" model. If a match is found, the custom price is applied; otherwise, the default partner’s pricelist is used.

    My Goal

    I’d like to migrate this custom development to built-in or OCA features and remove the custom code. However, I’m struggling to replicate the same user experience (UX) and pricing logic.

    The Challenge

    The fallback mechanism is where I’m stuck. If I:

    1. Create a dedicated pricelist per partner with all relevant "On Sale" records, and
    2. Set this new pricelist on the partner,

    It works fine only if a match exists. However, if there’s no matching rule, I need a way to fallback to the original pricelist assigned to the partner. I haven't found a straightforward way to set a fallback pricelist for each partner using the built-in system.

    Possible Solution?

    The customer is currently using the "Multiple Prices per Product" pricing strategy. I’m considering switching to "Advanced Price Rules" instead. This might allow me to:

    • Create an "On Sale" pricelist for each partner.
    • Set up a "Coordinator" pricelist per partner, with two rules:
      1. A rule that prioritizes the "On Sale" pricelist.
      2. A fallback rule that applies the regular pricelist if no custom price applies.

    In theory, this setup should replicate the current logic while using built-in features. However, I’m not entirely sure if this will maintain the desired behavior without introducing unexpected issues.

    My Questions

    • Is switching to "Advanced Price Rules" the right approach for this scenario?
    • Has anyone faced a similar situation? If so, how did you manage the migration while keeping the UX intact?
    • Are there alternative methods to implement a fallback pricelist for each partner without custom development?

    Any suggestions or shared experiences would be greatly appreciated. Thank you for your time and support!

    Best regards,
    \rrebollo


    by Ing. Rolando Pérez Rebollo - 02:26 - 22 Feb 2025