Skip to content
Snippets Groups Projects
Commit 37d21782 authored by roen-odoo's avatar roen-odoo
Browse files

[FIX] pos_gift_card: Access error gift card


Current behavior:
When trying to open the gift card list you get an access error if one of the cards has been used in another company.
This error appears because you cannot access SO from another company and the used gift cards were linked to a SO.
So shouldn't be able to use a gift card that was created in another company.

Steps to reproduce:
-Create a gift card in company A
-Use it in company B
-Try to access it from company A
opw-2732973

closes odoo/odoo#83901

Signed-off-by: default avatarMasereel Pierre <pim@odoo.com>
parent 5cab5c11
No related branches found
No related tags found
No related merge requests found
......@@ -21,7 +21,7 @@ class GiftCard(models.Model):
def _compute_balance(self):
super()._compute_balance()
for record in self:
confirmed_line = record.redeem_pos_order_line_ids.filtered(
confirmed_line = record.redeem_pos_order_line_ids.sudo().filtered(
lambda l: l.order_id.state in ('paid', 'done', 'invoiced')
)
balance = record.balance
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment