Skip to Content
Odoo Meniu
  • Autentificare
  • Try it free
  • Aplicații
    Finanțe
    • Contabilitate
    • Facturare
    • Cheltuieli
    • Spreadsheet (BI)
    • Documente
    • Semn
    Vânzări
    • CRM
    • Vânzări
    • POS Shop
    • POS Restaurant
    • Abonamente
    • Închiriere
    Site-uri web
    • Constructor de site-uri
    • eCommerce
    • Blog
    • Forum
    • Live Chat
    • eLearning
    Lanț Aprovizionare
    • Inventar
    • Producție
    • PLM
    • Achiziție
    • Maintenance
    • Calitate
    Resurse Umane
    • Angajați
    • Recrutare
    • Time Off
    • Evaluări
    • Referințe
    • Flotă
    Marketing
    • Social Marketing
    • Marketing prin email
    • SMS Marketing
    • Evenimente
    • Automatizare marketing
    • Sondaje
    Servicii
    • Proiect
    • Foi de pontaj
    • Servicii de teren
    • Centru de asistență
    • Planificare
    • Programări
    Productivitate
    • Discuss
    • Aprobări
    • IoT
    • VoIP
    • Knowledge
    • WhatsApp
    Aplicații Terțe Odoo Studio Platforma Odoo Cloud
  • Industrii
    Retail
    • Book Store
    • Magazin de îmbrăcăminte
    • Magazin de Mobilă
    • Magazin alimentar
    • Magazin de materiale de construcții
    • Magazin de jucării
    Food & Hospitality
    • Bar and Pub
    • Restaurant
    • Fast Food
    • Guest House
    • Distribuitor de băuturi
    • Hotel
    Proprietate imobiliara
    • Real Estate Agency
    • Firmă de Arhitectură
    • Construcție
    • Estate Managament
    • Grădinărit
    • Asociația Proprietarilor de Proprietăți
    Consultanta
    • Firma de Contabilitate
    • Partener Odoo
    • Agenție de marketing
    • Law firm
    • Atragere de talente
    • Audit & Certification
    Producție
    • Textil
    • Metal
    • Mobilier
    • Mâncare
    • Brewery
    • Cadouri corporate
    Health & Fitness
    • Club Sportiv
    • Magazin de ochelari
    • Centru de Fitness
    • Wellness Practitioners
    • Farmacie
    • Salon de coafură
    Trades
    • Handyman
    • IT Hardware and Support
    • Asigurare socială de stat
    • Cizmar
    • Servicii de curățenie
    • HVAC Services
    Altele
    • Organizație nonprofit
    • Agenție de Mediu
    • Închiriere panouri publicitare
    • Fotografie
    • Închiriere biciclete
    • Asigurare socială
    Browse all Industries
  • Comunitate
    Învăță
    • Tutorials
    • Documentație
    • Certificări
    • Instruire
    • Blog
    • Podcast
    Empower Education
    • Program Educațional
    • Scale Up! Business Game
    • Visit Odoo
    Obține Software-ul
    • Descărcare
    • Compară Edițiile
    • Lansări
    Colaborați
    • Github
    • Forum
    • Evenimente
    • Translations
    • Devino Partener
    • Services for Partners
    • Înregistrează-ți Firma de Contabilitate
    Obține Servicii
    • Găsește un Partener
    • Găsiți un contabil
    • Meet an advisor
    • Servicii de Implementare
    • Referințe ale clienților
    • Suport
    • Actualizări
    Github Youtube Twitter Linkedin Instagram Facebook Spotify
    +1 (650) 691-3277
    Obține un demo
  • Prețuri
  • Ajutor

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

  • CRM
  • e-Commerce
  • Contabilitate
  • Inventar
  • PoS
  • Proiect
  • MRP
All apps
Trebuie să fiți înregistrat pentru a interacționa cu comunitatea.
All Posts Oameni Insigne
Etichete (View all)
odoo accounting v14 pos v15
Despre acest forum
Trebuie să fiți înregistrat pentru a interacționa cu comunitatea.
All Posts Oameni Insigne
Etichete (View all)
odoo accounting v14 pos v15
Despre acest forum
Suport

Show buttons only to users in a group

Abonare

Primiți o notificare când există activitate la acestă postare

Această întrebare a fost marcată
workflowgroupspermissions
3 Răspunsuri
13514 Vizualizări
Imagine profil
Luis Filipe Castanheira

Hi, I have a module in wich everybody has read permissions, but only some users belonging to a group are allowed to take actions. So I would like to show my workflow buttons only to these users.

I tryed to add the groups="group_name" attribute to the button, but I when I update my module I get an Arch Error. What is the right way to do this?

EDIT - Question Reformulation!
________________________________________________________________________

Thanks for your answers, but it is not what I was looking for. I know that adding the "groups" attribute to a field, it hides it from users that don't belong to that group. My question was if there is anything similar to buttons.

If I have this code on my xml <button name="wtv" string="whatever" groups="my_group" /> it rises a "Invalid XML for View Architecture", so I guess this isn't a valid option for buttons.

The full trace like this:

2014-05-21 14:15:06,455 13905 INFO may_9 openerp.modules.loading: module processos_uc: loading processos_view.xml
2014-05-21 14:15:06,493 13905 ERROR may_9 openerp.addons.base.ir.ir_ui_view: Can't render view processos_uc.view_generic_request_form for model: generic.request
Traceback (most recent call last):
  File "/opt/openerp/v7/server/openerp/addons/base/ir/ir_ui_view.py", line 126, in _check_render_view
    fvg = self.pool.get(view.model).fields_view_get(cr, uid, view_id=view.id, view_type=view.type, context=context)
  File "/opt/openerp/v7/server/openerp/osv/orm.py", line 2262, in fields_view_get
    xarch, xfields = self.__view_look_dom_arch(cr, user, result['arch'], view_id, context=ctx)
  File "/opt/openerp/v7/server/openerp/osv/orm.py", line 1915, in __view_look_dom_arch
    fields_def = self.__view_look_dom(cr, user, node, view_id, False, fields, context=context)
  File "/opt/openerp/v7/server/openerp/osv/orm.py", line 1861, in __view_look_dom
    fields.update(self.__view_look_dom(cr, user, f, view_id, in_tree_view, model_fields, context))
  File "/opt/openerp/v7/server/openerp/osv/orm.py", line 1861, in __view_look_dom
    fields.update(self.__view_look_dom(cr, user, f, view_id, in_tree_view, model_fields, context))
  File "/opt/openerp/v7/server/openerp/osv/orm.py", line 1822, in __view_look_dom
    if not check_group(node):
  File "/opt/openerp/v7/server/openerp/osv/orm.py", line 1730, in check_group
    context=context)
  File "/opt/openerp/v7/server/openerp/osv/orm.py", line 1681, in user_has_groups
    for group_ext_id in groups.split(',')])
  File "/opt/openerp/v7/server/openerp/addons/base/res/res_users.py", line 508, in has_group
    assert group_ext_id and '.' in group_ext_id, "External ID must be fully qualified"
AssertionError: External ID must be fully qualified
2014-05-21 14:15:06,496 13905 ERROR may_9 openerp.tools.convert: Parse error in /home/lfc/openerp/v7/addons/processos_uc/processos_view.xml:31:

(...)
EXTRACT OF MY XML HERE
(...)

Traceback (most recent call last):
  File "/opt/openerp/v7/server/openerp/tools/convert.py", line 847, in parse
    self._tags[rec.tag](self.cr, rec, n)
  File "/opt/openerp/v7/server/openerp/tools/convert.py", line 814, in _tag_record
    id = self.pool.get('ir.model.data')._update(cr, self.uid, rec_model, self.module, res, rec_id or False, not self.isnoupdate(data_node), noupdate=self.isnoupdate(data_node), mode=self.mode, context=rec_context )
  File "/opt/openerp/v7/server/openerp/addons/base/ir/ir_model.py", line 937, in _update
    model_obj.write(cr, uid, [res_id], values, context=context)
  File "/opt/openerp/v7/server/openerp/addons/base/ir/ir_ui_view.py", line 214, in write
    return super(view, self).write(cr, uid, ids, vals, context)
  File "/opt/openerp/v7/server/openerp/osv/orm.py", line 4203, in write
    self._validate(cr, user, ids, context)
  File "/opt/openerp/v7/server/openerp/osv/orm.py", line 1546, in _validate
    raise except_orm('ValidateError', '\n'.join(error_msgs))
except_orm: ('ValidateError', u'Error occurred while validating the field(s) arch: Invalid XML for View Architecture!')
2014-05-21 14:15:06,500 13905 ERROR may_9 openerp.netsvc: ValidateError
Error occurred while validating the field(s) arch: Invalid XML for View Architecture!
Traceback (most recent call last):
  File "/opt/openerp/v7/server/openerp/netsvc.py", line 292, in dispatch_rpc
    result = ExportService.getService(service_name).dispatch(method, params)
  File "/opt/openerp/v7/server/openerp/service/web_services.py", line 626, in dispatch
    res = fn(db, uid, *params)
  File "/opt/openerp/v7/server/openerp/osv/osv.py", line 188, in execute_kw
    return self.execute(db, uid, obj, method, *args, **kw or {})
  File "/opt/openerp/v7/server/openerp/osv/osv.py", line 144, in wrapper
    raise except_osv(inst.name, inst.value)
except_osv: ('ValidateError', u'Error occurred while validating the field(s) arch: Invalid XML for View Architecture!')

0
Imagine profil
Abandonează
Imagine profil
Dhinesh
Cel mai bun răspuns

Try this in your xml file... <field name="name" groups="base.group_userB"/>. Now the userB group only can view the field....

3
Imagine profil
Abandonează
Imagine profil
AJAYKRISHNA P
Cel mai bun răspuns


<button name="sapproved_button" string="Second Approval" type="object"
 class="btn-primary"  groups="GROUPNAME"/>


0
Imagine profil
Abandonează
Imagine profil
Thierry Godin
Cel mai bun răspuns

Hello,

Maybe you typed a wrong group name , or maybe the group name is related to another module that is not referenced in the dependencies of  the __openerp__.py

example in a module :

<field groups="product.group_product_variant" name="variants"/>

You call the group "group_product_variant" that belongs to the module "product". So the __openerp__.py should have the module "product" in the "depends" declaration

In the same way, you must refer to this group by prefixing with the name of the module : product.group_product_variant

0
Imagine profil
Abandonează
Enjoying the discussion? Don't just read, join in!

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

Înscrie-te
Related Posts Răspunsuri Vizualizări Activitate
Group access permissings wrong Rezolvat
groups permissions
Imagine profil
Imagine profil
1
feb. 23
3013
Set Field Permission for dynamically assigned group Rezolvat
groups permissions
Imagine profil
Imagine profil
2
sept. 19
5172
Group wise field permission read,write Rezolvat
groups permissions
Imagine profil
Imagine profil
1
iul. 19
6196
hide menu to group even if granted access to menu model
menuitem groups permissions
Imagine profil
Imagine profil
Imagine profil
2
iul. 23
6947
Daily tasks to group of contacts
workflow groups Contacts
Imagine profil
0
aug. 19
3457
Comunitate
  • Tutorials
  • Documentație
  • Forum
Open Source
  • Descărcare
  • Github
  • Runbot
  • Translations
Servicii
  • Hosting Odoo.sh
  • Suport
  • Actualizare
  • Custom Developments
  • Educație
  • Găsiți un contabil
  • Găsește un Partener
  • Devino Partener
Despre Noi
  • Compania noastră
  • Active de marcă
  • Contactați-ne
  • Locuri de muncă
  • Evenimente
  • Podcast
  • Blog
  • Clienți
  • Aspecte juridice • Confidențialitate
  • Securitate
الْعَرَبيّة 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 este o suită de aplicații de afaceri open source care acoperă toate nevoile companiei dvs.: CRM, comerț electronic, contabilitate, inventar, punct de vânzare, management de proiect etc.

Propunerea de valoare unică a Odoo este să fie în același timp foarte ușor de utilizat și complet integrat.

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