Hello to all
I would like to have a readonly on stage fields with Studio (Odoo online 13). Only modify under some conditions.
By example :
IF
stage=1 (New) OR the probability is under 10% OR x_studio_financial_fiability is not true
THEN
readonly on change stage
IF ON stage=2 (Qualified)
the probability is under 40% OR x_studio_applicable_legals is not true
THEN
readonly on change stage
...
This is what I have writing but it does'nt work :
["|","|","|","|","&",["stage_id","=",1],"|",["x_studio_financial_fiability","!=",True],["planned_revenue","=",0],"&",["stage_id","=",2],"|","|","|",["x_studio_financial_fiability","!=",True],["planned_revenue","=",0],["probability","<",40],["x_studio_applicable_legals","=",False],"&",["stage_id","=",3],"|","|","|",["probability","<",40],["x_studio_financial_fiability","!=",True],["x_studio_applicable_legals","=",False],["x_studio_qualified_bu_director","!=",True],"&",["stage_id","=",4],"|","|","|","|","|",["probability","<",40],["x_studio_financial_fiability","!=",True],["x_studio_applicable_legals","=",False],["x_studio_qualified_bu_director","=",True],["x_studio_proposition_bu_director","=",True],["x_studio_proposition_ceo","=",True],"&",["stage_id","=",5],"|","|","|","|","|",["probability","<",40],["x_studio_financial_fiability","!=",True],["x_studio_applicable_legals","=",False],["x_studio_qualified_bu_director","=",True],["x_studio_proposition_bu_director","=",True],["x_studio_proposition_ceo","=",True]]
Is it clear ?
Thanks by advance !
Thanks for answer Chris.
For the 1st, I don't have problem. It's when I want to cumulate conditions that I have some troubles
Could you use Automated Actions instead? That might be easier to setup:
https://www.odoo.com/forum/help-1/question/13232/#answer-147170
I prefer manual action
Automated Actions can allow you to define rules (e.g. cannot move to stage 5 unless it has been qualified by the BU Director and probability > 40%). I think it's quite challenging to put all of that into a domain statement as per your question.
https://odootricks.tips/automated-actions/
Thanks Chris ! It's exactly that ! Thanks so much.
Now I have another problem for give the right access to just 1 group
Suggest you ask another question about access rights with details of what you need.
Chris,
I want to block the access to some fields (like an approval on/off button). Only users with special rights can write on this checkbox. Others users must have readonly rights.
I have trying to do invisible fields for groups but it's not realy that I want, it's not realy user friendly and not UX
I found a solution that works in Odoo 12, but not in Odoo 13. Will try to see whether it can be adapted for Odoo 13!
This is the way to make a field read-only based on user access groups: https://odootricks.tips/odoo-studio-field-attributes-based-on-user-access-groups/