diff --git a/fastapi/README.rst b/fastapi/README.rst index 44a1d81bd..37236f981 100644 --- a/fastapi/README.rst +++ b/fastapi/README.rst @@ -7,7 +7,7 @@ Odoo FastAPI !! This file is generated by oca-gen-addon-readme !! !! changes will be overwritten. !! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! - !! source digest: sha256:2b79ba7bbc412d35210ba755b9fca17352faad894aa88c9339fb7063d02a50bf + !! source digest: sha256:8a90dec844eac96b44cefb64548fb05283ade12b16246bb89062abc7644e2087 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! .. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png diff --git a/fastapi/fastapi_dispatcher.py b/fastapi/fastapi_dispatcher.py index a78e3f816..904deeff7 100644 --- a/fastapi/fastapi_dispatcher.py +++ b/fastapi/fastapi_dispatcher.py @@ -49,10 +49,6 @@ def _get_environ(self): @contextmanager def _manage_odoo_env(self, uid=None): env = request.env - # add authenticated_partner_id=False in the context - # to ensure that the ir.rule defined for user's endpoint can be - # evaluated even if not authenticated partner is set - env = env(context=dict(env.context, authenticated_partner_id=False)) accept_language = request.httprequest.headers.get("Accept-language") context = env.context if accept_language: diff --git a/fastapi/models/ir_rule.py b/fastapi/models/ir_rule.py index b1d10fc59..68bda16f6 100644 --- a/fastapi/models/ir_rule.py +++ b/fastapi/models/ir_rule.py @@ -17,10 +17,9 @@ class IrRule(models.Model): @api.model def _eval_context(self): ctx = super()._eval_context() - if "authenticated_partner_id" in self.env.context: - ctx["authenticated_partner_id"] = self.env.context[ - "authenticated_partner_id" - ] + ctx["authenticated_partner_id"] = self.env.context.get( + "authenticated_partner_id", False + ) return ctx def _compute_domain_keys(self): diff --git a/fastapi/readme/newsfragments/410.bugfix b/fastapi/readme/newsfragments/410.bugfix new file mode 100644 index 000000000..23ad39e2f --- /dev/null +++ b/fastapi/readme/newsfragments/410.bugfix @@ -0,0 +1,5 @@ +Odoo has done an update and now, it checks domains of ir.rule on creation and modification. + +The ir.rule 'Fastapi: Running user rule' uses a field (authenticate_partner_id) that comes from the context. +This field wasn't always set and this caused an error when Odoo checked the domain. +So now it is set to *False* by default. diff --git a/fastapi/static/description/index.html b/fastapi/static/description/index.html index 1a75628e1..a1c84d0a4 100644 --- a/fastapi/static/description/index.html +++ b/fastapi/static/description/index.html @@ -1,3 +1,4 @@ +
@@ -366,7 +367,7 @@This addon provides the basis to smoothly integrate the FastAPI