Přejít na obsah
Odoo Menu
  • Přihlásit se
  • Vyzkoušejte zdarma
  • Aplikace
    Finance
    • Účetnictví
    • Fakturace
    • Výdaje
    • Spreadsheet (BI)
    • Dokumenty
    • Podpisy
    Prodej
    • CRM
    • Prodej
    • POS Obchod
    • POS Restaurace
    • Předplatné
    • Pronájem
    Webové stránky
    • Webové stránky
    • E-shop
    • Blog
    • Fórum
    • Živý chat
    • eLearning
    Dodavatelský řetězec
    • Sklad
    • Výroba
    • PLM
    • Nákup
    • Údržba
    • Kvalita
    Lidské zdroje
    • Zaměstnanci
    • Nábor
    • Volno
    • Hodnocení zaměstnanců
    • Doporučení
    • Vozový park
    Marketing
    • Marketing sociálních sítí
    • Emailový marketing
    • SMS Marketing
    • Události
    • Marketingová automatizace
    • Dotazníky
    Služby
    • Projekt
    • Časové výkazy
    • Práce v terénu
    • Helpdesk
    • Plánování
    • Schůzky
    Produktivita
    • Diskuze
    • Schvalování
    • IoT
    • VoIP
    • Znalosti
    • WhatsApp
    Aplikace třetích stran Odoo Studio Odoo cloudová platforma
  • Branže
    Maloobchod
    • Knihkupectví
    • Obchod s oblečením
    • Obchod s nábytkem
    • Potraviny
    • Obchod s hardwarem
    • Hračkářství
    Jídlo a pohostinství
    • Bar a Pub
    • Restaurace
    • Fast Food
    • Penzion
    • Distributor nápojů
    • Hotel
    Nemovitost
    • Realitní kancelář
    • Architektonická firma
    • Stavba
    • Správa nemovitostí
    • Zahradnictví
    • Asociace vlastníků nemovitosti
    Poradenství
    • Účetní firma
    • Odoo Partner
    • Marketingová agentura
    • Právník
    • Akvizice talentů
    • Audit a certifikace
    Výroba
    • Textil
    • Kov
    • Nábytek
    • Jídlo
    • Pivovar
    • Korporátní dárky
    Zdraví a fitness
    • Sportovní klub
    • Prodejna brýli
    • Fitness Centrum
    • Wellness praktikové
    • Lékárna
    • Kadeřnictví
    Transakce
    • Údržbář
    • Podpora IT & hardware
    • Systémy solární energie
    • Výrobce obuvi
    • Úklidové služby
    • Služby HVAC
    Ostatní
    • Nezisková organizace
    • Agentura pro životní prostředí
    • Pronájem billboardů
    • Fotografování
    • Leasing jízdních kol
    • Prodejce softwaru
    Procházet všechna odvětví
  • Komunita
    Edukační program
    • Tutoriály
    • Dokumentace
    • Certifikace
    • Vzdělávání
    • Blog
    • Podcast
    Podpora vzdělávání
    • Vzdělávací program
    • Scale Up! Hra na firmu
    • Navštivte Odoo
    Získat software
    • Stáhnout
    • Porovnejte edice
    • Verze
    Spolupráce
    • Github
    • Fórum
    • Události
    • Překlady
    • Stát se partnerem
    • Služby pro partnery
    • Registrujte svou účetní firmu
    Získat služby
    • Najít partnera
    • Najít účetní
    • Setkejte se s poradcem
    • Implementační služby
    • Zákaznické reference
    • Podpora
    • Upgrady
    Github Youtube Twitter Linkedin Instagram Facebook Spotify
    +1 (650) 691-3277
    Dohodnout demo
  • Ceník
  • Pomoc

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

  • CRM
  • e-Commerce
  • Účetnictví
  • Sklad
  • PoS
  • Projekty
  • MRP
All apps
You need to be registered to interact with the community.
All Posts Lidé Odznaky
Štítky (View all)
odoo accounting v14 pos v15
O tomto fóru
You need to be registered to interact with the community.
All Posts Lidé Odznaky
Štítky (View all)
odoo accounting v14 pos v15
O tomto fóru
Pomoc

Restrict vendor and product creation in V17

Odebírat

Get notified when there's activity on this post

This question has been flagged
accessrightsvendorstudio
3 Odpovědi
4951 Zobrazení
Avatar
dhivya.n@galileosolutionpartners.com

How to restrict vendor creation without affecting customer in odoo 17 ? from all he forms. 
Please advice, if i remove create access in res.partner object. Can't allowing to create customer  also. Without affecting customer part I want to restrict vendor creation. 


I want to restrict product creation by access rights or using studio, without touching the coding part

0
Avatar
Zrušit
Avatar
Vinsinfo Pvt Ltd
Nejlepší odpověď

Hi,


You can restrict vendor creation without affecting customer creation in Odoo by following these steps:


1. Go to Settings and enable Developer Mode.

2. Create a new group in Settings > Users & Companies > Groups > New. Add all the users to whom you want to give create access, and select all the access rights for that group.

3. Create a new record rule in Settings > Technical > Record Rules under the Security section with the configuration below:

Domain filter: Ensure to include the group ID (116 in this example) that we created earlier.

4. Now, only the users in the newly created group can create a vendor.

5. After these configurations, non-access members may still be able to create a vendor (who are typically not vendors) as a contact in the Product template purchase tab. To prevent this, restrict the "Create" and "Create/Edit" permissions for all users using the Studio application.


Click Studio icon from the product template page and click on purchase tab and select Edit list view.


After that click "Vendor" on the list view and check the highlighted checkboxes on the left side of the screen and save the changes.



Hope this helps.


Thanks.

1
Avatar
Zrušit
dhivya.n@galileosolutionpartners.com
Autor

When I try to save this record rule getting this warning "Invalid domain: not enough values to unpack (expected 3, got 1)"

['I', ('supplier_rank', '=',0), ('create_uid.groups_id', 'in', [226])]

Vinsinfo Pvt Ltd

In the domain filter, you wrongly placed 'I' instead of '|'. That's why the warning is raised. Replace it with ['|', ('supplier_rank', '=', 0), ('create_uid.groups_id', 'in', [226])] and it will work fine.

dhivya.n@galileosolutionpartners.com
Autor

Yes, it is works fine to restrict vendor creation. Can I restrict product creation by this way?

Avatar
dhivya.n@galileosolutionpartners.com
Autor Nejlepší odpověď

Without touching the coding part I want to restrict. From the front end edit form view or studio or using access rights group.

0
Avatar
Zrušit
Vinsinfo Pvt Ltd

Replace the domain filter with ['|', ('supplier_rank', '=',0), ('create_uid.groups_id', 'in', [226])]

Avatar
Jainesh Shah(Aktiv Software)
Nejlepší odpověď

Hello dhivya.n@galileosolutionpartners.com,


To restrict the creation of vendors in Odoo 17 while allowing customers to be created, follow these refined steps to implement a comprehensive solution:



1. if you want to remove create access for specific vendor view for same res.partner obj ,you can manage by this in res.partner you can use get_view method.

//Code1 in Comment//

by this contact creation is not restricted, only vendor creation is restricted as you can see below images




2. if you want to raise error at time of vendor creation add below code of snippet in res_partner.py file.

//Code2 in Comment//

3. To restrict vendor creation totally, you have to remove create access from the product template's puchase tab and in purchase order , so for that add below snippet code in xml file.


//Code3 in Comment//


by using this you can restrict vendor creation by considering multiple scenario as I have Provided.


Hope this Helps,


If you need any help in customization feel free to contact us..


Thanks & Regards,

Email:  odoo@aktivsoftware.com           

Skype: kalpeshmaheshwari

0
Avatar
Zrušit
Jainesh Shah(Aktiv Software)

Code 1:

@api.model
def get_views(self, views, options=None):
res = super().get_views(views=views, options=options)
action_id = self.env["ir.actions.act_window"].browse(options.get("action_id"))
context = ast.literal_eval(action_id.context)
context.update({'create': False})
action_id.context = context
return res

Code 2 :

@api.model
def create(self, vals):
res = super().create(vals)
if self.env.context.get("res_partner_search_mode") == 'supplier':
raise UserError("You can't create vendor !!")
return res

Code 3:

<record id="product_supplierinfo_subcontractor_tree_view_test" model="ir.ui.view">
<field name="name">product.supplierinfo.subcontractor.tree.view.test</field>
<field name="model">product.supplierinfo</field>
<field name="inherit_id" ref="product.product_supplierinfo_tree_view"/>
<field name="arch" type="xml">
<xpath expr="//field[@name='partner_id']" position="attributes">
<attribute name="options">{'no_create': True, 'no_open': True}</attribute>
</xpath>
</field>
</record>

<record id="view_purchase_order_form" model="ir.ui.view">
<field name="name">purchase.order.form</field>
<field name="model">purchase.order</field>
<field name="inherit_id" ref="purchase.purchase_order_form"/>
<field name="arch" type="xml">
<field name="partner_id" position="attributes">
<attribute name="options">{'no_create': True, 'no_open': True}</attribute>
</field>
</field>
</record>

Enjoying the discussion? Don't just read, join in!

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

Přihlásit se
Related Posts Odpovědi Zobrazení Aktivita
Custom Access Rights are not visible in normal mode, Only visible under Developer mode (v16)
access rights
Avatar
0
srp 23
8
How to learn Access Rights
access rights
Avatar
Avatar
Avatar
2
lis 22
4418
In a project only the admin can see the team members but the user can't
access rights
Avatar
Avatar
2
bře 15
5386
The requested operation cannot be completed due to security restrictions. Please contact your system administrator. document type: users, operation:read.
error access rights
Avatar
Avatar
1
bře 22
3917
Expenses App | Can I blocked the modification of fields "Manager" and "Journal account" for a new expenses request entered by a basic user ?
expenses access rights
Avatar
0
zář 19
1890
Komunita
  • Tutoriály
  • Dokumentace
  • Fórum
Open Source
  • Stáhnout
  • Github
  • Runbot
  • Překlady
Služby
  • Odoo.sh hostování
  • Podpora
  • Upgrade
  • Nestandardní vývoj
  • Edukační program
  • Najít účetní
  • Najít partnera
  • Stát se partnerem
O nás
  • Naše společnost
  • Podklady značky
  • Kontakujte nás
  • Práce
  • Události
  • Podcast
  • Blog
  • Zákazníci
  • Právní dokumenty • Soukromí
  • Zabezpečení
الْعَرَبيّة 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 balíček open-source aplikací, které pokrývají všechny potřeby vaší společnosti: CRM, e-shop, účetnictví, sklady, kasy, projektové řízení a další.

Unikátní nabídka od Odoo poskytuje velmi jednoduché uživatelské rozhraní a vše je integrované na jednom místě.

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