From 180a9a964f33475ca37b440ba6b773fca3cc1e6e Mon Sep 17 00:00:00 2001 From: Florian Mounier Date: Thu, 12 Dec 2024 09:49:17 +0100 Subject: [PATCH] [FIX] shopinvader_anonymous_partner: Remove return value in _promote_anonymous_partner And always drop the cookie --- shopinvader_anonymous_partner/models/res_partner.py | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/shopinvader_anonymous_partner/models/res_partner.py b/shopinvader_anonymous_partner/models/res_partner.py index 1b523acb0..f56d3adbd 100644 --- a/shopinvader_anonymous_partner/models/res_partner.py +++ b/shopinvader_anonymous_partner/models/res_partner.py @@ -110,11 +110,7 @@ def _promote_from_anonymous_partner(self, anonymous_partner: ResPartner): This method should be overridden by other modules to implement the partner resolution logic, merging the anonymous partner cart for instance. - - This method can return False to prevent the anonymous partner cookie - from being deleted. """ - return True @api.model def _promote_anonymous_partner( @@ -126,7 +122,5 @@ def _promote_anonymous_partner( This method calls the partner promotion and removes the anonymous partner cookie. """ anonymous_partner = self._get_anonymous_partner__cookie(cookies) - if partner._promote_from_anonymous_partner( - anonymous_partner, - ): - self._delete_anonymous_partner__cookie(cookies, response) + partner._promote_from_anonymous_partner(anonymous_partner) + self._delete_anonymous_partner__cookie(cookies, response)