Skip to content

Commit

Permalink
[FIX] loyalty: access key with get vs subscript
Browse files Browse the repository at this point in the history
Addendum to odoo@7ed0a773b6e0

closes odoo#155927

Signed-off-by: Vincent Ethan <etvi@odoo.com>
  • Loading branch information
ethanrobv committed Mar 1, 2024
1 parent 4559de0 commit fb044fb
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion addons/loyalty/models/loyalty_program.py
Original file line number Diff line number Diff line change
Expand Up @@ -585,7 +585,7 @@ def create(self, vals_list):
be explicitly removed from an incoming vals dict unless, of course, it was actually a visible field.
"""
for vals in vals_list:
if 'trigger_product_ids' in vals and vals['program_type'] not in ['gift_card', 'ewallet']:
if 'trigger_product_ids' in vals and vals.get('program_type') not in ['gift_card', 'ewallet']:
del vals['trigger_product_ids']

return super().create(vals_list)

0 comments on commit fb044fb

Please sign in to comment.