Skip to Content
Menu
This question has been flagged
5 Replies
3544 Views

Hi, we have a probability field say 5% in opportunities, we then create a sales order, we would like that 5% probability field to pull into the sale order. This means I can then pull in a forecast for our sales team. 

I'm using Odoo studio and the probability field is a float field, I just can't seem to find what dependancies the opportunities is i.e. crm_lead.probability. Please could someone help?

Avatar
Discard

Are you asking for the name of the probability field? https://github.com/odoo/odoo/blob/10.0/addons/crm/models/crm_lead.py#L113 - see here for the Python file that defines the field.

Hi Ray,

Thank you for the response. I’m aware of what the field is called, I’m just trying to pull this field value directly into the quote. 

I thought I would use odoo Studio and create a new field and use float as field type followed by add Related Field. I’ve successfully used this to pull in fields from sales orders into projects by using the following sales_line_id.fieldname

I thought I would be able to use something like crm_lead.probability but it doesn’t seem to work, not sure if you know what the first but should be? 

Best Answer

If you want to bring information from one model into another model, you need to leverage a field that already links the two.

Each Sales Order has a field called opportunity_id which links it back to the Opportunity.

So having a related field opportunity_id.probability will show the probability field from the opportunity linked via the opportunity_id field.

Avatar
Discard
Author Best Answer

Thank you for this Ray, that works perfectl! 

How do you find in odoo that base field like opportunity_id? 

Many Thanks for your help

Avatar
Discard

It is nice to say thanks, but in this forum the proper way to thank is upvoting the answer and mark check it as answered.

Best Answer

Hi Tim,


Best way is to avoid customizing.

I would suggest you add a new CRM stage named "quotation or Proposition etc" and place in it all opportunities for which you have issued a quote. Next you can when you group your opportunities by stage in list view, you can use the pivot view of your CRM pipeline to check how much expected revenue and probability are in this new stage.

Avatar
Discard