diff --git a/addons/loyalty/models/loyalty_program.py b/addons/loyalty/models/loyalty_program.py index dce5d2c3315..da8dc4c43b8 100644 --- a/addons/loyalty/models/loyalty_program.py +++ b/addons/loyalty/models/loyalty_program.py @@ -502,10 +502,12 @@ class LoyaltyProgram(models.Model): program = self.create(template_values[template_id]) action = {} if self.env.context.get('menu_type') == 'gift_ewallet': - action = self.env['ir.actions.act_window']._for_xml_id('loyalty.loyalty_program_discount_loyalty_action') - else: action = self.env['ir.actions.act_window']._for_xml_id('loyalty.loyalty_program_gift_ewallet_action') - action['views'] = [[False, 'form']] + action['views'] = [[False, 'form']] + else: + action = self.env['ir.actions.act_window']._for_xml_id('loyalty.loyalty_program_discount_loyalty_action') + view_id = self.env.ref('loyalty.loyalty_program_view_form').id + action['views'] = [[view_id, 'form']] action['view_mode'] = 'form' action['res_id'] = program.id return action diff --git a/addons/loyalty/static/src/js/loyalty_list_view.js b/addons/loyalty/static/src/js/loyalty_list_view.js index 7eb321fcb9d..d467d4c7a8f 100644 --- a/addons/loyalty/static/src/js/loyalty_list_view.js +++ b/addons/loyalty/static/src/js/loyalty_list_view.js @@ -29,6 +29,7 @@ export class LoyaltyActionHelper extends Component { "loyalty.program", "create_from_template", [templateId], + {context: this.env.model.root.context}, ); if (!action) { return; diff --git a/addons/loyalty/static/src/xml/loyalty_templates.xml b/addons/loyalty/static/src/xml/loyalty_templates.xml index 5989a7aaf7e..e3ac08c9507 100644 --- a/addons/loyalty/static/src/xml/loyalty_templates.xml +++ b/addons/loyalty/static/src/xml/loyalty_templates.xml @@ -10,10 +10,10 @@
-
- -
+
+ +
diff --git a/addons/loyalty/views/loyalty_reward_views.xml b/addons/loyalty/views/loyalty_reward_views.xml index cb6b84ca586..1160b6ae49e 100644 --- a/addons/loyalty/views/loyalty_reward_views.xml +++ b/addons/loyalty/views/loyalty_reward_views.xml @@ -80,6 +80,7 @@ +