Skip to Content
Odoo Menu
  • Log ind
  • Prøv gratis
  • Apps
    Økonomi
    • Bogføring
    • Fakturering
    • Udgifter
    • Regneark (BI)
    • Dokumenter
    • e-Signatur
    Salg
    • CRM
    • Salg
    • POS Butik
    • POS Restaurant
    • Abonnementer
    • Udlejning
    Hjemmeside
    • Hjemmesidebygger
    • e-Handel
    • Blog
    • Forum
    • LiveChat
    • e-Læring
    Forsyningskæde
    • Lagerbeholdning
    • Produktion
    • PLM
    • Indkøb
    • Vedligeholdelse
    • Kvalitet
    HR
    • Medarbejdere
    • Rekruttering
    • Fravær
    • Medarbejdersamtaler
    • Anbefalinger
    • Flåde
    Marketing
    • Markedsføring på sociale medier
    • E-mailmarketing
    • SMS-marketing
    • Arrangementer
    • Automatiseret marketing
    • Spørgeundersøgelser
    Tjenester
    • Projekt
    • Timesedler
    • Udkørende Service
    • Kundeservice
    • Planlægning
    • Aftaler
    Produktivitet
    • Dialog
    • Godkendelser
    • IoT
    • VoIP
    • Vidensdeling
    • WhatsApp
    Tredjepartsapps Odoo Studio Odoo Cloud-platform
  • Brancher
    Detailhandel
    • Boghandel
    • Tøjforretning
    • Møbelforretning
    • Dagligvarebutik
    • Byggemarked
    • Legetøjsforretning
    Mad og værtsskab
    • Bar og pub
    • Restaurant
    • Fastfood
    • Gæstehus
    • Drikkevareforhandler
    • Hotel
    Ejendom
    • Ejendomsmægler
    • Arkitektfirma
    • Byggeri
    • Ejendomsadministration
    • Havearbejde
    • Boligejerforening
    Rådgivning
    • Regnskabsfirma
    • Odoo-partner
    • Marketingbureau
    • Advokatfirma
    • Rekruttering
    • Audit & certificering
    Produktion
    • Tekstil
    • Metal
    • Møbler
    • Fødevareproduktion
    • Bryggeri
    • Firmagave
    Heldbred & Fitness
    • Sportsklub
    • Optiker
    • Fitnesscenter
    • Kosmetolog
    • Apotek
    • Frisør
    Håndværk
    • Handyman
    • IT-hardware og support
    • Solenergisystemer
    • Skomager
    • Rengøringsservicer
    • VVS- og ventilationsservice
    Andet
    • Nonprofitorganisation
    • Miljøagentur
    • Udlejning af billboards
    • Fotografi
    • Cykeludlejning
    • Softwareforhandler
    Gennemse alle brancher
  • Community
    Få mere at vide
    • Tutorials
    • Dokumentation
    • Certificeringer
    • Oplæring
    • Blog
    • Podcast
    Bliv klogere
    • Udannelselsesprogram
    • Scale Up!-virksomhedsspillet
    • Besøg Odoo
    Få softwaren
    • Download
    • Sammenlign versioner
    • Udgaver
    Samarbejde
    • Github
    • Forum
    • Arrangementer
    • Oversættelser
    • Bliv partner
    • Tjenester til partnere
    • Registrér dit regnskabsfirma
    Modtag tjenester
    • Find en partner
    • Find en bogholder
    • Kontakt en rådgiver
    • Implementeringstjenester
    • Kundereferencer
    • Support
    • Opgraderinger
    Github Youtube Twitter LinkedIn Instagram Facebook Spotify
    +1 (650) 691-3277
    Få en demo
  • Prissætning
  • Hjælp

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

  • CRM
  • e-Commerce
  • Bogføring
  • Lager
  • PoS
  • Projekt
  • MRP
All apps
Du skal være registreret for at interagere med fællesskabet.
All Posts People Emblemer
Tags (View all)
odoo accounting v14 pos v15
Om dette forum
Du skal være registreret for at interagere med fællesskabet.
All Posts People Emblemer
Tags (View all)
odoo accounting v14 pos v15
Om dette forum
Hjælp

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?

Tilmeld

Få besked, når der er aktivitet på dette indlæg

Dette spørgsmål er blevet anmeldt
securityir.attachmentmail.thread
2 Besvarelser
3077 Visninger
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
Kassér
Avatar
Dương Nguyễn
Bedste svar

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
Kassér
Avatar
FarmingWolf
Forfatter Bedste svar

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
Kassér
FarmingWolf
Forfatter

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
Forfatter

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
Forfatter

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!

Tilmeld dig
Related Posts Besvarelser Visninger Aktivitet
How can I restrict user access and permissions to a related ir.attachment record?
security ir.attachment
Avatar
0
jun. 20
6933
🟠 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
okt. 20
6323
Mac Id restriction for Users in Odoo enterprise
security
Avatar
0
dec. 25
171
what is the differance between access right and record rules in odoo ? Løst
security
Avatar
Avatar
Avatar
Avatar
Avatar
5
sep. 25
15951
User Session Bug.
security
Avatar
0
jun. 25
1159
Community
  • Tutorials
  • Dokumentation
  • Forum
Open Source
  • Download
  • Github
  • Runbot
  • Oversættelser
Tjenester
  • Odoo.sh-hosting
  • Support
  • Opgradere
  • Individuelt tilpasset udvikling
  • Uddannelse
  • Find en bogholder
  • Find en partner
  • Bliv partner
Om os
  • Vores virksomhed
  • Brandaktiver
  • Kontakt os
  • Stillinger
  • Arrangementer
  • Podcast
  • Blog
  • Kunder
  • Juridiske dokumenter • Privatlivspolitik
  • Sikkerhedspolitik
الْعَرَبيّة 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 er en samling open source-forretningsapps, der dækker alle dine virksomhedsbehov – lige fra CRM, e-handel og bogføring til lagerstyring, POS, projektledelse og meget mere.

Det unikke ved Odoo er, at systemet både er brugervenligt og fuldt integreret.

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