[FIX] barcodes_gs1_nomenclature: access record with portal

Steps to reproduce:
(Activate Project, Timesheets, Sales, and Inventory)
- connect with portal
- open Projects
- try to open project "AGR - S00021 - Sales Order"

Issue:
Access Error

Cause:
We want to access to the field "is_gs1_nomenclature" for which Portal has no access.

Note:
On the main Runbot (all apps) it does work because the subcontractin_portal adds the Barcode Nomenclature access to Portal user

opw-3073064

closes odoo/odoo#106493

X-original-commit: e0fec5af209229546061c70509c834bb28dd1336
Signed-off-by: Adrien Widart <awt@odoo.com>
Signed-off-by: Yolann Sabaux (yosa) <yosa@odoo.com>
This commit is contained in:
Yolann Sabaux
2022-11-25 10:52:12 +01:00
parent 1488a35c61
commit 3d19d7dcd6
@@ -9,7 +9,7 @@ class IrHttp(models.AbstractModel):
def session_info(self):
res = super().session_info()
nomenclature = self.env.company.nomenclature_id
nomenclature = self.env.company.sudo().nomenclature_id
if not nomenclature.is_gs1_nomenclature:
return res
res['gs1_group_separator_encodings'] = nomenclature.gs1_separator_fnc1