Skip to Content
Odoo मेन्यू
  • Sign in
  • मुफ़्त में आज़माएं
  • ऐप्लिकेशन
    फ़ाइनेंस
    • अकाउंटिंग
    • इनवॉइसिंग
    • एक्सपेंस
    • स्प्रेडशीट (बीआई)
    • डॉक्यूमेंट्स
    • साइन
    सेल्स
    • सीआरएम
    • सेल्स
    • पीओएस शॉप
    • पीओएस रेस्टोरेंट
    • सब्सक्रिप्शन
    • रेंटल
    वेबसाइट
    • वेबसाइट बिल्डर
    • ई-कॉमर्स
    • ब्लॉग
    • फ़ोरम
    • लाइव चैट
    • ई-लर्निंग
    सप्लाई चेन
    • इन्वेंट्री
    • मैन्युफ़ैक्चरिंग
    • पीएलएम
    • परचेज़
    • मेंटेनेंस
    • क्वालिटी
    मानव संसाधन
    • कर्मचारी
    • रिक्रूटमेंट
    • टाइम ऑफ़
    • अप्रेज़ल
    • रेफ़रल
    • फ़्लीट
    मार्केटिंग
    • सोशल मार्केटिंग
    • ईमेल मार्केटिंग
    • एसएमएस मार्केटिंग
    • इवेंट
    • मार्केटिंग ऑटोमेशन
    • सर्वे
    सेवाएं
    • प्रोजेक्ट
    • टाइमशीट
    • फ़ील्ड सर्विस
    • हेल्पडेस्क
    • प्लानिंग
    • अपॉइंटमेंट
    प्रॉडक्टिविटी
    • डिस्कस
    • अप्रूवल
    • आईओटी
    • वीओआईपी
    • नॉलेज
    • WhatsApp
    तीसरे पक्ष के ऐप्लिकेशन Odoo स्टूडियो Odoo क्लाउड प्लेटफ़ॉर्म
  • इंडस्ट्री
    रीटेल
    • बुक स्टोर
    • क्लोदिंग स्टोर
    • फ़र्नीचर स्टोर
    • ग्रॉसरी स्टोर
    • हार्डवेयर स्टोर
    • टॉय स्टोर
    Food & Hospitality
    • बार और पब
    • रेस्टोरेंट
    • फ़ास्ट फ़ूड
    • Guest House
    • बेवरिज डिस्ट्रीब्यूटर
    • होटल
    रियल एस्टेट
    • Real Estate Agency
    • आर्किटेक्चर फ़र्म
    • कंसट्रक्शन
    • एस्टेट मैनेजमेंट
    • गार्ड्निंग
    • प्रॉपर्टी ओनर असोसिएशन
    कंसल्टिंग
    • अकाउंटिंग फ़र्म
    • Odoo पार्टनर
    • मार्केटिंग एजेंसी
    • लॉ फ़र्म
    • टैलेंट ऐक्विज़िशन
    • ऑडिट & सर्टिफ़िकेशन
    मैन्युफ़ैक्चरिंग
    • टेक्सटाइल
    • Metal
    • फ़र्नीचर
    • फ़ूड
    • Brewery
    • कॉर्पोरेट गिफ़्ट
    हेल्थ & फिटनेस
    • स्पोर्ट्स क्लब
    • आईवियर स्टोर
    • फिटनेस सेंटर
    • वेलनेस प्रैक्टिशनर
    • फॉर्मेसी
    • हेयर सैलून
    Trades
    • Handyman
    • आईटी हॉर्डवेयर और सपोर्ट
    • Solar Energy Systems
    • Shoe Maker
    • Cleaning Services
    • HVAC Services
    अन्य
    • Nonprofit Organization
    • एन्वायरमेंटल एजेंसी
    • बिलबोर्ड रेंटल
    • फ़ोटोग्राफी
    • बाइक लीजिंग
    • सॉफ़्टवेयर रीसेलर
    Browse all Industries
  • कम्यूनिटी
    सीखें
    • ट्यूटोरियल्स
    • दस्तावेज़
    • सर्टिफ़िकेशन
    • ट्रेनिंग
    • ब्लॉग
    • पॉडकास्ट
    शिक्षा को बढ़ावा दें
    • एजुकेशन प्रोग्राम
    • स्केल अप! बिजनेस गेम
    • Odoo के ऑफ़िस में आएं
    सॉफ़्टवेयर पाएं
    • डाउनलोड
    • वर्शन की तुलना करें
    • रिलीज़
    साथ मिलकर काम करें
    • Github
    • फ़ोरम
    • इवेंट
    • अनुवाद
    • पार्टनर बनें
    • Services for Partners
    • अपना अकाउंटिंग फ़र्म रजिस्टर करें
    सेवाएं पाएं
    • पार्टनर ढूंढें
    • अकाउंटेंट खोजें
    • सलाहकार की मदद लें
    • इम्प्लिमेंटेशन सेवाएं
    • कस्टमर रेफ़रेंस
    • सहायता
    • अपग्रेड
    Github Youtube Twitter Linkedin Instagram Facebook Spotify
    +1 (650) 691-3277
    डेमो देखें
  • कीमत
  • सहायता

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

  • सीआरएम
  • e-Commerce
  • लेखांकन
  • इन्वेंटरी
  • PoS
  • प्रोजेक्ट
  • MRP
All apps
You need to be registered to interact with the community.
All Posts People Badges
टैग (View all)
odoo accounting v14 pos v15
About this forum
You need to be registered to interact with the community.
All Posts People Badges
टैग (View all)
odoo accounting v14 pos v15
About this forum
Help

Access Error on sending mail

Subscribe

Get notified when there's activity on this post

This question has been flagged
messagemailaccessaccess_error
6236 Views
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
Discard
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
Author

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!

Sign up
Related Posts Replies Views Activity
Comment fonctionne la boite de réception de odoo
message mail
Avatar
0
जून 25
1187
Finding solution: instagram integration with Odoo Live Chat, Discuss Module
message mail
Avatar
Avatar
1
मई 25
2730
How can odoo show internal message to portal user
message mail
Avatar
0
जन॰ 21
3071
[9.0]Try to Hide button in widget: mail_thread
message mail
Avatar
0
मार्च 19
6140
How to create message with record id link
message mail
Avatar
0
फ़र॰ 16
5001
कम्यूनिटी
  • ट्यूटोरियल्स
  • दस्तावेज़
  • फ़ोरम
ओपन सोर्स
  • डाउनलोड
  • Github
  • रनबॉट
  • अनुवाद
सेवाएं
  • Odoo.sh Hosting
  • सहायता
  • अपग्रेड
  • कस्टम डेवलपमेंट्स
  • शिक्षा
  • अकाउंटेंट खोजें
  • पार्टनर ढूंढें
  • पार्टनर बनें
हमारे बारे में
  • हमारी कंपनी
  • ब्रांड ऐसेट
  • संपर्क करें
  • नौकरियां
  • इवेंट
  • पॉडकास्ट
  • ब्लॉग
  • ग्राहक
  • लीगल • गोपनीयता
  • सुरक्षा
الْعَرَبيّة 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, बिज़नेस से जुड़े ऐप्लिकेशन का एक कलेक्शन है जो ओपन सोर्स पर आधारित है. इसमें आपकी कंपनी की हर ज़रूरत के लिए ऐप्लिकेशन हैं. जैसे, सीआरएम, ई-कॉमर्स, अकाउंटिंग, इन्वेंट्री, पॉइंट ऑफ़ सेल, प्रोजेक्ट मैनेजमेंट वगैरह.

Odoo की सबसे बड़ी खासियत है कि यह इस्तेमाल करने में बहुत आसान है और यह पूरी तरह से इंटिग्रेट किया हुआ है.

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