Hello Odoo Community,
I am looking to customize the Probability field in Odoo CRM so that it dynamically updates based on the selected Stage in the pipeline. Each stage in the pipeline corresponds to a specific probability percentage. For example:
- Introduction Meeting Scheduled: 15%
- Proposal / Quotation Issued: 50%
What I’ve Tried:
- Automation Rules:
- I created an automation rule to update the probability when the stage changes. While this works, it feels rigid and doesn't allow for easy modifications or new stage additions.
- Compute Field in Studio:
- I attempted to define the probability field as a computed field in Studio with dependencies on stage_id. However, since probability is a base field, Odoo does not allow this and prompts me to use Python code instead.
Goal:
I want to achieve the following:
- Automatically set the Probability field based on the selected Stage.
- Use a mapping between stages and probabilities to make this behavior easy to manage and update.
- Ensure that the probability recalculates dynamically whenever the stage changes.
Questions:
- How can I make the probability field dynamic based on the stage?
- Is there a recommended way to manage stage-to-probability mappings to ensure flexibility (e.g., via database records instead of hardcoding)?
- What are the best practices for implementing this while ensuring compatibility with future Odoo updates?
Thank you for your help! Any suggestions or code snippets would be greatly appreciated. 😊