mirror of
https://github.com/bringout/oca-ocb-core.git
synced 2026-04-22 18:51:58 +02:00
19.0 vanilla
This commit is contained in:
parent
d1963a3c3a
commit
2d3ee4855a
7430 changed files with 2687981 additions and 2965473 deletions
|
|
@ -11,26 +11,40 @@
|
|||
<field name="code" readonly="1"/>
|
||||
<field name="expiration_date"/>
|
||||
<field name="partner_id"/>
|
||||
<label string="Balance" for="points"/>
|
||||
<span class="d-inline-block">
|
||||
<field name="points" class="w-auto oe_inline me-1"/>
|
||||
<field name="point_name" no_label="1" class="d-inline"/>
|
||||
</span>
|
||||
<label string="Balance" for="points_display"/>
|
||||
<button
|
||||
name="action_loyalty_update_balance"
|
||||
class="p-0 text-info fw-normal"
|
||||
type="object"
|
||||
>
|
||||
<field name="points_display" nolabel="1"/>
|
||||
</button>
|
||||
</group>
|
||||
</group>
|
||||
<notebook invisible="not id">
|
||||
<page string="History Lines">
|
||||
<field name="history_ids">
|
||||
<list>
|
||||
<field name="description"/>
|
||||
<field name="order_id"/>
|
||||
<field name="create_date" string="Date"/>
|
||||
<field name="issued"/>
|
||||
<field name="used"/>
|
||||
</list>
|
||||
</field>
|
||||
</page>
|
||||
</notebook>
|
||||
</sheet>
|
||||
<div class="oe_chatter">
|
||||
<field name="message_ids"/>
|
||||
</div>
|
||||
<chatter/>
|
||||
</form>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record id="loyalty_card_view_tree" model="ir.ui.view">
|
||||
<field name="name">loyalty.card.view.tree</field>
|
||||
<field name="name">loyalty.card.view.list</field>
|
||||
<field name="model">loyalty.card</field>
|
||||
<field name="arch" type="xml">
|
||||
<tree string="Coupons" edit="false" delete="false" js_class="loyalty_card_list_view">
|
||||
<list string="Coupons" edit="false" delete="false" js_class="loyalty_card_list_view">
|
||||
<field name="code" readonly="1"/>
|
||||
<field name="create_date" optional="hide"/>
|
||||
<field name="points_display" string="Balance"/>
|
||||
|
|
@ -38,7 +52,7 @@
|
|||
<field name="program_id"/>
|
||||
<field name="partner_id"/>
|
||||
<button name="action_coupon_send" string="Send" type="object" icon="fa-paper-plane-o"/>
|
||||
</tree>
|
||||
</list>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
|
|
@ -51,8 +65,23 @@
|
|||
<field name="partner_id"/>
|
||||
<field name="program_id"/>
|
||||
<separator/>
|
||||
<filter name="active" string="Active" domain="['&', ('points', '>', 0), '|', ('expiration_date', '>=', context_today().strftime('%Y-%m-%d 00:00:00')), ('expiration_date', '=', False)]"/>
|
||||
<filter name="inactive" string="Inactive" domain="['|', ('points', '<=', 0), ('expiration_date', '<', context_today().strftime('%Y-%m-%d 23:59:59'))]"/>
|
||||
<filter
|
||||
name="active"
|
||||
string="Active"
|
||||
domain="[
|
||||
'&', ('active', '=', True),
|
||||
'&', ('program_id.active', '=', True),
|
||||
'|', ('expiration_date', '>=', 'today'), ('expiration_date', '=', False)
|
||||
]"
|
||||
/>
|
||||
<filter
|
||||
name="inactive"
|
||||
string="Inactive"
|
||||
domain="[
|
||||
'|', ('active', '=', False),
|
||||
'|', ('program_id.active', '=', False), ('expiration_date', '<', 'today')
|
||||
]"
|
||||
/>
|
||||
</search>
|
||||
</field>
|
||||
</record>
|
||||
|
|
@ -60,7 +89,7 @@
|
|||
<record id="loyalty_card_action" model="ir.actions.act_window">
|
||||
<field name="name">Coupons</field>
|
||||
<field name="res_model">loyalty.card</field>
|
||||
<field name="view_mode">tree,form</field>
|
||||
<field name="view_mode">list,form</field>
|
||||
<field name="domain">[('program_id', '=', active_id)]</field>
|
||||
<field name="context">{'create': False}</field>
|
||||
<field name="help" type="html">
|
||||
|
|
|
|||
|
|
@ -0,0 +1,27 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<odoo>
|
||||
|
||||
<record id="loyalty_history_form" model="ir.ui.view">
|
||||
<field name="name">loyalty.history.view.form</field>
|
||||
<field name="model">loyalty.history</field>
|
||||
<field name="arch" type="xml">
|
||||
<form>
|
||||
<sheet>
|
||||
<group>
|
||||
<group>
|
||||
<field name="card_id"/>
|
||||
<field name="description"/>
|
||||
<field name="order_id" invisible="not order_id"/>
|
||||
<field name="order_model" invisible="True"/>
|
||||
</group>
|
||||
<group>
|
||||
<field name="issued"/>
|
||||
<field name="used"/>
|
||||
</group>
|
||||
</group>
|
||||
</sheet>
|
||||
</form>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
</odoo>
|
||||
|
|
@ -1,15 +1,16 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<odoo>
|
||||
<record id="loyalty_mail_view_tree" model="ir.ui.view">
|
||||
<field name="name">loyalty.mail.view.tree</field>
|
||||
<field name="name">loyalty.mail.view.list</field>
|
||||
<field name="model">loyalty.mail</field>
|
||||
<field name="arch" type="xml">
|
||||
<tree editable="bottom">
|
||||
<list editable="bottom">
|
||||
<field name="trigger"/>
|
||||
<field name="points" string="Limit"
|
||||
attrs="{'required': [('trigger', '=', 'points_reach')], 'invisible': [('trigger', '!=', 'points_reach')]}"/>
|
||||
invisible="trigger != 'points_reach'"
|
||||
required="trigger == 'points_reach'"/>
|
||||
<field name="mail_template_id"/>
|
||||
</tree>
|
||||
</list>
|
||||
</field>
|
||||
</record>
|
||||
</odoo>
|
||||
|
|
|
|||
|
|
@ -9,26 +9,26 @@
|
|||
<form string="Discount & Loyalty">
|
||||
<header>
|
||||
<button name="%(loyalty_generate_wizard_action)d" string="Generate Coupons" class="btn-primary" type="action"
|
||||
attrs="{'invisible': [('program_type', '!=', 'coupons')]}"/>
|
||||
invisible="program_type != 'coupons'"/>
|
||||
<button name="%(loyalty_generate_wizard_action)d" string="Generate Gift Cards" class="btn-primary" type="action"
|
||||
attrs="{'invisible': [('program_type', '!=', 'gift_card')]}"/>
|
||||
invisible="program_type != 'gift_card'"/>
|
||||
<button name="%(loyalty_generate_wizard_action)d" string="Generate eWallet" class="btn-primary" type="action"
|
||||
attrs="{'invisible': [('program_type', '!=', 'ewallet')]}" context="{'default_mode': 'selected'}"/>
|
||||
invisible="program_type != 'ewallet'" context="{'default_mode': 'selected'}"/>
|
||||
</header>
|
||||
<sheet>
|
||||
<widget name="web_ribbon" title="Archived" bg_color="bg-danger" attrs="{'invisible': [('active', '=', True)]}"/>
|
||||
<widget name="web_ribbon" title="Archived" bg_color="text-bg-danger" invisible="active"/>
|
||||
<div class="oe_button_box" name="button_box">
|
||||
<button class="oe_stat_button" type="object" name="action_open_loyalty_cards" icon="fa-tags">
|
||||
<div class="o_form_field o_stat_info">
|
||||
<span class="o_stat_value">
|
||||
<field name="coupon_count"/>
|
||||
</span>
|
||||
<span class="o_stat_text" attrs="{'invisible': [('program_type', 'not in', ('coupons', 'next_order_coupons'))]}">Coupons</span>
|
||||
<span class="o_stat_text" attrs="{'invisible': [('program_type', '!=', 'loyalty')]}">Loyalty Cards</span>
|
||||
<span class="o_stat_text" attrs="{'invisible': [('program_type', 'not in', ('promotion', 'buy_x_get_y'))]}">Promos</span>
|
||||
<span class="o_stat_text" attrs="{'invisible': [('program_type', '!=', 'promo_code')]}">Discount</span>
|
||||
<span class="o_stat_text" attrs="{'invisible': [('program_type', '!=', 'gift_card')]}">Gift Cards</span>
|
||||
<span class="o_stat_text" attrs="{'invisible': [('program_type', '!=', 'ewallet')]}">eWallets</span>
|
||||
<span class="o_stat_text" invisible="program_type not in ('coupons', 'next_order_coupons')">Coupons</span>
|
||||
<span class="o_stat_text" invisible="program_type != 'loyalty'">Loyalty Cards</span>
|
||||
<span class="o_stat_text" invisible="program_type not in ('promotion', 'buy_x_get_y')">Promos</span>
|
||||
<span class="o_stat_text" invisible="program_type != 'promo_code'">Discount</span>
|
||||
<span class="o_stat_text" invisible="program_type != 'gift_card'">Gift Cards</span>
|
||||
<span class="o_stat_text" invisible="program_type != 'ewallet'">eWallets</span>
|
||||
</div>
|
||||
</button>
|
||||
</div>
|
||||
|
|
@ -44,74 +44,102 @@
|
|||
<group>
|
||||
<label for="program_type"/>
|
||||
<div>
|
||||
<field name="program_type" widget="filterable_selection" attrs="{'readonly': [('coupon_count', '!=', 0)]}" options="{'blacklisted_values': ['gift_card', 'ewallet']}"/>
|
||||
<p class="text-muted" attrs="{'invisible': [('program_type', '!=', 'coupons')]}" colspan="2">
|
||||
<field name="program_type" widget="filterable_selection" readonly="coupon_count != 0" options="{'blacklisted_values': ['gift_card', 'ewallet']}"/>
|
||||
<p class="text-muted" invisible="program_type != 'coupons'" colspan="2">
|
||||
Generate & share coupon codes manually. It can be used in eCommerce, Point of Sale or regular orders to claim the Reward. You can define constraints on its usage through conditional rule.
|
||||
<div groups="base.group_no_one">
|
||||
When generating coupon, you can define a specific points value that can be exchanged for rewards.
|
||||
When generating coupon, you can define a specific points value that can be exchanged for rewards.
|
||||
</div>
|
||||
</p>
|
||||
<p class="text-muted" attrs="{'invisible': [('program_type', '!=', 'loyalty')]}" colspan="2">
|
||||
<p class="text-muted" invisible="program_type != 'loyalty'" colspan="2">
|
||||
When customers make an order, they accumulate points they can exchange for rewards on the current order or on a future one.
|
||||
</p>
|
||||
<p class="text-muted" attrs="{'invisible': [('program_type', '!=', 'promotion')]}" colspan="2">
|
||||
Set up conditional rules on the order that will give access to rewards for customers
|
||||
<p class="text-muted" invisible="program_type != 'promotion'" colspan="2">
|
||||
Set up conditional rules on the order that will give access to rewards for customers
|
||||
<div groups="base.group_no_one">
|
||||
Each rule can grant points to the customer he will be able to exchange against rewards
|
||||
</div>
|
||||
</p>
|
||||
<p class="text-muted" attrs="{'invisible': [('program_type', '!=', 'promo_code')]}" colspan="2">
|
||||
<p class="text-muted" invisible="program_type != 'promo_code'" colspan="2">
|
||||
Define Discount codes on conditional rules then share it with your customers for rewards.
|
||||
</p>
|
||||
<p class="text-muted" attrs="{'invisible': [('program_type', '!=', 'buy_x_get_y')]}" colspan="2">
|
||||
<p class="text-muted" invisible="program_type != 'buy_x_get_y'" colspan="2">
|
||||
Grant 1 credit for each item bought then reward the customer with Y items in exchange of X credits.
|
||||
</p>
|
||||
<p class="text-muted" attrs="{'invisible': [('program_type', '!=', 'next_order_coupons')]}" colspan="2">
|
||||
<p class="text-muted" invisible="program_type != 'next_order_coupons'" colspan="2">
|
||||
Drive repeat purchases by sending a unique, single-use coupon code for the next purchase when a customer buys something in your store.
|
||||
</p>
|
||||
<p class="text-muted" attrs="{'invisible': [('program_type', '!=', 'gift_card')]}" colspan="2">
|
||||
<p class="text-muted" invisible="program_type != 'gift_card'" colspan="2">
|
||||
Gift Cards are created manually or automatically sent by email when the customer orders a gift card product.
|
||||
<br/>
|
||||
Then, Gift Cards can be used to pay orders.
|
||||
</p>
|
||||
<p class="text-muted" attrs="{'invisible': [('program_type', '!=', 'ewallet')]}" colspan="2">
|
||||
<p class="text-muted" invisible="program_type != 'ewallet'" colspan="2">
|
||||
eWallets are created manually or automatically when the customer orders a eWallet product.
|
||||
<br/>
|
||||
Then, eWallets are proposed during the checkout, to pay orders.
|
||||
</p>
|
||||
</div>
|
||||
<field name="trigger_product_ids" string="Gift Card Products" widget="many2many_tags" attrs="{'invisible': [('program_type', '!=', 'gift_card')]}"/>
|
||||
<field name="trigger_product_ids" string="eWallet Products" widget="many2many_tags" attrs="{'invisible': [('program_type', '!=', 'ewallet')]}"/>
|
||||
<field name="payment_program_discount_product_id" groups="base.group_no_one" attrs="{'invisible': [('program_type', 'not in', ('gift_card', 'ewallet'))]}"/>
|
||||
<field name="mail_template_id" attrs="{'invisible': [('program_type', 'not in', ('gift_card', 'ewallet'))]}"/>
|
||||
<label
|
||||
string="Gift Card Products"
|
||||
invisible="program_type != 'gift_card'"
|
||||
for="trigger_product_ids"
|
||||
/>
|
||||
<label
|
||||
string="eWallet Products"
|
||||
invisible="program_type != 'ewallet'"
|
||||
for="trigger_product_ids"
|
||||
/>
|
||||
<div
|
||||
id="trigger_products"
|
||||
invisible="program_type not in ['gift_card', 'ewallet']"
|
||||
>
|
||||
<field
|
||||
name="trigger_product_ids"
|
||||
widget="many2many_tags"
|
||||
context="{
|
||||
'loyalty_is_gift_card_product': program_type == 'gift_card'
|
||||
}"
|
||||
/>
|
||||
</div>
|
||||
<field name="payment_program_discount_product_id" groups="base.group_no_one" invisible="program_type not in ('gift_card', 'ewallet')"/>
|
||||
<field name="mail_template_id" invisible="program_type not in ('gift_card', 'ewallet')"/>
|
||||
<field name="currency_id"/>
|
||||
<field name="currency_symbol" invisible="1"/>
|
||||
<field name="portal_point_name" attrs="{'invisible': [('program_type', 'in', ('loyalty', 'gift_card', 'ewallet'))]}" string="Points Unit" groups="base.group_no_one"/>
|
||||
<field name="portal_point_name" attrs="{'invisible': ['|', ('program_type', 'in', ('gift_card', 'ewallet')), ('program_type', '!=', 'loyalty')]}" string="Points Unit"/>
|
||||
<field name="pricelist_ids"
|
||||
widget="many2many_tags"
|
||||
invisible="program_type in ('gift_card', 'ewallet')"
|
||||
groups="product.group_product_pricelist"/>
|
||||
<field name="portal_point_name" invisible="program_type in ('loyalty', 'gift_card', 'ewallet')" string="Points Unit" groups="base.group_no_one"/>
|
||||
<field name="portal_point_name" invisible="program_type in ('gift_card', 'ewallet') or program_type != 'loyalty'" string="Points Unit"/>
|
||||
<field name="portal_visible" invisible="1"/>
|
||||
<field name="portal_visible" groups="base.group_no_one" string="Show points Unit" attrs="{'invisible': [('program_type', 'in', ('gift_card', 'ewallet'))]}"/>
|
||||
<field name="portal_visible" groups="base.group_no_one" string="Show points Unit" invisible="program_type in ('gift_card', 'ewallet')"/>
|
||||
<field name="trigger" invisible="1"/>
|
||||
<field name="trigger" string="Program trigger" groups="base.group_no_one" widget="selection" readonly="1" force_save="1"/>
|
||||
<field name="applies_on" invisible="1"/>
|
||||
<field name="applies_on" string="Use points on" groups="base.group_no_one" widget="radio" readonly="1" force_save="1"/>
|
||||
<field name="applies_on" string="Use points on" groups="base.group_no_one" widget="radio" force_save="1" readonly="program_type != 'loyalty'"/>
|
||||
</group>
|
||||
<group>
|
||||
<field name="date_to" attrs="{'invisible': [('program_type', 'in', ('gift_card', 'ewallet'))]}"/>
|
||||
<label for="limit_usage" attrs="{'invisible': [('program_type', 'in', ('gift_card', 'ewallet'))]}"/>
|
||||
<span attrs="{'invisible': [('program_type', 'in', ('gift_card', 'ewallet'))]}">
|
||||
<field name="date_from" invisible="program_type in ('gift_card', 'ewallet')"/>
|
||||
<field name="date_to" invisible="program_type in ('gift_card', 'ewallet')"/>
|
||||
<label for="limit_usage" invisible="program_type in ('gift_card', 'ewallet')"/>
|
||||
<span invisible="program_type in ('gift_card', 'ewallet')">
|
||||
<field name="limit_usage" class="oe_inline"/>
|
||||
<span attrs="{'invisible': [('limit_usage', '=', False)]}"> to <field name="max_usage" class="oe_inline"/> usages</span>
|
||||
<span invisible="not limit_usage">
|
||||
to <field name="max_usage" class="oe_inline"/> usages
|
||||
<span class="text-muted">(<field name="total_order_count" class="oe_inline" readonly="1"/> used)</span>
|
||||
</span>
|
||||
</span>
|
||||
<field name="company_id" invisible="1"/>
|
||||
<field name="company_id" groups="base.group_multi_company"/>
|
||||
<field name="company_id" groups="base.group_multi_company" placeholder="Visible to all"/>
|
||||
<field name="available_on" invisible="1"/>
|
||||
<label class="o_form_label" for="available_on" string="Available On" invisible="1"/>
|
||||
<div id="o_loyalty_program_availabilities" invisible="1"/>
|
||||
<field name="portal_point_name" attrs="{'invisible': [('program_type', 'not in', ('gift_card', 'ewallet'))]}" string="Displayed as" groups="base.group_no_one"/>
|
||||
<field name="portal_point_name" invisible="program_type not in ('gift_card', 'ewallet')" string="Displayed as" groups="base.group_no_one"/>
|
||||
</group>
|
||||
</group>
|
||||
<notebook>
|
||||
<page string="Rules & Rewards" name="rules_rewards" attrs="{'invisible': [('program_type', 'in', ('gift_card', 'ewallet'))]}">
|
||||
<page string="Rules & Rewards" name="rules_rewards" invisible="program_type in ('gift_card', 'ewallet')">
|
||||
<group>
|
||||
<group>
|
||||
<field name="rule_ids" colspan="2" mode="kanban" nolabel="1" add-label="Add a rule"
|
||||
|
|
@ -123,7 +151,7 @@
|
|||
</group>
|
||||
</group>
|
||||
</page>
|
||||
<page string="Rewards" name="rewards" groups="base.group_no_one" attrs="{'invisible': [('program_type', 'not in', ('gift_card', 'ewallet'))]}">
|
||||
<page string="Rewards" name="rewards" groups="base.group_no_one" invisible="program_type not in ('gift_card', 'ewallet')">
|
||||
<group>
|
||||
<group groups="base.group_no_one">
|
||||
<field name="reward_ids" colspan="2" mode="kanban" nolabel="1" add-label="Add a reward"
|
||||
|
|
@ -131,8 +159,8 @@
|
|||
</group>
|
||||
</group>
|
||||
</page>
|
||||
<page string="Communications" name="communications" attrs="{'invisible': ['|', ('applies_on', '=', 'current'), ('program_type', 'in', ('ewallet','gift_card'))]}">
|
||||
<field name="communication_plan_ids" mode="tree"/>
|
||||
<page string="Communications" name="communications" invisible="applies_on == 'current' or program_type in ('gift_card', 'ewallet')">
|
||||
<field name="communication_plan_ids" mode="list"/>
|
||||
</page>
|
||||
</notebook>
|
||||
</sheet>
|
||||
|
|
@ -141,16 +169,16 @@
|
|||
</record>
|
||||
|
||||
<record id="loyalty_program_view_tree" model="ir.ui.view">
|
||||
<field name="name">loyalty.program.view.tree</field>
|
||||
<field name="name">loyalty.program.view.list</field>
|
||||
<field name="model">loyalty.program</field>
|
||||
<field name="arch" type="xml">
|
||||
<tree js_class="loyalty_program_list_view" class="loyalty-program-list-view">
|
||||
<list js_class="loyalty_program_list_view">
|
||||
<field name="sequence" widget="handle"/>
|
||||
<field name="name"/>
|
||||
<field name="program_type"/>
|
||||
<field name="coupon_count_display" string="Items"/>
|
||||
<field name="company_id" groups="base.group_multi_company"/>
|
||||
</tree>
|
||||
</list>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
|
|
@ -169,18 +197,19 @@
|
|||
<record id="loyalty_program_discount_loyalty_action" model="ir.actions.act_window">
|
||||
<field name="name">Discount & Loyalty</field>
|
||||
<field name="res_model">loyalty.program</field>
|
||||
<field name="view_mode">tree,form</field>
|
||||
<field name="path">discount-loyalty</field>
|
||||
<field name="view_mode">list,form</field>
|
||||
<field name="domain">[('program_type', 'not in', ('gift_card', 'ewallet'))]</field>
|
||||
<field name="help" type="html">
|
||||
<div class="o_loyalty_not_found container">
|
||||
<div class="o_loyalty_not_found container mt64">
|
||||
<h1>No program found.</h1>
|
||||
<p class="lead">Create a new one from scratch, or use one of the templates below.</p>
|
||||
<p class="lead">Create one from scratch, or use a templates below:</p>
|
||||
</div>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record id="action_loyalty_program_tree_discount_loyalty" model="ir.actions.act_window.view">
|
||||
<field name="view_mode">tree</field>
|
||||
<field name="view_mode">list</field>
|
||||
<field name="sequence">1</field>
|
||||
<field name="view_id" ref="loyalty_program_view_tree"/>
|
||||
<field name="act_window_id" ref="loyalty_program_discount_loyalty_action"/>
|
||||
|
|
@ -212,11 +241,12 @@
|
|||
<record id="loyalty_program_gift_ewallet_action" model="ir.actions.act_window">
|
||||
<field name="name">Gift cards & eWallet</field>
|
||||
<field name="res_model">loyalty.program</field>
|
||||
<field name="view_mode">tree,form</field>
|
||||
<field name="path">gift-cards-ewallet</field>
|
||||
<field name="view_mode">list,form</field>
|
||||
<field name="context">{'menu_type': 'gift_ewallet', 'default_program_type': 'gift_card'}</field>
|
||||
<field name="domain">[('program_type', 'in', ('gift_card', 'ewallet'))]</field>
|
||||
<field name="help" type="html">
|
||||
<div class="o_loyalty_not_found container">
|
||||
<div class="o_loyalty_not_found container mt64">
|
||||
<h1>No loyalty program found.</h1>
|
||||
<p class="lead">Create a new one from scratch, or use one of the templates below.</p>
|
||||
</div>
|
||||
|
|
@ -224,7 +254,7 @@
|
|||
</record>
|
||||
|
||||
<record id="action_loyalty_program_tree_gift_card_ewallet" model="ir.actions.act_window.view">
|
||||
<field name="view_mode">tree</field>
|
||||
<field name="view_mode">list</field>
|
||||
<field name="sequence">1</field>
|
||||
<field name="view_id" ref="loyalty_program_view_tree"/>
|
||||
<field name="act_window_id" ref="loyalty_program_gift_ewallet_action"/>
|
||||
|
|
|
|||
|
|
@ -13,49 +13,57 @@
|
|||
<field name="all_discount_product_ids" invisible="1"/>
|
||||
<sheet>
|
||||
<group>
|
||||
<group string="Reward" id="reward_type_group" attrs="{'invisible': [('program_type', 'in', ('gift_card', 'ewallet'))]}">
|
||||
<field name="reward_type" widget="selection" force_save="1" attrs="{'readonly' : [('program_type', '=', 'buy_x_get_y')]}"/>
|
||||
<label for="discount" attrs="{'invisible': [('reward_type', '!=', 'discount')]}"/>
|
||||
<div class="d-flex flex-row" attrs="{'invisible': [('reward_type', '!=', 'discount')]}">
|
||||
<field name="discount" class="oe_inline me-1"/>
|
||||
<group string="Reward" name="reward_type_group" invisible="program_type in ('ewallet','gift_card')">
|
||||
<field name="reward_type" widget="selection" force_save="1" readonly="program_type == 'buy_x_get_y'"/>
|
||||
<label for="discount" invisible="reward_type != 'discount'"/>
|
||||
<div class="d-flex flex-row" invisible="reward_type != 'discount'">
|
||||
<field
|
||||
name="discount"
|
||||
class="oe_inline me-1 text-end"
|
||||
style="max-width: 4rem;"
|
||||
/>
|
||||
<field name="discount_mode" no_label="1" class="w-auto me-1"/>
|
||||
<span>on</span>
|
||||
</div>
|
||||
<label for="discount_applicability" string="" attrs="{'invisible': [('reward_type', '!=', 'discount')]}"/>
|
||||
<field name="discount_applicability" nolabel="1" widget="radio" attrs="{'invisible': [('reward_type', '!=', 'discount')]}"/>
|
||||
<label for="discount_applicability" string="" invisible="reward_type != 'discount'"/>
|
||||
<field name="discount_applicability" nolabel="1" widget="radio" invisible="reward_type != 'discount'"/>
|
||||
</group>
|
||||
|
||||
<group string="Among" attrs="{'invisible': [('reward_type', '!=', 'product')]}">
|
||||
<group string="Among" invisible="reward_type != 'product'">
|
||||
<field name="reward_product_qty" string="Quantity rewarded"/>
|
||||
<field name="reward_product_id" attrs="{'required': [('reward_type', '=', 'product'), ('reward_product_ids', '=', [])]}"/>
|
||||
<field name="reward_product_tag_id" attrs="{'required': [('reward_type', '=', 'product'), ('reward_product_ids', '=', [])]}"/>
|
||||
<field name="reward_product_id" required="reward_type == 'product' and not reward_product_ids"/>
|
||||
<field name="reward_product_tag_id" required="reward_type == 'product' and not reward_product_ids"/>
|
||||
</group>
|
||||
|
||||
<group string="Discount" attrs="{'invisible': ['|', ('reward_type', '!=', 'discount'), ('program_type', 'in', ('gift_card', 'ewallet'))], }">
|
||||
<group string="Discount" invisible="reward_type != 'discount' or program_type in ('gift_card','ewallet')">
|
||||
<field name="discount_max_amount"/>
|
||||
<field name="discount_product_domain" groups="base.group_no_one" widget="domain" options="{'model': 'product.product', 'in_dialog': true}" attrs="{'invisible': [('discount_applicability', '!=', 'specific')]}"/>
|
||||
<field name="discount_product_ids" widget="many2many_tags" attrs="{'invisible': [('discount_applicability', '!=', 'specific')]}"/>
|
||||
<field name="discount_product_category_id" attrs="{'invisible': [('discount_applicability', '!=', 'specific')]}"/>
|
||||
<field name="discount_product_tag_id" attrs="{'invisible': [('discount_applicability', '!=', 'specific')]}"/>
|
||||
<field name="discount_product_domain" groups="base.group_no_one" widget="domain" options="{'model': 'product.product', 'in_dialog': true}" invisible="discount_applicability == 'order'"/>
|
||||
<field name="discount_product_ids" widget="many2many_tags" invisible="discount_applicability == 'order'"/>
|
||||
<field name="discount_product_category_id" invisible="discount_applicability == 'order'"/>
|
||||
<field name="discount_product_tag_id" invisible="discount_applicability == 'order'"/>
|
||||
</group>
|
||||
</group>
|
||||
<group string="Points" attrs="{'invisible': [('user_has_debug', '=', False), ('program_type', 'not in', ('loyalty', 'buy_x_get_y'))]}">
|
||||
<group string="Points" invisible="not user_has_debug and program_type not in ('loyalty', 'buy_x_get_y')">
|
||||
<group>
|
||||
<label for="required_points" string="In exchange of"/>
|
||||
<div class="o_row">
|
||||
<field name="required_points" class="oe_edit_only col-2 oe_inline text-center pe-2"/>
|
||||
<field
|
||||
name="required_points"
|
||||
class="oe_edit_only col-2 oe_inline text-end pe-2"
|
||||
style="max-width: 4rem;"
|
||||
/>
|
||||
<field name="point_name" no_label="1"/>
|
||||
<span attrs="{'invisible': [('clear_wallet', '!=', True)]}"> (or more)</span>
|
||||
<span invisible="not clear_wallet"> (or more)</span>
|
||||
</div>
|
||||
<label for="clear_wallet" string="Clear all promo point(s)" attrs="{'invisible': ['|','&',('user_has_debug', '=', False), ('program_type', 'in', ('loyalty', 'buy_x_get_y')), ('program_type', 'in', ('ewallet','gift_card'))]}"/>
|
||||
<div class="o_row" attrs="{'invisible': ['|','&',('user_has_debug', '=', False), ('program_type', 'in', ('loyalty', 'buy_x_get_y')), ('program_type', 'in', ('ewallet','gift_card'))]}">
|
||||
<label for="clear_wallet" string="Clear all promo point(s)" invisible="(not user_has_debug and program_type in ('loyalty', 'buy_x_get_y')) or program_type in ('gift_card', 'ewallet')"/>
|
||||
<div class="o_row" invisible="(not user_has_debug and program_type in ('loyalty', 'buy_x_get_y')) or program_type in ('gift_card', 'ewallet')">
|
||||
<field name="clear_wallet"/>
|
||||
</div>
|
||||
</group>
|
||||
</group>
|
||||
<group attrs="{'invisible': [('program_type', 'in', ('gift_card', 'ewallet'))]}">
|
||||
<group>
|
||||
<field name="description" string="Description on order"/>
|
||||
<field name="discount_line_product_id" string="Discount product" groups="base.group_no_one"/>
|
||||
<field name="discount_line_product_id" string="Discount product" groups="base.group_no_one" invisible="1"/> <!-- Kept in stable (hidden) for customization compatibility -->
|
||||
</group>
|
||||
</sheet>
|
||||
</form>
|
||||
|
|
@ -67,97 +75,68 @@
|
|||
<field name="model">loyalty.reward</field>
|
||||
<field name="arch" type="xml">
|
||||
<kanban>
|
||||
<field name="program_id"/>
|
||||
<field name="company_id"/>
|
||||
<field name="company_id" invisible="1"/>
|
||||
<field name="currency_id"/>
|
||||
<field name="description"/>
|
||||
<field name="reward_type"/>
|
||||
<field name="discount"/>
|
||||
<field name="discount_mode"/>
|
||||
<field name="discount_applicability"/>
|
||||
<field name="discount_product_domain"/>
|
||||
<field name="discount_product_category_id"/>
|
||||
<field name="discount_product_tag_id"/>
|
||||
<field name="discount_max_amount"/>
|
||||
<field name="discount_line_product_id"/>
|
||||
<field name="reward_product_id"/>
|
||||
<field name="reward_product_ids"/>
|
||||
<field name="all_discount_product_ids"/>
|
||||
<field name="reward_product_tag_id"/>
|
||||
<field name="multi_product"/>
|
||||
<field name="reward_product_qty"/>
|
||||
<field name="reward_product_uom_id"/>
|
||||
<field name="required_points"/>
|
||||
<field name="point_name"/>
|
||||
<field name="clear_wallet"/>
|
||||
<field name="program_type"/>
|
||||
<field name="user_has_debug"/>
|
||||
<templates>
|
||||
<t t-name="kanban-box">
|
||||
<div class="oe_kanban_global_click_edit mx-0 d-flex flex-row">
|
||||
<div class="o_loyalty_kanban_card_left mw-75 flex-grow-1" id="reward_info">
|
||||
<t t-if="record.reward_type.raw_value === 'discount'">
|
||||
<t t-name="card" class="flex-row">
|
||||
<div class="mw-75 flex-grow-1" name="reward_info">
|
||||
<t t-if="record.reward_type.raw_value === 'discount'">
|
||||
|
||||
<t t-if="record.discount">
|
||||
<a><field name="discount"/><field name="discount_mode"/> discount <t t-if="record.discount_max_amount.raw_value > 0">( Max <field name="discount_max_amount"/> )</t></a>
|
||||
</t>
|
||||
|
||||
<t t-if="record.discount_applicability.raw_value === 'specific'">
|
||||
<br/>
|
||||
<br/>
|
||||
|
||||
<span class="fw-bold text-decoration-underline">Applied to:</span>
|
||||
|
||||
<t t-if="record.discount_product_ids.raw_value.length > 0">
|
||||
<div class="d-flex"><i class="fa fa-cube fa-fw" title="Products"/> <field name="discount_product_ids" widget="many2many_tags" class="d-inline"/></div>
|
||||
</t>
|
||||
<t t-if="record.discount_product_category_id.raw_value">
|
||||
<div class="d-flex"><i class="fa fa-cubes fa-fw" title="Product Categories"/> <field name="discount_product_category_id" class="d-inline"/></div>
|
||||
</t>
|
||||
<t t-if="record.discount_product_tag_id.raw_value">
|
||||
<div class="d-flex"><i class="fa fa-tags fa-fw" title="Product Tags"/> <field name="discount_product_tag_id" class="d-inline"/></div>
|
||||
</t>
|
||||
<t t-if="record.discount_product_domain.raw_value && record.discount_product_domain.raw_value !== '[]'" groups="base.group_no_one">
|
||||
<div class="d-flex"><i class="fa fa-search fa-fw" title="Product Domain"/> <field name="discount_product_domain" class="d-inline"/></div>
|
||||
</t>
|
||||
</t>
|
||||
|
||||
<t t-elif="record.discount_applicability.raw_value === 'cheapest'">
|
||||
on the cheapest product
|
||||
<br/>
|
||||
</t>
|
||||
|
||||
<t t-elif="record.discount_applicability.raw_value === 'order'">
|
||||
on your order
|
||||
<br/>
|
||||
</t>
|
||||
<t t-if="record.discount">
|
||||
<field name="discount"/><field name="discount_mode"/> discount <t t-if="record.discount_max_amount.raw_value > 0">( Max <field name="discount_max_amount"/> )</t>
|
||||
</t>
|
||||
|
||||
<t t-if="record.reward_type.raw_value === 'product'">
|
||||
<a>Free product</a>
|
||||
<br/>
|
||||
<br/>
|
||||
<t t-if="record.reward_product_id.raw_value">
|
||||
<div class="d-flex"><i class="fa fa-cube fa-fw" title="Product Domain"/><field name="reward_product_id"/> <t t-if="record.reward_product_qty.raw_value > 1"><span> x </span><field name="reward_product_qty"/></t></div>
|
||||
</t>
|
||||
<t t-if="record.reward_product_tag_id.raw_value">
|
||||
<div class="d-flex"><i class="fa fa-tags fa-fw" title="Product Tags"/> <field name="reward_product_tag_id" class="d-inline"/></div>
|
||||
</t>
|
||||
</t>
|
||||
</div>
|
||||
<t t-if="record.discount_applicability.raw_value === 'specific'">
|
||||
|
||||
<div class="o_loyalty_kanban_card_right" attrs="{'invisible': [('user_has_debug', '=', False), ('program_type', 'not in', ('loyalty', 'buy_x_get_y'))]}">
|
||||
<p class="text-muted">
|
||||
<span class="fw-bold text-decoration-underline">In exchange of</span>
|
||||
<br/>
|
||||
<t t-if="record.clear_wallet.raw_value">
|
||||
all <field name="point_name"/> (if at least <field name="required_points"/> <field name="point_name"/>)
|
||||
</t>
|
||||
<t t-else="">
|
||||
<field name="required_points"/> <field name="point_name"/>
|
||||
</t>
|
||||
</p>
|
||||
</div>
|
||||
<div class="fw-bold text-decoration-underline mt-3">Applied to:</div>
|
||||
|
||||
<div t-if="record.discount_product_ids.raw_value.length > 0" class="d-flex">
|
||||
<i class="fa fa-cube fa-fw" title="Products"/> <field name="discount_product_ids" widget="many2many_tags"/>
|
||||
</div>
|
||||
<div t-if="record.discount_product_category_id.raw_value" class="d-flex">
|
||||
<i class="fa fa-cubes fa-fw" title="Product Categories"/> <field name="discount_product_category_id"/>
|
||||
</div>
|
||||
<div t-if="record.discount_product_tag_id.raw_value" class="d-flex">
|
||||
<i class="fa fa-tags fa-fw" title="Product Tags"/> <field name="discount_product_tag_id"/>
|
||||
</div>
|
||||
<div t-if="record.discount_product_domain.raw_value && record.discount_product_domain.raw_value !== '[]'" groups="base.group_no_one" class="d-flex">
|
||||
<i class="fa fa-search fa-fw" title="Product Domain"/> <field name="discount_product_domain"/>
|
||||
</div>
|
||||
</t>
|
||||
|
||||
<t t-elif="record.discount_applicability.raw_value === 'cheapest'">
|
||||
on the cheapest product
|
||||
</t>
|
||||
|
||||
<t t-elif="record.discount_applicability.raw_value === 'order'">
|
||||
on your order
|
||||
</t>
|
||||
</t>
|
||||
|
||||
<t t-elif="record.reward_type.raw_value === 'product'">
|
||||
<div class="mb-3">Free product</div>
|
||||
<div t-if="record.reward_product_id.raw_value" class="d-flex">
|
||||
<i class="fa fa-cube fa-fw" title="Product Domain"/><field name="reward_product_id" class="me-1"/> <t t-if="record.reward_product_qty.raw_value > 1"> x <field name="reward_product_qty" class="ms-1"/></t>
|
||||
</div>
|
||||
<div t-if="record.reward_product_tag_id.raw_value" class="d-flex">
|
||||
<i class="fa fa-tags fa-fw" title="Product Tags"/> <field name="reward_product_tag_id"/>
|
||||
</div>
|
||||
</t>
|
||||
</div>
|
||||
|
||||
<div class="o_loyalty_kanban_card_right float-end text-muted" invisible="not user_has_debug and program_type not in ('loyalty', 'buy_x_get_y')">
|
||||
<div class="fw-bold text-decoration-underline">In exchange of</div>
|
||||
<t t-if="record.clear_wallet.raw_value">
|
||||
all <field name="point_name"/> (if at least <field name="required_points"/> <field name="point_name"/>)
|
||||
</t>
|
||||
<t t-else="">
|
||||
<field name="required_points"/> <field name="point_name"/>
|
||||
</t>
|
||||
</div>
|
||||
</t>
|
||||
</templates>
|
||||
|
|
|
|||
|
|
@ -8,19 +8,18 @@
|
|||
<field name="program_type" invisible="1"/>
|
||||
<field name="user_has_debug" invisible="1"/>
|
||||
<sheet>
|
||||
<group attrs="{'invisible': [('program_type', '!=', 'promo_code')]}">
|
||||
<group invisible="program_type != 'promo_code'">
|
||||
<group>
|
||||
<field name="code" attrs="{'required': [('program_type', '=', 'promo_code')]}"/>
|
||||
<field name="code" required="program_type == 'promo_code'"/>
|
||||
</group>
|
||||
</group>
|
||||
<group>
|
||||
<group>
|
||||
<separator string="Conditions" colspan="2"/>
|
||||
<field name="minimum_qty"/>
|
||||
<label for="minimum_amount" attrs="{'invisible': [('program_type', '=', 'buy_x_get_y')]}"/>
|
||||
<label for="minimum_amount" invisible="program_type == 'buy_x_get_y'"/>
|
||||
<div class="d-flex flex-row">
|
||||
<field name="minimum_amount" class="oe_inline me-1"/>
|
||||
<span>tax</span>
|
||||
<field name="minimum_amount_tax_mode" class="ms-1"/>
|
||||
</div>
|
||||
<separator string="Among" colspan="2"/>
|
||||
|
|
@ -29,16 +28,25 @@
|
|||
<field name="product_category_id"/>
|
||||
<field name="product_tag_id"/>
|
||||
</group>
|
||||
<group attrs="{'invisible': [('user_has_debug', '=', False), ('program_type', 'not in', ('loyalty', 'buy_x_get_y'))]}">
|
||||
<group invisible="not user_has_debug and program_type not in ('loyalty', 'buy_x_get_y')">
|
||||
<separator string="Point(s)" colspan="2"/>
|
||||
<span colspan="2" attrs="{'invisible': [('program_type', '!=', 'coupons')]}">Grant the amount of coupon points defined as the coupon value</span>
|
||||
<label for="reward_point_amount" string="Grant" attrs="{'invisible': [('program_type', 'not in', ('promotion', 'promo_code', 'next_order_coupons', 'loyalty', 'buy_x_get_y'))]}"/>
|
||||
<div class="d-flex flex-row" attrs="{'invisible': [('program_type', 'not in', ('promotion', 'promo_code', 'next_order_coupons', 'loyalty', 'buy_x_get_y'))]}">
|
||||
<span colspan="2" invisible="program_type != 'coupons'">Grant the amount of coupon points defined as the coupon value</span>
|
||||
<label for="reward_point_amount" string="Grant" invisible="program_type not in ('promotion', 'promo_code', 'next_order_coupons', 'loyalty', 'buy_x_get_y')"/>
|
||||
<div class="d-flex flex-row" invisible="program_type not in ('promotion', 'promo_code', 'next_order_coupons', 'loyalty', 'buy_x_get_y')">
|
||||
<field name="reward_point_amount" class="oe_inline me-1"/>
|
||||
<field name="reward_point_name" class="w-auto"/>
|
||||
</div>
|
||||
<label for="reward_point_mode" string=""/>
|
||||
<field name="reward_point_mode" widget="radio" nolabel="1" attrs="{'invisible': [('program_type', 'not in', ('promotion', 'promo_code', 'next_order_coupons', 'loyalty', 'buy_x_get_y'))]}"/>
|
||||
<label
|
||||
for="reward_point_mode"
|
||||
string=""
|
||||
invisible="program_type not in ('promotion', 'promo_code', 'next_order_coupons', 'loyalty', 'buy_x_get_y')"
|
||||
/>
|
||||
<field
|
||||
name="reward_point_mode"
|
||||
widget="radio"
|
||||
nolabel="1"
|
||||
invisible="program_type not in ('promotion', 'promo_code', 'next_order_coupons', 'loyalty', 'buy_x_get_y')"
|
||||
/>
|
||||
</group>
|
||||
</group>
|
||||
</sheet>
|
||||
|
|
@ -51,71 +59,49 @@
|
|||
<field name="model">loyalty.rule</field>
|
||||
<field name="arch" type="xml">
|
||||
<kanban>
|
||||
<field name="program_id"/>
|
||||
<field name="company_id"/>
|
||||
<field name="currency_id"/>
|
||||
<field name="product_domain"/>
|
||||
<field name="product_ids"/>
|
||||
<field name="product_category_id"/>
|
||||
<field name="product_tag_id"/>
|
||||
<field name="reward_point_amount"/>
|
||||
<field name="reward_point_split"/>
|
||||
<field name="reward_point_name"/>
|
||||
<field name="reward_point_mode"/>
|
||||
<field name="minimum_qty"/>
|
||||
<field name="minimum_amount"/>
|
||||
<field name="minimum_amount_tax_mode"/>
|
||||
<field name="mode"/>
|
||||
<field name="code"/>
|
||||
<field name="program_type"/>
|
||||
<field name="user_has_debug"/>
|
||||
<field name="reward_point_split"/>
|
||||
<templates>
|
||||
<t t-name="kanban-box">
|
||||
<div class="oe_kanban_global_click_edit mx-0 d-flex flex-row">
|
||||
<div class="o_loyalty_kanban_card_left mw-75 flex-grow-1">
|
||||
<t t-if="record.code.raw_value"><span>Discount code <field name="code"/></span><br/></t>
|
||||
<t t-if="record.minimum_qty.raw_value > 0"><span>If minimum <field name="minimum_qty"/> item(s) bought</span><br/></t>
|
||||
<t t-if="record.minimum_amount.raw_value > 0"><span>If minimum <field name="minimum_amount"/> spent<t t-if="record.minimum_amount_tax_mode.raw_value === 'excl'"> (tax excluded)</t></span><br/></t>
|
||||
<br/>
|
||||
<t t-name="card" class="flex-row">
|
||||
<div class="mw-75 flex-grow-1">
|
||||
<div t-if="record.code.raw_value">Discount code <field name="code"/></div>
|
||||
<div t-if="record.minimum_qty.raw_value > 0">If minimum <field name="minimum_qty"/> item(s) bought</div>
|
||||
<div t-if="record.minimum_amount.raw_value > 0">If minimum <field name="minimum_amount"/> spent<t t-if="record.minimum_amount_tax_mode.raw_value === 'excl'"> (tax excluded)</t></div>
|
||||
|
||||
<t t-if="record.product_ids.raw_value.length != 0 || record.product_category_id.raw_value || record.product_tag_id.raw_value">
|
||||
<span class="fw-bold text-decoration-underline">Among:</span>
|
||||
<br/>
|
||||
<t t-if="record.product_ids.raw_value.length != 0 || record.product_category_id.raw_value || record.product_tag_id.raw_value">
|
||||
<div class="fw-bold text-decoration-underline mt-3">Among:</div>
|
||||
|
||||
<t t-if="record.product_ids.raw_value.length > 0">
|
||||
<div class="d-flex"><i class="fa fa-cube fa-fw" title="Products"/> <field name="product_ids" widget="many2many_tags" class="d-inline"/></div>
|
||||
</t>
|
||||
<t t-if="record.product_category_id.raw_value">
|
||||
<div class="d-flex"><i class="fa fa-cubes fa-fw" title="Product Categories"/> <field name="product_category_id" class="d-inline"/></div>
|
||||
</t>
|
||||
<t t-if="record.product_tag_id.raw_value">
|
||||
<div class="d-flex"><i class="fa fa-tags fa-fw" title="Product Tags"/> <field name="product_tag_id" class="d-inline"/></div>
|
||||
</t>
|
||||
<t t-if="record.product_ids.raw_value.length === 0 && !record.product_category_id.raw_value && !record.product_tag_id.raw_value">
|
||||
<div class="d-flex"><i class="fa fa-cube fa-fw" title="Products"/><span>All Products</span></div>
|
||||
</t>
|
||||
<t t-if="record.product_domain.raw_value && record.product_domain.raw_value !== '[]'" groups="base.group_no_one">
|
||||
<div class="d-flex"><i class="fa fa-search fa-fw" title="Product Domain"/> <field name="product_domain" class="d-inline"/></div>
|
||||
</t>
|
||||
</t>
|
||||
</div>
|
||||
<div t-if="record.product_ids.raw_value.length > 0" class="d-flex">
|
||||
<i class="fa fa-cube fa-fw" title="Products"/> <field name="product_ids" widget="many2many_tags"/>
|
||||
</div>
|
||||
<div t-if="record.product_category_id.raw_value" class="d-flex">
|
||||
<i class="fa fa-cubes fa-fw" title="Product Categories"/> <field name="product_category_id"/>
|
||||
</div>
|
||||
<div t-if="record.product_tag_id.raw_value" class="d-flex">
|
||||
<i class="fa fa-tags fa-fw" title="Product Tags"/> <field name="product_tag_id"/>
|
||||
</div>
|
||||
<div t-if="record.product_ids.raw_value.length === 0 and !record.product_category_id.raw_value && !record.product_tag_id.raw_value" class="d-flex">
|
||||
<i class="fa fa-cube fa-fw" title="Products"/><span>All Products</span>
|
||||
</div>
|
||||
<div t-if="record.product_domain.raw_value and record.product_domain.raw_value !== '[]'" groups="base.group_no_one" class="d-flex">
|
||||
<i class="fa fa-search fa-fw" title="Product Domain"/> <field name="product_domain"/>
|
||||
</div>
|
||||
</t>
|
||||
</div>
|
||||
|
||||
<div class="o_loyalty_kanban_card_right" attrs="{'invisible': [('user_has_debug', '=', False), ('program_type', 'not in', ('loyalty', 'buy_x_get_y'))]}">
|
||||
<p class="text-muted" attrs="{'invisible': [('program_type', '!=', 'coupons')]}">
|
||||
<span class="fw-bold text-decoration-underline">Grant</span>
|
||||
<br/>
|
||||
the value of the coupon
|
||||
</p>
|
||||
<p class="text-muted" attrs="{'invisible': [('program_type', 'not in', ('promotion', 'promo_code', 'next_order_coupons', 'loyalty', 'buy_x_get_y'))]}">
|
||||
<span class="fw-bold text-decoration-underline">Grant</span>
|
||||
<br/>
|
||||
<field name="reward_point_amount"/>
|
||||
<span> </span>
|
||||
<field name="reward_point_name"/>
|
||||
<span> </span>
|
||||
<field name="reward_point_mode"/>
|
||||
</p>
|
||||
</div>
|
||||
<div class="o_loyalty_kanban_card_right float-end text-muted" invisible="not user_has_debug and program_type not in ('loyalty', 'buy_x_get_y')">
|
||||
<p invisible="program_type != 'coupons'">
|
||||
<div class="fw-bold text-decoration-underline">Grant</div>
|
||||
the value of the coupon
|
||||
</p>
|
||||
<p invisible="program_type not in ('promotion', 'promo_code', 'next_order_coupons', 'loyalty', 'buy_x_get_y')">
|
||||
<div class="fw-bold text-decoration-underline">Grant</div>
|
||||
<field name="reward_point_amount"/>
|
||||
<field name="reward_point_name" class="ms-1"/>
|
||||
<field name="reward_point_mode" class="ms-1"/>
|
||||
</p>
|
||||
</div>
|
||||
</t>
|
||||
</templates>
|
||||
|
|
|
|||
105
odoo-bringout-oca-ocb-loyalty/loyalty/views/portal_templates.xml
Normal file
105
odoo-bringout-oca-ocb-loyalty/loyalty/views/portal_templates.xml
Normal file
|
|
@ -0,0 +1,105 @@
|
|||
<odoo>
|
||||
<template id="loyalty_buttons" inherit_id="portal.side_content">
|
||||
<div name="portal_contact" position="after">
|
||||
<div class='o_loyalty_container'>
|
||||
<div
|
||||
t-foreach="cards_per_programs"
|
||||
t-as="program"
|
||||
class="portal-loyalty-buttons cursor-pointer"
|
||||
>
|
||||
<div
|
||||
t-att-data-card_id="card.id"
|
||||
t-foreach="cards_per_programs[program]"
|
||||
t-as="card"
|
||||
class="o_loyalty_card d-flex my-2"
|
||||
>
|
||||
<span
|
||||
t-attf-class="o_notification_bar rounded-start"
|
||||
style="width: 0.5rem; background-color: var(--cyan)"
|
||||
/>
|
||||
<div class="w-100 py-3 ps-3 pe-5 border border-start-0 rounded-end d-flex flex-row gap-3">
|
||||
<img
|
||||
class="img-fluid"
|
||||
t-attf-src="/loyalty/static/src/img/{{ program.program_type }}.svg"
|
||||
width="40"
|
||||
/>
|
||||
<div class="d-flex flex-column gap-1">
|
||||
<div>
|
||||
<strong t-out="program.display_name"/>
|
||||
</div>
|
||||
<p id="card_points" class="m-0 text-600">
|
||||
<t t-out="card.points_display"/>
|
||||
</p>
|
||||
<t t-if="
|
||||
program.program_type == 'loyalty'
|
||||
and any(
|
||||
reward.required_points <= card.points for reward in program.reward_ids
|
||||
)
|
||||
">
|
||||
<p class="m-0 text-info">A reward is waiting for you</p>
|
||||
</t>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<template id="loyalty_card_history_template" name="My Loyalty History">
|
||||
<t t-call="portal.portal_layout">
|
||||
<t t-set="breadcrumbs_searchbar" t-value="True"/>
|
||||
<t t-call="portal.portal_searchbar">
|
||||
<t t-set="title">Loyalty Transaction</t>
|
||||
</t>
|
||||
<t t-if="not history_lines">
|
||||
<p class="alert alert-warning">
|
||||
There are currently no transaction lines for this card.
|
||||
</p>
|
||||
</t>
|
||||
<t t-else="" t-call="portal.portal_table">
|
||||
<thead>
|
||||
<tr class="active">
|
||||
<th>Description</th>
|
||||
<th>Order</th>
|
||||
<th>Date</th>
|
||||
<th>Issued</th>
|
||||
<th>Used</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr t-foreach="history_lines" t-as="line">
|
||||
<td><span t-out="line.description"/></td>
|
||||
<td t-if="line.order_id">
|
||||
<t t-set="order_portal_url" t-value="line._get_order_portal_url()"/>
|
||||
<t t-set="order_description" t-value="line._get_order_description()"/>
|
||||
<a t-if="order_portal_url" t-att-href="order_portal_url">
|
||||
<t t-out="order_description"/>
|
||||
</a>
|
||||
<t t-else="">
|
||||
<t t-out="order_description"/>
|
||||
</t>
|
||||
</td>
|
||||
<td t-else=""/>
|
||||
<td><t t-out="line.create_date" t-options='{"widget": "datetime", "format": "short"}'/></td>
|
||||
<td><span t-out="line.card_id._format_points(line.issued)"/></td>
|
||||
<td><span t-out="line.card_id._format_points(line.used)"/></td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</t>
|
||||
</t>
|
||||
</template>
|
||||
|
||||
<template
|
||||
id="portal_loyalty_history_breadcrumbs"
|
||||
name="Portal layout : Loyalty History Lines"
|
||||
inherit_id="portal.portal_breadcrumbs"
|
||||
>
|
||||
<xpath expr="//ol[hasclass('o_portal_submenu')]" position="inside">
|
||||
<li class="breadcrumb-item" t-if="page_name == 'loyalty_history'">
|
||||
<span>History</span>
|
||||
</li>
|
||||
</xpath>
|
||||
</template>
|
||||
|
||||
</odoo>
|
||||
|
|
@ -0,0 +1,23 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<odoo>
|
||||
|
||||
<record id="res_partner_form" model="ir.ui.view">
|
||||
<field name="name">res.partner.view.buttons</field>
|
||||
<field name="model">res.partner</field>
|
||||
<field name="inherit_id" ref="base.view_partner_form"/>
|
||||
<field name="priority" eval="11"/>
|
||||
<field name="arch" type="xml">
|
||||
<div name="button_box" position="inside">
|
||||
<button name="action_view_loyalty_cards"
|
||||
type="object"
|
||||
class="oe_stat_button"
|
||||
icon="fa-money"
|
||||
groups="base.group_system"
|
||||
invisible="loyalty_card_count == 0">
|
||||
<field string="Loyalty Cards" name="loyalty_card_count" widget="statinfo"/>
|
||||
</button>
|
||||
</div>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
</odoo>
|
||||
Loading…
Add table
Add a link
Reference in a new issue