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

[8] record visible only to followers and who created them

Abonare

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

Această întrebare a fost marcată
followerusersrecord_rulesprivacy
4 Răspunsuri
7834 Vizualizări
Imagine profil
mauro anelli

Hi all,

i need to make a record rule for purchase order and manufacturing order that show record only to the one who create the record and those who is added as followers

for user own record i set a record rule with  [('create_uid', '=', user.id)] and works fine.

i'm struggling with the followers rule , something like [('message_is_follower','=', [user.id])] but don't work.
any suggestion?


thanks

0
Imagine profil
Abandonează
Hilar Andikkadavath

you need message_partner_id ?

Imagine profil
Mayank Gosai
Cel mai bun răspuns

Hello Mauro,

Try this :

[('message_is_follower','=',1)]

Thanks,

Mayank Gosai

2
Imagine profil
Abandonează
Imagine profil
Sunny Sheth
Cel mai bun răspuns

Hello in Odoo V10,

use for show record which is created by user and also he is a set follower in other record,

at my side bolow code[domain in rule] work perfectly.

['|',('create_uid','=',user.id),('message_partner_ids', 'in', [user.partner_id.id])]

1
Imagine profil
Abandonează
mauro anelli
Autor

this is what i got

Traceback (most recent call last):

File "/usr/lib/python2.7/dist-packages/openerp/http.py", line 546, in _handle_exception

return super(JsonRequest, self)._handle_exception(exception)

File "/usr/lib/python2.7/dist-packages/openerp/http.py", line 583, in dispatch

result = self._call_function(**self.params)

File "/usr/lib/python2.7/dist-packages/openerp/http.py", line 319, in _call_function

return checked_call(self.db, *args, **kwargs)

File "/usr/lib/python2.7/dist-packages/openerp/service/model.py", line 118, in wrapper

return f(dbname, *args, **kwargs)

File "/usr/lib/python2.7/dist-packages/openerp/http.py", line 316, in checked_call

return self.endpoint(*a, **kw)

File "/usr/lib/python2.7/dist-packages/openerp/http.py", line 812, in __call__

return self.method(*args, **kw)

File "/usr/lib/python2.7/dist-packages/openerp/http.py", line 412, in response_wrap

response = f(*args, **kw)

File "/usr/lib/python2.7/dist-packages/openerp/addons/web/controllers/main.py", line 878, in load_needaction

return request.session.model('ir.ui.menu').get_needaction_data(menu_ids, request.context)

File "/usr/lib/python2.7/dist-packages/openerp/http.py", line 917, in proxy

result = meth(cr, request.uid, *args, **kw)

File "/usr/lib/python2.7/dist-packages/openerp/api.py", line 268, in wrapper

return old_api(self, *args, **kwargs)

File "/usr/lib/python2.7/dist-packages/openerp/addons/base/ir/ir_ui_menu.py", line 345, in get_needaction_data

res[menu.id]['needaction_counter'] = obj._needaction_count(cr, uid, dom, context=context)

File "/usr/lib/python2.7/dist-packages/openerp/api.py", line 268, in wrapper

return old_api(self, *args, **kwargs)

File "/usr/lib/python2.7/dist-packages/openerp/addons/base/ir/ir_needaction.py", line 64, in _needaction_count

res = self.search(cr, uid, (domain or []) + dom, limit=100, order='id DESC', context=context)

File "/usr/lib/python2.7/dist-packages/openerp/api.py", line 268, in wrapper

return old_api(self, *args, **kwargs)

File "/usr/lib/python2.7/dist-packages/openerp/models.py", line 1650, in search

return self._search(cr, user, args, offset=offset, limit=limit, order=order, context=context, count=count)

File "/usr/lib/python2.7/dist-packages/openerp/api.py", line 268, in wrapper

return old_api(self, *args, **kwargs)

File "/usr/lib/python2.7/dist-packages/openerp/models.py", line 4688, in _search

self._apply_ir_rules(cr, user, query, 'read', context=context)

File "/usr/lib/python2.7/dist-packages/openerp/api.py", line 268, in wrapper

return old_api(self, *args, **kwargs)

File "/usr/lib/python2.7/dist-packages/openerp/models.py", line 4553, in _apply_ir_rules

rule_where_clause, rule_where_clause_params, rule_tables = rule_obj.domain_get(cr, uid, self._name, mode, context=context)

File "/usr/lib/python2.7/dist-packages/openerp/api.py", line 268, in wrapper

return old_api(self, *args, **kwargs)

File "/usr/lib/python2.7/dist-packages/openerp/addons/base/ir/ir_rule.py", line 155, in domain_get

query = self.pool[model_name]._where_calc(cr, SUPERUSER_ID, dom, active_test=False)

File "/usr/lib/python2.7/dist-packages/openerp/api.py", line 268, in wrapper

return old_api(self, *args, **kwargs)

File "/usr/lib/python2.7/dist-packages/openerp/models.py", line 4498, in _where_calc

e = expression.expression(cr, user, domain, self, context)

File "/usr/lib/python2.7/dist-packages/openerp/osv/expression.py", line 662, in __init__

self.parse(cr, uid, context=context)

File "/usr/lib/python2.7/dist-packages/openerp/osv/expression.py", line 830, in parse

raise ValueError("Invalid field %r in leaf %r" % (left, str(leaf)))

ValueError: Invalid field 'message_partner_ids' in leaf "<osv.ExtendedLeaf: ('message_partner_ids', 'in', [489]) on purchase_order (ctx: )>"

Sunny Sheth

Sorry for not mention Version,

my code working with Odoo V10.

Thanks.

Sunny Sheth

in your case maybe work below example,

['|', ('user_id', '=', user.id), ('message_follower_ids', '=', user.partner_id.id)]

Imagine profil
mauro anelli
Autor Cel mai bun răspuns

try [('message_is_follower','=',1)] but don't works
it shows every records

this works

[('message_follower_ids', 'in', [user.partner_id.id])]

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
Record Rule for User Only Seeing Their Own Contact Entry
users record_rules user_management
Imagine profil
Imagine profil
1
nov. 21
3339
Allow a user to access only records that were created by him Rezolvat
users create record_rules
Imagine profil
Imagine profil
1
iun. 20
12476
How do we prevent users from viewing contacts assigned to other salespersons
users contacts record_rules access rights
Imagine profil
0
iul. 24
4
Limit products to company assigned to user in multi-company Odoo 9 Rezolvat
users record_rules products erp
Imagine profil
Imagine profil
1
dec. 21
10457
how to make a user access certain employees' timesheets
users manager record_rules v14
Imagine profil
Imagine profil
1
sept. 21
3417
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