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

How can I add a security group to an existing base module ?

Odoberať

Get notified when there's activity on this post

This question has been flagged
purchaseodoo8Groupssecurity.xml
1 Odpoveď
11329 Zobrazenia
Avatar
Paraita Wohler

Hi Odooers !
I'd like to know how I can either modify an existing security group or add a new one to an existing module ? In my case I need to have a security group to only allow read access to purchase orders and purchase orders lines (Purchase module). I'd like to do that through a new module that will extend the existing purchase module. I tried to add the following xml to my module's security xml:

<record id="group_purchase_user" model="res.groups">
<field name="name">Consulter</field>
<field name="implied_ids" eval="[(4, ref('base.group_user'))]"/>
<field name="category_id" ref="base.module_category_purchase_management"/>
</record>

With the following rules:

access_purchase_order_readonly,access_purchase_order_readonly,purchase.model_purchase_order,group_purchase_user,1,0,0,0
access_purchase_order_line_readonly,access_purchase_order_line_readonly,purchase.model_purchase_order_line,group_purchase_user,1,0,0,0

Thinking I could override the existing "User" security group of Purchase.

I also tried to add a new security group with new security rules in the same fashion:

<record id="group_consult_internal_purchase" model="res.groups">
<field name="name">Consulter</field>
<field name="implied_ids" eval="[(4, ref('base.group_user'))]"/>
<field name="category_id" ref="base.module_category_purchase_management"/>
</record>
access_purchase_order_readonly,access_purchase_order_readonly,purchase.model_purchase_order, group_consult_internal_purchase,1,0,0,0
access_purchase_order_line_readonly,access_purchase_order_line_readonly,purchase.model_purchase_order_line, group_consult_internal_purchase,1,0,0,0

I tried to find examples in the documentation or the internet but I couldn't find any so I'm even sure that's possible.

Help please ?



0
Avatar
Zrušiť
Avatar
Niyas Raphy (Walnut Software Solutions)
Best Answer

Hi,

There are some existing record rules and access rights for this models in the odoo source code, you might need to inherit and change those rules for achieving what you are trying to do.


For Changing an existing record rule, you can do it like this,

<record model="ir.rule" id="purchase_order_line_comp_rule">
<field name="name">Purchase Order Line multi-company</field>
<field name="model_id" ref="model_purchase_order_line"/>
<field name="global" eval="True"/>
<field name="domain_force">['|',('company_id','=',False),('company_id','child_of',[user.company_id.id])]</field>
</record>


The above rule is defined in the purchase module, suppose if i need to change the domain to empty for this rule from my custom module what i have to do is ,

<record model="ir.rule" id="purchase.purchase_order_line_comp_rule">
<field name="domain_force"></field>
</record>


Copy existing rule to your module, remove those lines you don't want to make changes and change the id to original_module_name.orginal_id . In the above code, you can see i have changed the id purchase_order_line_comp_rule to purchase.purchase_order_line_comp_rule . This is how you can change existing record rules.


For Changing existing access rights,you have to follow same procedures, replace the id with original_module_name.id .


Thanks

1
Avatar
Zrušiť
Paraita Wohler
Autor

Thanks for the answer ! do you think it is also possible to add a new security group to an existing module from my custom module ?

Niyas Raphy (Walnut Software Solutions)

Yes, it can be done

Hesham Amoudi

how can i add a new group to the list of module groups

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
Relating the fleet module with the purchases module
fleet purchase odoo8
Avatar
Avatar
Avatar
3
sep 15
4622
Include delivery charges in purchase orders
purchase charge odoo8
Avatar
2
máj 15
5544
V18 picking the wrong line for a PO
purchase
Avatar
0
nov 25
354
Product duplicated multiple times in "RFQ" created from approval module "PR"
purchase
Avatar
Avatar
1
nov 25
300
Limit products to their suppliers/vendors
purchase
Avatar
Avatar
Avatar
Avatar
3
sep 25
1168
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