Files
odoo_source/doc/cla/corporate
Fernanda Hernández beec2f9ccf [FIX] website_sale: use sudo to search account.fiscal.position to public user
Currently if public user has country_id, following traceback is raise
when /shop URL is opened:

Traceback (most recent call last):
File "/.repo_requirements/odoo/odoo/addons/base/models/qweb.py", line 331, in _compiled_fn
return compiled(self, append, new, options, log)
File "<template>", line 1, in template_website_sale_products_item_306
File "/.repo_requirements/odoo/addons/website_sale/models/product.py", line 294, in _get_combination_info
fpos = self.env['account.fiscal.position'].get_fiscal_position(partner.id).sudo()
File "/.repo_requirements/odoo/addons/account/models/partner.py", line 184, in get_fiscal_position
fp = self._get_fpos_by_region(delivery.country_id.id, delivery.state_id.id, delivery.zip, vat_required)
File "/.repo_requirements/odoo/addons/account/models/partner.py", line 141, in _get_fpos_by_region
fpos = self.search(domain_country + state_domain + zip_domain, limit=1)
File "/.repo_requirements/odoo/odoo/models.py", line 1708, in search
res = self._search(args, offset=offset, limit=limit, order=order, count=count)
File "/.repo_requirements/odoo/odoo/models.py", line 4485, in _search
model.check_access_rights('read')
File "/.repo_requirements/odoo/odoo/models.py", line 3331, in check_access_rights
return self.env['ir.model.access'].check(self._name, operation, raise_exception)
File "<decorator-gen-33>", line 2, in check
File "/.repo_requirements/odoo/odoo/tools/cache.py", line 90, in lookup
value = d[key] = self.method(*args, **kwargs)
File "/.repo_requirements/odoo/odoo/addons/base/models/ir_model.py", line 1792, in check
raise AccessError(msg)
odoo.exceptions.AccessError: You are not allowed to access 'Fiscal Position' (account.fiscal.position) records.

This operation is allowed for the following groups:
- Accounting/Advisor
- User types/Internal User
- User types/Portal

Contact your administrator to request access if necessary.

Error to render compiling AST
AccessError: You are not allowed to access 'Fiscal Position' (account.fiscal.position) records.

This operation is allowed for the following groups:
- Accounting/Advisor
- User types/Internal User
- User types/Portal

Contact your administrator to request access if necessary.
Template: website_sale.products_item
Path: /t/t[2]
Node: <t t-set="combination_info" t-value="product._get_combination_info(only_template=True, add_qty=add_qty or 1, pricelist=pricelist)"/>

Above was tested and reproduced in an instance of odoo runbot v14.0:

https://youtu.be/GgUnyna_EX8

That is due to public user has not permission to read model
account.fiscal.position and in fact in ACL, permission contains
'public' but is setting group_portal.

closes odoo/odoo#73117

X-original-commit: 53dc9f62b6d4c362292bf48df54b11c4852f6006
Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2021-07-02 08:27:07 +00:00
..
2021-03-19 16:03:15 +00:00
…
2018-06-19 09:06:16 +02:00
2020-08-06 09:34:00 +00:00
…
…
2020-10-30 16:41:28 +00:00
2019-07-26 07:35:29 +00:00
…
2017-04-28 21:13:09 +02:00
2018-10-26 12:07:11 +00:00
2019-07-15 08:46:00 +00:00
2020-01-23 08:55:56 +00:00
2018-11-09 14:57:37 +00:00
2018-03-02 16:55:44 +01:00
2018-08-28 08:53:01 +02:00
…
2018-03-13 14:45:27 +01:00
2021-04-26 15:12:33 +00:00
2017-10-30 17:18:50 +01:00
2020-10-05 09:23:42 +00:00
2020-09-21 15:46:10 +00:00
…
2020-11-02 13:53:36 +00:00
2017-06-12 10:52:26 -07:00
2017-05-08 15:32:41 +02:00
2018-12-12 13:15:03 +00:00
2021-02-19 13:12:10 +00:00
…
…
…
2020-10-23 08:13:06 +00:00
2018-09-12 16:25:04 +02:00
2019-02-12 17:00:43 +00:00
2021-03-22 13:28:27 +00:00
2018-08-16 16:48:49 +02:00
2020-03-16 20:42:24 +00:00
2018-03-09 12:19:31 +01:00
…
2019-10-02 18:04:16 +00:00
2017-05-29 11:13:46 +02:00
2020-10-20 08:41:50 +00:00
…
2017-05-29 17:27:24 +02:00
…
2020-01-09 11:28:45 +00:00
2018-01-12 15:17:17 +01:00
2018-06-11 16:25:43 +02:00
2019-10-15 15:18:57 +00:00
2017-09-25 15:14:24 +02:00
…
…
…
2018-11-08 10:02:44 +01:00
2017-03-31 09:42:01 +02:00
2020-10-06 13:02:15 +00:00
2021-01-12 13:16:18 +00:00
…
…
2019-09-10 15:07:12 +00:00
2021-01-18 12:41:17 +00:00
…
…
2017-10-09 10:24:54 +02:00
2018-06-12 10:23:06 +02:00
2021-01-29 16:11:19 +00:00
2020-09-14 16:05:17 +00:00
2020-05-18 11:41:07 +00:00
…
2020-05-11 16:05:12 +00:00
2021-03-30 08:19:12 +00:00
2019-12-16 13:36:47 +00:00
…
2017-12-20 10:56:49 +01:00
2021-03-04 15:02:06 +00:00
2021-03-02 14:43:35 +00:00
2017-11-15 11:28:41 +01:00
2019-08-19 14:24:29 +00:00
…
…
2017-02-27 10:33:43 +01:00
2020-11-27 08:16:12 +00:00
2017-08-03 11:04:05 +02:00
2017-10-30 13:20:10 +01:00
2020-11-05 11:23:24 +00:00
2018-04-06 11:23:13 +02:00
2020-04-21 12:44:07 +00:00
…
2019-04-04 19:49:37 +00:00