Skip to Content
Odoo Menu
  • Zaloguj się
  • Wypróbuj za darmo
  • Aplikacje
    Finanse
    • Księgowość
    • Fakturowanie
    • Wydatki
    • Arkusz kalkulacyjny (BI)
    • Dokumenty
    • Podpisy
    Sprzedaż
    • CRM
    • Sprzedaż
    • PoS Sklep
    • PoS Restauracja
    • Subskrypcje
    • Wypożyczalnia
    Strony Internetowe
    • Kreator Stron Internetowych
    • eCommerce
    • Blog
    • Forum
    • Czat na Żywo
    • eLearning
    Łańcuch dostaw
    • Magazyn
    • Produkcja
    • PLM
    • Zakupy
    • Konserwacja
    • Jakość
    Zasoby Ludzkie
    • Pracownicy
    • Rekrutacja
    • Urlopy
    • Ocena pracy
    • Polecenia Pracownicze
    • Flota
    Marketing
    • Marketing Społecznościowy
    • E-mail Marketing
    • SMS Marketing
    • Wydarzenia
    • Automatyzacja Marketingu
    • Ankiety
    Usługi
    • Projekt
    • Ewidencja czasu pracy
    • Usługi Terenowe
    • Helpdesk
    • Planowanie
    • Spotkania
    Produktywność
    • Dyskusje
    • Zatwierdzenia
    • IoT
    • VoIP
    • Baza wiedzy
    • WhatsApp
    Aplikacje trzecich stron Studio Odoo Odoo Cloud Platform
  • Branże
    Sprzedaż detaliczna
    • Księgarnia
    • Sklep odzieżowy
    • Sklep meblowy
    • Sklep spożywczy
    • Sklep z narzędziami
    • Sklep z zabawkami
    Żywienie i hotelarstwo
    • Bar i Pub
    • Restauracja
    • Fast Food
    • Pensjonat
    • Dystrybutor napojów
    • Hotel
    Agencja nieruchomości
    • Agencja nieruchomości
    • Biuro architektoniczne
    • Budowa
    • Zarządzanie nieruchomościami
    • Ogrodnictwo
    • Stowarzyszenie właścicieli nieruchomości
    Doradztwo
    • Biuro księgowe
    • Partner Odoo
    • Agencja marketingowa
    • Kancelaria prawna
    • Agencja rekrutacyjna
    • Audyt i certyfikacja
    Produkcja
    • Tekstylia
    • Metal
    • Meble
    • Jedzenie
    • Browar
    • Prezenty firmowe
    Zdrowie & Fitness
    • Klub sportowy
    • Salon optyczny
    • Centrum fitness
    • Praktycy Wellness
    • Apteka
    • Salon fryzjerski
    Transakcje
    • Złota rączka
    • Wsparcie Sprzętu IT
    • Systemy energii słonecznej
    • Szewc
    • Firma sprzątająca
    • Usługi HVAC
    Inne
    • Organizacja non-profit
    • Agencja Środowiskowa
    • Wynajem billboardów
    • Fotografia
    • Leasing rowerów
    • Sprzedawca oprogramowania
    Przeglądaj wszystkie branże
  • Community
    Ucz się
    • Samouczki
    • Dokumentacja
    • Certyfikacje
    • Szkolenie
    • Blog
    • Podcast
    Pomóż w nauce innym
    • Program Edukacyjny
    • Scale Up! Gra biznesowa
    • Odwiedź Odoo
    Skorzystaj z oprogramowania
    • Pobierz
    • Porównaj edycje
    • Wydania
    Współpracuj
    • Github
    • Forum
    • Wydarzenia
    • Tłumaczenia
    • Zostań partnerem
    • Usługi dla partnerów
    • Zarejestruj swoją firmę rachunkową
    Skorzystaj z usług
    • Znajdź partnera
    • Znajdź księgowego
    • Spotkaj się z doradcą
    • Usługi wdrożenia
    • Opinie klientów
    • Wsparcie
    • Aktualizacje
    Github Youtube Twitter Linkedin Instagram Facebook Spotify
    +1 (650) 691-3277
    Zaplanuj demo
  • Cennik
  • Pomoc

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

  • CRM
  • e-Commerce
  • Księgowość
  • Zapasy
  • PoS
  • Projekt
  • MRP
All apps
Musisz się zarejestrować, aby móc wchodzić w interakcje z tą społecznością.
Wszystkie posty Osoby Odznaki
Tagi (Zobacz wszystko)
odoo accounting v14 pos v15
O tym forum
Musisz się zarejestrować, aby móc wchodzić w interakcje z tą społecznością.
Wszystkie posty Osoby Odznaki
Tagi (Zobacz wszystko)
odoo accounting v14 pos v15
O tym forum
Pomoc

Restrict vendor and product creation in V17

Zaprenumeruj

Otrzymaj powiadomienie o aktywności w tym poście

To pytanie dostało ostrzeżenie
accessrightsvendorstudio
3 Odpowiedzi
4939 Widoki
Awatar
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
Awatar
Odrzuć
Awatar
Vinsinfo Pvt Ltd
Najlepsza odpowiedź

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
Awatar
Odrzuć
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?

Awatar
dhivya.n@galileosolutionpartners.com
Autor Najlepsza odpowiedź

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

0
Awatar
Odrzuć
Vinsinfo Pvt Ltd

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

Awatar
Jainesh Shah(Aktiv Software)
Najlepsza odpowiedź

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
Awatar
Odrzuć
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>

Podoba Ci się ta dyskusja? Dołącz do niej!

Stwórz konto dzisiaj, aby cieszyć się ekskluzywnymi funkcjami i wchodzić w interakcje z naszą wspaniałą społecznością!

Zarejestruj się
Powiązane posty Odpowiedzi Widoki Czynność
Custom Access Rights are not visible in normal mode, Only visible under Developer mode (v16)
access rights
Awatar
0
sie 23
8
How to learn Access Rights
access rights
Awatar
Awatar
Awatar
2
lis 22
4413
In a project only the admin can see the team members but the user can't
access rights
Awatar
Awatar
2
mar 15
5382
The requested operation cannot be completed due to security restrictions. Please contact your system administrator. document type: users, operation:read.
error access rights
Awatar
Awatar
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
Awatar
0
wrz 19
1890
Społeczność
  • Samouczki
  • Dokumentacja
  • Forum
Open Source
  • Pobierz
  • Github
  • Runbot
  • Tłumaczenia
Usługi
  • Hosting Odoo.sh
  • Wsparcie
  • Aktualizacja
  • Indywidualne rozwiązania
  • Edukacja
  • Znajdź księgowego
  • Znajdź partnera
  • Zostań partnerem
O nas
  • Nasza firma
  • Zasoby marki
  • Skontaktuj się z nami
  • Oferty pracy
  • Wydarzenia
  • Podcast
  • Blog
  • Klienci
  • Informacje prawne • Prywatność
  • Bezpieczeństwo Odoo
الْعَرَبيّة 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 to pakiet aplikacji biznesowych typu open source, które zaspokoją wszystkie potrzeby Twojej firmy: CRM, eCommerce, księgowość, inwentaryzacja, punkt sprzedaży, zarządzanie projektami itp.

Unikalną wartością Odoo jest to, że jest jednocześnie bardzo łatwe w użyciu i w pełni zintegrowane.

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