Skip to content

Commit

Permalink
[FIX] shopinvader_anonymous_partner: Remove return value in _promote_…
Browse files Browse the repository at this point in the history
…anonymous_partner

And always drop the cookie
  • Loading branch information
paradoxxxzero committed Dec 12, 2024
1 parent 785a8a3 commit 6a30a66
Showing 1 changed file with 2 additions and 8 deletions.
10 changes: 2 additions & 8 deletions shopinvader_anonymous_partner/models/res_partner.py
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand All @@ -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)

0 comments on commit 6a30a66

Please sign in to comment.