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

why an updated record (with the 'ir.attachment' field updated) can be read by an other user, but the new created record (with an attachment file uploaded) can't open by an other user?

Odebírat

Get notified when there's activity on this post

This question has been flagged
securityir.attachmentmail.thread
2 Odpovědi
3061 Zobrazení
Avatar
FarmingWolf
  1. Base env : odoo17, windows 10
  2. I'm coding a new module, a new model , trying to diplay page fields changed history by inheriting the [mail] models:
     _inherit = ['mail.thread', 'mail.activity.mixin']
  3. the attachment field is defined as :
    op_contract_attachment_ids = fields.Many2many('ir.attachment', string="attach files", copy=False, tracking=False)
  4. "Access Denied by record rules for operation:...." pops up when an other user tries to open a newly created record with an attachment file, even though I added the user to the "Followers".
  5. In the create user's page, the attachment file isn't added to the message history column in the right part of the page when the record is newly created, and it is ok as expected.
  6. But, when the record is updated (delete the old attachment file and add a new one),the page can be opened by an other user without error message disregarding the login user is in the followers or not.
  7. If a new file is added without removing the old attachment file, the page is still can NOT be opened by an other user.
  8. After the page was edited and commited, the attachment files updated will be displayed in the message history column in the right part of the page. It seems like that the "tracking=False" in the field definition was disregarded.
  9. The newly created record CAN be opened without displaying the attachment filed in the page by an user who has NO access right to the field. I think this is because that I defined the attachment filed with groups specified in the XML file as:
  10. For the user who has no right to access to the attachment field:
    1. if a new file is added without removing the old one, he CAN NOT open the page
    2. if a new file is added with removing the old one, he can open the page, even though he is not a follower.
  11. In the "10.b" above, the attachment file field is not displayed in the page main body according to the "groups" specified. BUT the attachment file is displayed in the message history column in the right part of the page. And this is not  appreciated, because that user is NOT expected to see the attachment file.
  12. My ultimate objective is :
    1. Users in special groups(specified in secrurity.xml or in setting page) can open the newly created record.
    2. In the message history column, I need to control the attachment file displaying or not according to the login user's rights through system security settings or python code/xml  based logic control.
    3. In the message history column, the user who has no access rights to the attachment file, he can read other messages yet.
    4. If the attachment file update info is included in one message record, the user who has no access right to the attachment file can also read the rest part of the message record except the info about the attachment file field.

How should I do ?

Thanks a lot!


31 July, 2024



0
Avatar
Zrušit
Avatar
Dương Nguyễn
Nejlepší odpověď

If you still want to use the widget try to add _mail_post_access = 'read' to model like this


I test in holiday module it like this

0
Avatar
Zrušit
Avatar
FarmingWolf
Autor Nejlepší odpověď

hi,every one,It seems like that the problem comes from the widget many2many_binary.

when I use the default view of ir.attachment without the widget=many2many_binary, everything is going well, the display, the rights, etc, except the view looks like a bit some kind of not so odoo... anyway logic is NO1.

I have been suffered from this problem for more than 24*3 hours. Fortunately,the answer came out after I posted this problem here.

Hope this info could help those who has the similar problems.

Thank you!!!

0
Avatar
Zrušit
FarmingWolf
Autor

to:Dương Nguyễn
Thanks you very much for your reply.
I tried _mail_post_access = 'read',page openning error fixed, but the attachment file is still displayed in the message history column although the field property is set as "tracking=False".

FarmingWolf
Autor

to:Dương Nguyễn
Thanks you very much for your reply.
I can't reply to your comment, I do not know why. Maybe because I have not enough karma.
I tried _mail_post_access = 'read',page openning error fixed, but the attachment file is still displayed in the message history column although the field property is set as "tracking=False".

Dương Nguyễn

You 're welcome
By default many2many field has tracking = False already

FarmingWolf
Autor

Thank you !
I have checked many2many_binay widget in more than 3 modules,setting tracking = False, and the attached files are all sent to the msg tracker. I do not know why.

Dương Nguyễn

Check my edited answer , i have tested in hr_holiday module and it only has attached file in the icon not in the chatter

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
How can I restrict user access and permissions to a related ir.attachment record?
security ir.attachment
Avatar
0
čvn 20
6924
🟠 V13 - How to overwrite an existing file in chatter's attachment when uploading multiple files or a single file and run a code every upload?
chatter ir.attachment mail.thread
Avatar
0
říj 20
6306
Mac Id restriction for Users in Odoo enterprise
security
Avatar
0
pro 25
169
what is the differance between access right and record rules in odoo ? Vyřešeno
security
Avatar
Avatar
Avatar
Avatar
Avatar
5
zář 25
15932
User Session Bug.
security
Avatar
0
čvn 25
1155
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