Odoo Help

Welcome!

This community is for beginners and experts willing to share their Odoo knowledge. It's not a forum to discuss ideas, but a knowledge base of questions and their answers.

0

Portal User AccessError Opening Invoice or Picking Ticket

By
Joe McDonald
on 11/11/16, 9:51 PM 162 views

I have an install from GIT that is giving me an error whenever a portal user tries to open an Invoice or Delivery Order, but regular Orders work just fine. 


This is the error in the log:

Traceback (most recent call last):
  File "/opt/odoo/odoo-10.0/addons/website/models/ir_http.py", line 264, in _handle_exception
 response = super(Http, cls)._handle_exception(exception)
 File "/opt/odoo/odoo-10.0/odoo/addons/base/ir/ir_http.py", line 169, in _handle_exception
 return request._handle_exception(exception)
 File "/opt/odoo/odoo-10.0/odoo/http.py", line 766, in _handle_exception
 return super(HttpRequest, self)._handle_exception(exception)
 File "/opt/odoo/odoo-10.0/odoo/addons/base/ir/ir_http.py", line 195, in _dispatch
 result = request.dispatch()
 File "/opt/odoo/odoo-10.0/odoo/http.py", line 825, in dispatch
 r = self._call_function(**self.params)
 File "/opt/odoo/odoo-10.0/odoo/http.py", line 331, in _call_function
 return checked_call(self.db, *args, **kwargs)
 File "/opt/odoo/odoo-10.0/odoo/service/model.py", line 119, in wrapper
 return f(dbname, *args, **kwargs)
 File "/opt/odoo/odoo-10.0/odoo/http.py", line 324, in checked_call
 result = self.endpoint(*a, **kw)
 File "/opt/odoo/odoo-10.0/odoo/http.py", line 933, in __call__
 return self.method(*args, **kw)
 File "/opt/odoo/odoo-10.0/odoo/http.py", line 504, in response_wrap
 response = f(*args, **kw)
 File "/opt/odoo/odoo-10.0/addons/report/controllers/main.py", line 45, in report_routes
 pdf = report_obj.with_context(context).get_pdf(docids, reportname, data=data)
 File "/opt/odoo/odoo-10.0/addons/report/models/report.py", line 165, in get_pdf
 html = self.with_context(context).get_html(docids, report_name, data=data)
 File "/opt/odoo/odoo-10.0/addons/report/models/report.py", line 139, in get_html
 return self.render(report.report_name, docargs)
 File "/opt/odoo/odoo-10.0/addons/report/models/report.py", line 115, in render
 return view_obj.render_template(template, values)
 File "/opt/odoo/odoo-10.0/odoo/addons/base/ir/ir_ui_view.py", line 1029, in render_template
 return self.browse(self.get_view_id(template)).render(values, engine)
 File "/opt/odoo/odoo-10.0/addons/website/models/ir_ui_view.py", line 110, in render
 return super(View, self).render(values, engine=engine)
 File "/opt/odoo/odoo-10.0/addons/web_editor/models/ir_ui_view.py", line 26, in render
 return super(IrUiView, self).render(values=values, engine=engine)
 File "/opt/odoo/odoo-10.0/odoo/addons/base/ir/ir_ui_view.py", line 1049, in render
 return self.env[engine].render(self.id, qcontext)
 File "/opt/odoo/odoo-10.0/odoo/addons/base/ir/ir_qweb/ir_qweb.py", line 53, in render
 return super(IrQWeb, self).render(id_or_xml_id, values=values, **context)
  File "/opt/odoo/odoo-10.0/odoo/addons/base/ir/ir_qweb/qweb.py", line 248, in render
 self.compile(template, options)(self, body.append, values or {})
 File "/opt/odoo/odoo-10.0/odoo/addons/base/ir/ir_qweb/qweb.py", line 317, in _compiled_fn
 raise e
QWebException: (u'The requested operation cannot be completed due to security restrictions. Please contact your system administrator.\n\n(Document type: res.partner, Operation: read)', None)
Traceback (most recent call last): File "/opt/odoo/odoo-10.0/odoo/addons/base/ir/ir_qweb/qweb.py", line 315, in _compiled_fn
 return compiled(self, append, values, options, log)
 File "<template>", line 1, in template_report_external_layout_footer_500
 File "/opt/odoo/odoo-10.0/odoo/fields.py", line 872, in __get__
 value = record._cache[self]
 File "/opt/odoo/odoo-10.0/odoo/models.py", line 5526, in __getitem__
 return value.get() if isinstance(value, SpecialValue) else value
 File "/opt/odoo/odoo-10.0/odoo/fields.py", line 48, in get
 raise self.exception
AccessError: (u'The requested operation cannot be completed due to security restrictions. Please contact your system administrator.\n\n(Document type: res.partner, Operation: read)', None) Error to render compiling AST
AccessError: (u'The requested operation cannot be completed due to security restrictions. Please contact your system administrator.\n\n(Document type: res.partner, Operation: read)', None)
Template: report.external_layout_footer
Path: /templates/t/div/div/ul[1]/li[2]
Node: <li t-if="company.fax and company.phone" data-oe-id="352" data-oe-model="ir.ui.view" data-oe-field="arch" data-oe-xpath="/t[1]/div[1]/div[1]/ul[1]/li[2]">&amp;bull;</li>

This seems to be related to record rule: res_partner: portal/public: read access on my commercial partner

The report.external_layout_footer references data from the companies partner record and this rule prevents that access.

The rule as it stands is like this: [('id', 'child_of', user.commercial_partner_id.id)]

How do I write this rule to also include the company_id of the user or one of the company_ids for the user in multi-company?

Joe McDonald
on 11/17/16, 4:11 PM

Your Answer

Please try to give a substantial answer. If you wanted to comment on the question or answer, just use the commenting tool. Please remember that you can always revise your answers - no need to answer the same question twice. Also, please don't forget to vote - it really helps to select the best questions and answers!

About This Community

This community is for professionals and enthusiasts of our products and services. Read Guidelines

Question tools

1 follower(s)

Stats

Asked: 11/11/16, 9:51 PM
Seen: 162 times
Last updated: 11/12/16, 1:05 AM