Skip to Content
Odoo Menu
  • Prihlásiť sa
  • Vyskúšajte zadarmo
  • Aplikácie
    Financie
    • Účtovníctvo
    • Fakturácia
    • Výdavky
    • Tabuľka (BI)
    • Dokumenty
    • Podpis
    Predaj
    • CRM
    • Predaj
    • POS Shop
    • POS Restaurant
    • Manažment odberu
    • Požičovňa
    Webstránky
    • Tvorca webstránok
    • eShop
    • Blog
    • Fórum
    • Živý chat
    • eLearning
    Supply Chain
    • Sklad
    • Výroba
    • Správa životného cyklu produktu
    • Nákup
    • Údržba
    • Manažment kvality
    Ľudské zdroje
    • Zamestnanci
    • Nábor zamestnancov
    • Voľné dni
    • Hodnotenia
    • Odporúčania
    • Vozový park
    Marketing
    • Marketing sociálnych sietí
    • Email marketing
    • SMS marketing
    • Eventy
    • Marketingová automatizácia
    • Prieskumy
    Služby
    • Projektové riadenie
    • Pracovné výkazy
    • Práca v teréne
    • Helpdesk
    • Plánovanie
    • Schôdzky
    Produktivita
    • Tímová komunikácia
    • Schvalovania
    • IoT
    • VoIP
    • Znalosti
    • WhatsApp
    Third party apps Odoo Studio Odoo Cloud Platform
  • Priemyselné odvetvia
    Retail
    • Book Store
    • Clothing Store
    • Furniture Store
    • Grocery Store
    • Hardware Store
    • Toy Store
    Food & Hospitality
    • Bar and Pub
    • Reštaurácia
    • Fast Food
    • Guest House
    • Beverage distributor
    • Hotel
    Reality
    • Real Estate Agency
    • Architecture Firm
    • Konštrukcia
    • Estate Managament
    • Gardening
    • Property Owner Association
    Poradenstvo
    • Accounting Firm
    • Odoo Partner
    • Marketing Agency
    • Law firm
    • Talent Acquisition
    • Audit & Certification
    Výroba
    • Textile
    • Metal
    • Furnitures
    • Jedlo
    • Brewery
    • Corporate Gifts
    Health & Fitness
    • Sports Club
    • Eyewear Store
    • Fitness Center
    • Wellness Practitioners
    • Pharmacy
    • Hair Salon
    Trades
    • Handyman
    • IT Hardware and Support
    • Solar Energy Systems
    • Shoe Maker
    • Cleaning Services
    • HVAC Services
    Iní
    • Nonprofit Organization
    • Environmental Agency
    • Billboard Rental
    • Photography
    • Bike Leasing
    • Software Reseller
    Browse all Industries
  • Komunita
    Vzdelávanie
    • Tutoriály
    • Dokumentácia
    • Certifikácie
    • Školenie
    • Blog
    • Podcast
    Empower Education
    • Vzdelávací program
    • Scale Up! Business Game
    • Visit Odoo
    Softvér
    • Stiahnuť
    • Porovnanie Community a Enterprise vierzie
    • Releases
    Spolupráca
    • Github
    • Fórum
    • Eventy
    • Preklady
    • Staň sa partnerom
    • Services for Partners
    • Register your Accounting Firm
    Služby
    • Nájdite partnera
    • Nájdite účtovníka
    • Meet an advisor
    • Implementation Services
    • Zákaznícke referencie
    • Podpora
    • Upgrades
    ​Github Youtube Twitter Linkedin Instagram Facebook Spotify
    +1 (650) 691-3277
    Získajte demo
  • Cenník
  • Pomoc

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

  • CRM
  • e-Commerce
  • Účtovníctvo
  • Sklady
  • PoS
  • Projektové riadenie
  • MRP
All apps
You need to be registered to interact with the community.
All Posts People Badges
Tagy (View all)
odoo accounting v14 pos v15
About this forum
You need to be registered to interact with the community.
All Posts People Badges
Tagy (View all)
odoo accounting v14 pos v15
About this forum
Pomoc

Readonly on field with studio

Odoberať

Get notified when there's activity on this post

This question has been flagged
readonlyStudio
8 Replies
4535 Zobrazenia
Avatar
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
Avatar
Zrušiť
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/

Avatar
Chris TRINGHAM
Best Answer

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
Avatar
Zrušiť
Enjoying the discussion? Don't just read, join in!

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

Registrácia
Related Posts Replies Zobrazenia Aktivita
Creating and using an app created with Studio. Solved
Studio
Avatar
Avatar
1
okt 24
2528
Odoo Sales
readonly
Avatar
Avatar
1
okt 24
7869
Add table in Tab with Studio
Studio
Avatar
Avatar
Avatar
2
okt 24
3887
Odoo Studio hide field based on other Field Solved
Studio
Avatar
Avatar
1
júl 24
3267
How to Add a Serial Number in Purchase Order Line Automatically when adding line in odoo studio (NO Access To Backend)
Studio
Avatar
0
jún 24
1886
Komunita
  • Tutoriály
  • Dokumentácia
  • Fórum
Open Source
  • Stiahnuť
  • Github
  • Runbot
  • Preklady
Služby
  • Odoo.sh hosting
  • Podpora
  • Vyššia verzia
  • Custom Developments
  • Vzdelávanie
  • Nájdite účtovníka
  • Nájdite partnera
  • Staň sa partnerom
O nás
  • Naša spoločnosť
  • Majetok značky
  • Kontaktujte nás
  • Pracovné ponuky
  • Eventy
  • Podcast
  • Blog
  • Zákazníci
  • Právne dokumenty • Súkromie
  • Bezpečnosť
الْعَرَبيّة 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 je sada podnikových aplikácií s otvoreným zdrojovým kódom, ktoré pokrývajú všetky potreby vašej spoločnosti: CRM, e-shop, účtovníctvo, skladové hospodárstvo, miesto predaja, projektový manažment atď.

Odoo prináša vysokú pridanú hodnotu v jednoduchom použití a súčasne plne integrovanými biznis aplikáciami.

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