Skip to content

Commit 37707d9

Browse files
committed
[FIX] pos_loyalty: prevent access error in multi-company gift card use
Before this commit, if a gift card was created in another company and the gift card program was not assigned to any company, using the gift card in another company resulted in an error. opw-4422730 closes odoo#194905 X-original-commit: 9eec150 Signed-off-by: Joseph Caburnay (jcb) <jcb@odoo.com> Signed-off-by: Pedram Bi Ria (pebr) <pebr@odoo.com>
1 parent 69aff8c commit 37707d9

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

addons/pos_loyalty/models/loyalty_card.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ def _get_default_template(self):
2828
return super()._get_default_template()
2929

3030
def _get_mail_partner(self):
31-
return super()._get_mail_partner() or self.source_pos_order_id.partner_id
31+
return super()._get_mail_partner() or self.sudo().source_pos_order_id.partner_id
3232

3333
def _get_signature(self):
3434
return self.source_pos_order_id.user_id.signature or super()._get_signature()

0 commit comments

Comments
 (0)