Skip to Content
Odoo Menu
  • Prijavi
  • Try it free
  • Aplikacije
    Finance
    • Knjigovodstvo
    • Obračun
    • Stroški
    • Spreadsheet (BI)
    • Dokumenti
    • Podpisovanje
    Prodaja
    • CRM
    • Prodaja
    • POS Shop
    • POS Restaurant
    • Naročnine
    • Najem
    Spletne strani
    • Website Builder
    • Spletna trgovina
    • Blog
    • Forum
    • Pogovor v živo
    • eUčenje
    Dobavna veriga
    • Zaloga
    • Proizvodnja
    • PLM
    • Nabava
    • Vzdrževanje
    • Kakovost
    Kadri
    • Kadri
    • Kadrovanje
    • Odsotnost
    • Ocenjevanja
    • Priporočila
    • Vozni park
    Marketing
    • Družbeno Trženje
    • Email Marketing
    • SMS Marketing
    • Dogodki
    • Avtomatizacija trženja
    • Ankete
    Storitve
    • Projekt
    • Časovnice
    • Storitve na terenu
    • Služba za pomoč
    • Načrtovanje
    • Termini
    Produktivnost
    • Razprave
    • Odobritve
    • IoT
    • Voip
    • Znanje
    • WhatsApp
    Third party apps Odoo Studio Odoo Cloud Platform
  • Industrije
    Trgovina na drobno
    • Book Store
    • Trgovina z oblačili
    • Trgovina s pohištvom
    • Grocery Store
    • Trgovina s strojno opremo računalnikov
    • Trgovina z igračami
    Food & Hospitality
    • Bar and Pub
    • Restavracija
    • Hitra hrana
    • Guest House
    • Beverage Distributor
    • Hotel
    Nepremičnine
    • Real Estate Agency
    • Arhitekturno podjetje
    • Gradbeništvo
    • Estate Management
    • Vrtnarjenje
    • Združenje lastnikov nepremičnin
    Svetovanje
    • Računovodsko podjetje
    • Odoo Partner
    • Marketinška agencija
    • Law firm
    • Pridobivanje talentov
    • Audit & Certification
    Proizvodnja
    • Tekstil
    • Metal
    • Pohištvo
    • Hrana
    • Brewery
    • Poslovna darila
    Health & Fitness
    • Športni klub
    • Trgovina z očali
    • Fitnes center
    • Wellness Practitioners
    • Lekarna
    • Frizerski salon
    Trades
    • Handyman
    • IT Hardware & Support
    • Sistemi sončne energije
    • Izdelovalec čevljev
    • Čistilne storitve
    • HVAC Services
    Ostali
    • Neprofitna organizacija
    • Agencija za okolje
    • Najem oglasnih panojev
    • Fotografija
    • Najem koles
    • Prodajalec programske opreme
    Browse all Industries
  • Skupnost
    Learn
    • Tutorials
    • Dokumentacija
    • Certifikati
    • Šolanje
    • Blog
    • Podcast
    Empower Education
    • Education Program
    • Scale Up! Business Game
    • Visit Odoo
    Get the Software
    • Prenesi
    • Compare Editions
    • Releases
    Collaborate
    • Github
    • Forum
    • Dogodki
    • Prevodi
    • Become a Partner
    • Services for Partners
    • Register your Accounting Firm
    Get Services
    • Find a Partner
    • Find an Accountant
    • Meet an advisor
    • Implementation Services
    • Sklici kupca
    • Podpora
    • Upgrades
    Github Youtube Twitter Linkedin Instagram Facebook Spotify
    +1 (650) 691-3277
    Get a demo
  • Določanje cen
  • Pomoč

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

  • CRM
  • e-Commerce
  • Knjigovodstvo
  • Zaloga
  • PoS
  • Projekt
  • MRP
All apps
You need to be registered to interact with the community.
All Posts People Badges
Ključne besede (View all)
odoo accounting v14 pos v15
About this forum
You need to be registered to interact with the community.
All Posts People Badges
Ključne besede (View all)
odoo accounting v14 pos v15
About this forum
Pomoč

Restrict vendor and product creation in V17

Naroči se

Get notified when there's activity on this post

This question has been flagged
accessrightsvendorstudio
3 Odgovori
4943 Prikazi
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
Opusti
Avatar
Vinsinfo Pvt Ltd
Best Answer

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
Opusti
dhivya.n@galileosolutionpartners.com
Avtor

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
Avtor

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

Avatar
dhivya.n@galileosolutionpartners.com
Avtor Best Answer

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
Opusti
Vinsinfo Pvt Ltd

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

Avatar
Jainesh Shah(Aktiv Software)
Best Answer

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
Opusti
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!

Prijavi
Related Posts Odgovori Prikazi Aktivnost
Custom Access Rights are not visible in normal mode, Only visible under Developer mode (v16)
access rights
Avatar
0
avg. 23
8
How to learn Access Rights
access rights
Avatar
Avatar
Avatar
2
nov. 22
4416
In a project only the admin can see the team members but the user can't
access rights
Avatar
Avatar
2
mar. 15
5384
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
mar. 22
3915
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
sep. 19
1890
Community
  • Tutorials
  • Dokumentacija
  • Forum
Open Source
  • Prenesi
  • Github
  • Runbot
  • Prevodi
Services
  • Odoo.sh Hosting
  • Podpora
  • Nadgradnja
  • Custom Developments
  • Izobraževanje
  • Find an Accountant
  • Find a Partner
  • Become a Partner
About us
  • Our company
  • Sredstva blagovne znamke
  • Kontakt
  • Zaposlitve
  • Dogodki
  • Podcast
  • Blog
  • Stranke
  • Pravno • Zasebnost
  • Varnost
الْعَرَبيّة 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 is a suite of open source business apps that cover all your company needs: CRM, eCommerce, accounting, inventory, point of sale, project management, etc.

Odoo's unique value proposition is to be at the same time very easy to use and fully integrated.

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