Skip to Content
Odoo Meniu
  • Autentificare
  • Try it free
  • Aplicații
    Finanțe
    • Contabilitate
    • Facturare
    • Cheltuieli
    • Spreadsheet (BI)
    • Documente
    • Semn
    Vânzări
    • CRM
    • Vânzări
    • POS Shop
    • POS Restaurant
    • Abonamente
    • Închiriere
    Site-uri web
    • Constructor de site-uri
    • eCommerce
    • Blog
    • Forum
    • Live Chat
    • eLearning
    Lanț Aprovizionare
    • Inventar
    • Producție
    • PLM
    • Achiziție
    • Maintenance
    • Calitate
    Resurse Umane
    • Angajați
    • Recrutare
    • Time Off
    • Evaluări
    • Referințe
    • Flotă
    Marketing
    • Social Marketing
    • Marketing prin email
    • SMS Marketing
    • Evenimente
    • Automatizare marketing
    • Sondaje
    Servicii
    • Proiect
    • Foi de pontaj
    • Servicii de teren
    • Centru de asistență
    • Planificare
    • Programări
    Productivitate
    • Discuss
    • Aprobări
    • IoT
    • VoIP
    • Knowledge
    • WhatsApp
    Aplicații Terțe Odoo Studio Platforma Odoo Cloud
  • Industrii
    Retail
    • Book Store
    • Magazin de îmbrăcăminte
    • Magazin de Mobilă
    • Magazin alimentar
    • Magazin de materiale de construcții
    • Magazin de jucării
    Food & Hospitality
    • Bar and Pub
    • Restaurant
    • Fast Food
    • Guest House
    • Distribuitor de băuturi
    • Hotel
    Proprietate imobiliara
    • Real Estate Agency
    • Firmă de Arhitectură
    • Construcție
    • Estate Managament
    • Grădinărit
    • Asociația Proprietarilor de Proprietăți
    Consultanta
    • Firma de Contabilitate
    • Partener Odoo
    • Agenție de marketing
    • Law firm
    • Atragere de talente
    • Audit & Certification
    Producție
    • Textil
    • Metal
    • Mobilier
    • Mâncare
    • Brewery
    • Cadouri corporate
    Health & Fitness
    • Club Sportiv
    • Magazin de ochelari
    • Centru de Fitness
    • Wellness Practitioners
    • Farmacie
    • Salon de coafură
    Trades
    • Handyman
    • IT Hardware and Support
    • Asigurare socială de stat
    • Cizmar
    • Servicii de curățenie
    • HVAC Services
    Altele
    • Organizație nonprofit
    • Agenție de Mediu
    • Închiriere panouri publicitare
    • Fotografie
    • Închiriere biciclete
    • Asigurare socială
    Browse all Industries
  • Comunitate
    Învăță
    • Tutorials
    • Documentație
    • Certificări
    • Instruire
    • Blog
    • Podcast
    Empower Education
    • Program Educațional
    • Scale Up! Business Game
    • Visit Odoo
    Obține Software-ul
    • Descărcare
    • Compară Edițiile
    • Lansări
    Colaborați
    • Github
    • Forum
    • Evenimente
    • Translations
    • Devino Partener
    • Services for Partners
    • Înregistrează-ți Firma de Contabilitate
    Obține Servicii
    • Găsește un Partener
    • Găsiți un contabil
    • Meet an advisor
    • Servicii de Implementare
    • Referințe ale clienților
    • Suport
    • Actualizări
    Github Youtube Twitter Linkedin Instagram Facebook Spotify
    +1 (650) 691-3277
    Obține un demo
  • Prețuri
  • Ajutor

Odoo is the world's easiest all-in-one management software.
It includes hundreds of business apps:

  • CRM
  • e-Commerce
  • Contabilitate
  • Inventar
  • PoS
  • Proiect
  • MRP
All apps
Trebuie să fiți înregistrat pentru a interacționa cu comunitatea.
All Posts Oameni Insigne
Etichete (View all)
odoo accounting v14 pos v15
Despre acest forum
Trebuie să fiți înregistrat pentru a interacționa cu comunitatea.
All Posts Oameni Insigne
Etichete (View all)
odoo accounting v14 pos v15
Despre acest forum
Suport

Readonly on field with studio

Abonare

Primiți o notificare când există activitate la acestă postare

Această întrebare a fost marcată
readonlyStudio
8 Răspunsuri
4536 Vizualizări
Imagine profil
Sébastien PATTE

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 !

0
Imagine profil
Abandonează
Chris TRINGHAM

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

Chris TRINGHAM

Could you use Automated Actions instead? That might be easier to setup:

https://www.odoo.com/forum/help-1/question/13232/#answer-147170

Chris TRINGHAM

I prefer manual action

Chris TRINGHAM

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/

Chris TRINGHAM

Thanks Chris ! It's exactly that ! Thanks so much.

Now I have another problem for give the right access to just 1 group

Chris TRINGHAM

Suggest you ask another question about access rights with details of what you need.

Chris TRINGHAM

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

Chris TRINGHAM

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!

Chris TRINGHAM

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/

Imagine profil
Chris TRINGHAM
Cel mai bun răspuns

Original answer: 

I don't fully understand your logic, but your first condition should be:

["|","|", 
    ["stage_id","=",1],
    ["probability","<",40],                  
    ["x_studio_financial_fiability","!=",True]
]

One way to get familiar with the notation is to create user-defined filters through the standard Odoo front-end, and you can see what Odoo generates for various combinations of operators and conditions.  

https://odootricks.tips/domain-in-odoo/

----------------------------------------------

Revised answer: I think that rather than trying to put all that logic into one long domain expression it's easier to use Automated Actions for validation  (details and screenshots in link).

As an example, I added an Automated Action on crm. lead (which already has stages)

Trigger condition: On Update

Action To Do: Execute Python Code

Python Code:

# Require Financial Viability
if record.stage_id.name in ['Qualified', 'Proposition', 'Won'] and not record.x_studio_financial_viability:
raise Warning('Please check Financial Viability for this Opportunity!')

# Require Legal Approval
if record.stage_id.name in ['Proposition', 'Won'] and not record.x_studio_legal_approval:
raise Warning('Please check Legal Approval for this Opportunity!')

----------------------------

Part three: Control field attributes based on User Access Groups

0
Imagine profil
Abandonează
Enjoying the discussion? Don't just read, join in!

Create an account today to enjoy exclusive features and engage with our awesome community!

Înscrie-te
Related Posts Răspunsuri Vizualizări Activitate
Creating and using an app created with Studio. Rezolvat
Studio
Imagine profil
Imagine profil
1
oct. 24
2528
Odoo Sales
readonly
Imagine profil
Imagine profil
1
oct. 24
7869
Add table in Tab with Studio
Studio
Imagine profil
Imagine profil
Imagine profil
2
oct. 24
3887
Odoo Studio hide field based on other Field Rezolvat
Studio
Imagine profil
Imagine profil
1
iul. 24
3267
How to Add a Serial Number in Purchase Order Line Automatically when adding line in odoo studio (NO Access To Backend)
Studio
Imagine profil
0
iun. 24
1886
Comunitate
  • Tutorials
  • Documentație
  • Forum
Open Source
  • Descărcare
  • Github
  • Runbot
  • Translations
Servicii
  • Hosting Odoo.sh
  • Suport
  • Actualizare
  • Custom Developments
  • Educație
  • Găsiți un contabil
  • Găsește un Partener
  • Devino Partener
Despre Noi
  • Compania noastră
  • Active de marcă
  • Contactați-ne
  • Locuri de muncă
  • Evenimente
  • Podcast
  • Blog
  • Clienți
  • Aspecte juridice • Confidențialitate
  • Securitate
الْعَرَبيّة Català 简体中文 繁體中文 (台灣) Čeština Dansk Nederlands English Suomi Français Deutsch हिंदी Bahasa Indonesia Italiano 日本語 한국어 (KR) Lietuvių kalba Język polski Português (BR) română русский язык Slovenský jazyk slovenščina Español (América Latina) Español ภาษาไทย Türkçe українська Tiếng Việt

Odoo este o suită de aplicații de afaceri open source care acoperă toate nevoile companiei dvs.: CRM, comerț electronic, contabilitate, inventar, punct de vânzare, management de proiect etc.

Propunerea de valoare unică a Odoo este să fie în același timp foarte ușor de utilizat și complet integrat.

Website made with

Odoo Experience on YouTube

1. Use the live chat to ask your questions.
2. The operator answers within a few minutes.

Live support on Youtube
Watch now