Skip to Content
Odoo Menu
  • Prihlásiť sa
  • Vyskúšajte zadarmo
  • Aplikácie
    Financie
    • Účtovníctvo
    • Fakturácia
    • Výdavky
    • Tabuľka (BI)
    • Dokumenty
    • Podpis
    Predaj
    • CRM
    • Predaj
    • POS Shop
    • POS Restaurant
    • Manažment odberu
    • Požičovňa
    Webstránky
    • Tvorca webstránok
    • eShop
    • Blog
    • Fórum
    • Živý chat
    • eLearning
    Supply Chain
    • Sklad
    • Výroba
    • Správa životného cyklu produktu
    • Nákup
    • Údržba
    • Manažment kvality
    Ľudské zdroje
    • Zamestnanci
    • Nábor zamestnancov
    • Voľné dni
    • Hodnotenia
    • Odporúčania
    • Vozový park
    Marketing
    • Marketing sociálnych sietí
    • Email marketing
    • SMS marketing
    • Eventy
    • Marketingová automatizácia
    • Prieskumy
    Služby
    • Projektové riadenie
    • Pracovné výkazy
    • Práca v teréne
    • Helpdesk
    • Plánovanie
    • Schôdzky
    Produktivita
    • Tímová komunikácia
    • Schvalovania
    • IoT
    • VoIP
    • Znalosti
    • WhatsApp
    Third party apps Odoo Studio Odoo Cloud Platform
  • Priemyselné odvetvia
    Retail
    • Book Store
    • Clothing Store
    • Furniture Store
    • Grocery Store
    • Hardware Store
    • Toy Store
    Food & Hospitality
    • Bar and Pub
    • Reštaurácia
    • Fast Food
    • Guest House
    • Beverage distributor
    • Hotel
    Reality
    • Real Estate Agency
    • Architecture Firm
    • Konštrukcia
    • Estate Managament
    • Gardening
    • Property Owner Association
    Poradenstvo
    • Accounting Firm
    • Odoo Partner
    • Marketing Agency
    • Law firm
    • Talent Acquisition
    • Audit & Certification
    Výroba
    • Textile
    • Metal
    • Furnitures
    • Jedlo
    • Brewery
    • Corporate Gifts
    Health & Fitness
    • Sports Club
    • Eyewear Store
    • Fitness Center
    • Wellness Practitioners
    • Pharmacy
    • Hair Salon
    Trades
    • Handyman
    • IT Hardware and Support
    • Solar Energy Systems
    • Shoe Maker
    • Cleaning Services
    • HVAC Services
    Iní
    • Nonprofit Organization
    • Environmental Agency
    • Billboard Rental
    • Photography
    • Bike Leasing
    • Software Reseller
    Browse all Industries
  • Komunita
    Vzdelávanie
    • Tutoriály
    • Dokumentácia
    • Certifikácie
    • Školenie
    • Blog
    • Podcast
    Empower Education
    • Vzdelávací program
    • Scale Up! Business Game
    • Visit Odoo
    Softvér
    • Stiahnuť
    • Porovnanie Community a Enterprise vierzie
    • Releases
    Spolupráca
    • Github
    • Fórum
    • Eventy
    • Preklady
    • Staň sa partnerom
    • Services for Partners
    • Register your Accounting Firm
    Služby
    • Nájdite partnera
    • Nájdite účtovníka
    • Meet an advisor
    • Implementation Services
    • Zákaznícke referencie
    • Podpora
    • Upgrades
    ​Github Youtube Twitter Linkedin Instagram Facebook Spotify
    +1 (650) 691-3277
    Získajte demo
  • Cenník
  • Pomoc

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

  • CRM
  • e-Commerce
  • Účtovníctvo
  • Sklady
  • PoS
  • Projektové riadenie
  • MRP
All apps
You need to be registered to interact with the community.
All Posts People Badges
Tagy (View all)
odoo accounting v14 pos v15
About this forum
You need to be registered to interact with the community.
All Posts People Badges
Tagy (View all)
odoo accounting v14 pos v15
About this forum
Pomoc

Access Error on sending mail

Odoberať

Get notified when there's activity on this post

This question has been flagged
messagemailaccessaccess_error
6327 Zobrazenia
Avatar
Magen

I have a Send by Mail action like this:

...
return {
            'type': 'ir.actions.act_window',
            'view_type': 'form',
            'view_mode': 'form',
            'res_model': 'mail.compose.message',
            'views': [(compose_form_id, 'form')],
            'view_id': compose_form_id,
            'target': 'new',
            'context': ctx,
        }

But if the user has read only access to the record it shows error:

Sorry, you are not allowed to modify this document. Only users with the following access level are currently allowed to do that:

Server application error {"message":"Odoo Server Error","code":200,"data":{"debug":"Traceback (most recent call last):
  File \"F:\\Software\\eclipse\\odoo\\odoo\\http.py\", line 638, in _handle_exception
    return super(JsonRequest, self)._handle_exception(exception)
  File \"F:\\Software\\eclipse\\odoo\\odoo\\http.py\", line 675, in dispatch
    result = self._call_function(**self.params)
  File \"F:\\Software\\eclipse\\odoo\\odoo\\http.py\", line 331, in _call_function
    return checked_call(self.db, *args, **kwargs)
  File \"F:\\Software\\eclipse\\odoo\\odoo\\service\\model.py\", line 119, in wrapper
    return f(dbname, *args, **kwargs)
  File \"F:\\Software\\eclipse\\odoo\\odoo\\http.py\", line 324, in checked_call
    result = self.endpoint(*a, **kw)
  File \"F:\\Software\\eclipse\\odoo\\odoo\\http.py\", line 933, in __call__
    return self.method(*args, **kw)
  File \"F:\\Software\\eclipse\\odoo\\odoo\\http.py\", line 504, in response_wrap
    response = f(*args, **kw)
  File \"F:\\Software\\eclipse\\odoo\\addons\\web\\controllers\\main.py\", line 885, in call_kw
    return self._call_kw(model, method, args, kwargs)
  File \"F:\\Software\\eclipse\\odoo\\addons\\web\\controllers\\main.py\", line 877, in _call_kw
    return call_kw(request.env[model], method, args, kwargs)
  File \"F:\\Software\\eclipse\\odoo\\odoo\\api.py\", line 679, in call_kw
    return call_kw_model(method, model, args, kwargs)
  File \"F:\\Software\\eclipse\\odoo\\odoo\\api.py\", line 664, in call_kw_model
    result = method(recs, *args, **kwargs)
  File \"F:\\Software\\eclipse\\odoo\\addons\\mail\\models\\mail_message.py\", line 726, in create
    message = super(Message, self).create(values)
  File \"F:\\Software\\eclipse\\odoo\\odoo\\models.py\", line 3830, in create
    record = self.browse(self._create(old_vals))
  File \"F:\\Software\\eclipse\\odoo\\odoo\\models.py\", line 3999, in _create
    self.check_access_rule('create')
  File \"F:\\Software\\eclipse\\odoo\\addons\\mail\\wizard\\mail_compose_message.py\", line 147, in check_access_rule
    return super(MailComposer, self).check_access_rule(operation)
  File \"F:\\Software\\eclipse\\odoo\\addons\\mail\\models\\mail_message.py\", line 658, in check_access_rule
    DocumentModel.check_mail_message_access(mids.ids, operation)  # ?? mids ?
  File \"F:\\Software\\eclipse\\odoo\\addons\\mail\\models\\mail_thread.py\", line 562, in check_mail_message_access
    DocModel.check_access_rights(check_operation)
  File \"F:\\Software\\eclipse\\odoo\\addons\\muk_dms\\models\\muk_dms_base.py\", line 299, in check_access_rights
    return super(DMSAccessModel, self).check_access_rights(operation, raise_exception)
  File \"F:\\Software\\eclipse\\odoo\\odoo\\models.py\", line 3289, in check_access_rights
    return self.env['ir.model.access'].check(self._name, operation, raise_exception)
  File \"<decorator-gen-4>\", line 2, in check
  File \"F:\\Software\\eclipse\\odoo\\odoo\\tools\\cache.py\", line 87, in lookup
    value = d[key] = self.method(*args, **kwargs)
  File \"F:\\Software\\eclipse\\odoo\\odoo\\addons\\base\\ir\\ir_model.py\", line 940, in check
    raise AccessError(msg % msg_params)
AccessError: (u'Sorry, you are not allowed to modify this document. Only users with the following access level are currently allowed to do that:

I don't need to modify the record but I want to be able to send a mail even if I have readonly access to the record

0
Avatar
Zrušiť
Hilar Andikkadavath

any codes before return actions? then please post here. you are probably trying to access a model which is securely restricted to admin only. And also you didn't post the complete log which will define which model. solutions are either you have to add security lines for user's group or try to access as superuser.

Magen
Autor

The whole function is:

@api.multi

def action_send_mail(self):

self.ensure_one()

attachment = {

'name': ("%s" %self.filename),

'datas': self.get_file_data(),

'datas_fname': self.filename,

'res_model': 'music_audiofile',

'type': 'binary'

}

id = self.env['ir.attachment'].create(attachment)

email_template = self.env.ref('music.email_template_music_audiofile')

old_ids = email_template.attachment_ids.ids

for old_att in self.env['ir.attachment'].browse(old_ids):

old_att.unlink()

email_template.attachment_ids = [(4,id.id)]

ir_model_data = self.env['ir.model.data']

try:

template_id = ir_model_data.get_object_reference('music', 'email_template_music_audiofile')[1]

except ValueError:

template_id = False

try:

compose_form_id = ir_model_data.get_object_reference('mail', 'email_compose_message_wizard_form')[1]

except ValueError:

compose_form_id = False

ctx = dict()

ctx.update({

'default_model': 'music.audiofile',

'default_res_id': self.ids[0],

'default_use_template': bool(template_id),

'default_template_id': template_id,

'default_composition_mode': 'comment',

})

return {

'type': 'ir.actions.act_window',

'view_type': 'form',

'view_mode': 'form',

'res_model': 'mail.compose.message',

'views': [(compose_form_id, 'form')],

'view_id': compose_form_id,

'target': 'new',

'context': ctx,

}

It attaches the binary field (audiofile) and uses message compose wizard to send a mail. The user has READ ONLY access to the model 'music.audiofile' (Admin group has write access and no problem sending the mail) but I don't see why it asks for writing permissions.

Enjoying the discussion? Don't just read, join in!

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

Registrácia
Related Posts Replies Zobrazenia Aktivita
Comment fonctionne la boite de réception de odoo
message mail
Avatar
0
jún 25
1243
Finding solution: instagram integration with Odoo Live Chat, Discuss Module
message mail
Avatar
Avatar
1
máj 25
2900
How can odoo show internal message to portal user
message mail
Avatar
0
jan 21
3124
[9.0]Try to Hide button in widget: mail_thread
message mail
Avatar
0
mar 19
6207
How to create message with record id link
message mail
Avatar
0
feb 16
5045
Komunita
  • Tutoriály
  • Dokumentácia
  • Fórum
Open Source
  • Stiahnuť
  • Github
  • Runbot
  • Preklady
Služby
  • Odoo.sh hosting
  • Podpora
  • Vyššia verzia
  • Custom Developments
  • Vzdelávanie
  • Nájdite účtovníka
  • Nájdite partnera
  • Staň sa partnerom
O nás
  • Naša spoločnosť
  • Majetok značky
  • Kontaktujte nás
  • Pracovné ponuky
  • Eventy
  • Podcast
  • Blog
  • Zákazníci
  • Právne dokumenty • Súkromie
  • Bezpečnosť
الْعَرَبيّة 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 sada podnikových aplikácií s otvoreným zdrojovým kódom, ktoré pokrývajú všetky potreby vašej spoločnosti: CRM, e-shop, účtovníctvo, skladové hospodárstvo, miesto predaja, projektový manažment atď.

Odoo prináša vysokú pridanú hodnotu v jednoduchom použití a súčasne plne integrovanými biznis aplikáciami.

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