mirror of
https://github.com/bringout/oca-ocb-core.git
synced 2026-04-24 00:32:00 +02:00
Initial commit: Core packages
This commit is contained in:
commit
12c29a983b
9512 changed files with 8379910 additions and 0 deletions
|
|
@ -0,0 +1,71 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<odoo>
|
||||
<record id="loyalty_card_view_form" model="ir.ui.view">
|
||||
<field name="name">loyalty.card.view.form</field>
|
||||
<field name="model">loyalty.card</field>
|
||||
<field name="arch" type="xml">
|
||||
<form>
|
||||
<sheet>
|
||||
<group>
|
||||
<group>
|
||||
<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>
|
||||
</group>
|
||||
</group>
|
||||
</sheet>
|
||||
<div class="oe_chatter">
|
||||
<field name="message_ids"/>
|
||||
</div>
|
||||
</form>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record id="loyalty_card_view_tree" model="ir.ui.view">
|
||||
<field name="name">loyalty.card.view.tree</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">
|
||||
<field name="code" readonly="1"/>
|
||||
<field name="create_date" optional="hide"/>
|
||||
<field name="points_display" string="Balance"/>
|
||||
<field name="expiration_date"/>
|
||||
<field name="program_id"/>
|
||||
<field name="partner_id"/>
|
||||
<button name="action_coupon_send" string="Send" type="object" icon="fa-paper-plane-o"/>
|
||||
</tree>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record id="loyalty_card_view_search" model="ir.ui.view">
|
||||
<field name="name">loyalty.card.view.search</field>
|
||||
<field name="model">loyalty.card</field>
|
||||
<field name="arch" type="xml">
|
||||
<search>
|
||||
<field name="code"/>
|
||||
<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'))]"/>
|
||||
</search>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<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="domain">[('program_id', '=', active_id)]</field>
|
||||
<field name="context">{'create': False}</field>
|
||||
<field name="help" type="html">
|
||||
<h1>No Coupons Found.</h1>
|
||||
<p>There haven't been any coupons generated yet.</p>
|
||||
</field>
|
||||
</record>
|
||||
</odoo>
|
||||
|
|
@ -0,0 +1,15 @@
|
|||
<?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="model">loyalty.mail</field>
|
||||
<field name="arch" type="xml">
|
||||
<tree editable="bottom">
|
||||
<field name="trigger"/>
|
||||
<field name="points" string="Limit"
|
||||
attrs="{'required': [('trigger', '=', 'points_reach')], 'invisible': [('trigger', '!=', 'points_reach')]}"/>
|
||||
<field name="mail_template_id"/>
|
||||
</tree>
|
||||
</field>
|
||||
</record>
|
||||
</odoo>
|
||||
|
|
@ -0,0 +1,239 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<odoo>
|
||||
|
||||
<!-- DISCOUNT & LOYALTY -->
|
||||
<record id="loyalty_program_view_form" model="ir.ui.view">
|
||||
<field name="name">loyalty.program.view.form</field>
|
||||
<field name="model">loyalty.program</field>
|
||||
<field name="arch" type="xml">
|
||||
<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')]}"/>
|
||||
<button name="%(loyalty_generate_wizard_action)d" string="Generate Gift Cards" class="btn-primary" type="action"
|
||||
attrs="{'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'}"/>
|
||||
</header>
|
||||
<sheet>
|
||||
<widget name="web_ribbon" title="Archived" bg_color="bg-danger" attrs="{'invisible': [('active', '=', True)]}"/>
|
||||
<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>
|
||||
</div>
|
||||
</button>
|
||||
</div>
|
||||
<field name="active" invisible="1"/>
|
||||
<field name="applies_on" invisible="1"/>
|
||||
<div class="oe_title">
|
||||
<label for="name" string="Program Name"/>
|
||||
<h1>
|
||||
<field name="name" placeholder="e.g. 10% discount on laptops"/>
|
||||
</h1>
|
||||
</div>
|
||||
<group>
|
||||
<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">
|
||||
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.
|
||||
</div>
|
||||
</p>
|
||||
<p class="text-muted" attrs="{'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
|
||||
<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">
|
||||
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">
|
||||
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">
|
||||
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">
|
||||
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">
|
||||
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'))]}"/>
|
||||
<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="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="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"/>
|
||||
</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="limit_usage" class="oe_inline"/>
|
||||
<span attrs="{'invisible': [('limit_usage', '=', False)]}"> to <field name="max_usage" class="oe_inline"/> usages</span>
|
||||
</span>
|
||||
<field name="company_id" invisible="1"/>
|
||||
<field name="company_id" groups="base.group_multi_company"/>
|
||||
<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"/>
|
||||
</group>
|
||||
</group>
|
||||
<notebook>
|
||||
<page string="Rules & Rewards" name="rules_rewards" attrs="{'invisible': [('program_type', 'in', ('gift_card', 'ewallet'))]}">
|
||||
<group>
|
||||
<group>
|
||||
<field name="rule_ids" colspan="2" mode="kanban" nolabel="1" add-label="Add a rule"
|
||||
class="o_loyalty_kanban_inline" widget="loyalty_one2many" context="{'currency_symbol': currency_symbol, 'program_type': program_type}"/>
|
||||
</group>
|
||||
<group>
|
||||
<field name="reward_ids" colspan="2" mode="kanban" nolabel="1" add-label="Add a reward"
|
||||
class="o_loyalty_kanban_inline" widget="loyalty_one2many" context="{'currency_symbol': currency_symbol, 'program_type': program_type}"/>
|
||||
</group>
|
||||
</group>
|
||||
</page>
|
||||
<page string="Rewards" name="rewards" groups="base.group_no_one" attrs="{'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"
|
||||
class="o_loyalty_kanban_inline" widget="loyalty_one2many" context="{'currency_symbol': currency_symbol, 'program_type': program_type}"/>
|
||||
</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>
|
||||
</notebook>
|
||||
</sheet>
|
||||
</form>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record id="loyalty_program_view_tree" model="ir.ui.view">
|
||||
<field name="name">loyalty.program.view.tree</field>
|
||||
<field name="model">loyalty.program</field>
|
||||
<field name="arch" type="xml">
|
||||
<tree js_class="loyalty_program_list_view" 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>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record id="loyalty_program_view_search" model="ir.ui.view">
|
||||
<field name="name">loyalty.program.view.search</field>
|
||||
<field name="model">loyalty.program</field>
|
||||
<field name="arch" type="xml">
|
||||
<search>
|
||||
<field name="name"/>
|
||||
<separator/>
|
||||
<filter string="Archived" name="inactive" domain="[('active', '=', False)]"/>
|
||||
</search>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<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="domain">[('program_type', 'not in', ('gift_card', 'ewallet'))]</field>
|
||||
<field name="help" type="html">
|
||||
<div class="o_loyalty_not_found container">
|
||||
<h1>No program found.</h1>
|
||||
<p class="lead">Create a new one from scratch, or use one of the 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="sequence">1</field>
|
||||
<field name="view_id" ref="loyalty_program_view_tree"/>
|
||||
<field name="act_window_id" ref="loyalty_program_discount_loyalty_action"/>
|
||||
</record>
|
||||
|
||||
<record id="action_loyalty_program_form_discount_loyalty" model="ir.actions.act_window.view">
|
||||
<field name="view_mode">form</field>
|
||||
<field name="sequence">2</field>
|
||||
<field name="view_id" ref="loyalty_program_view_form"/>
|
||||
<field name="act_window_id" ref="loyalty_program_discount_loyalty_action"/>
|
||||
</record>
|
||||
|
||||
<!-- GIFT & EWALLET -->
|
||||
<record id="loyalty_program_gift_ewallet_view_form" model="ir.ui.view">
|
||||
<field name="name">loyalty.program.gift.ewallet.view.form</field>
|
||||
<field name="model">loyalty.program</field>
|
||||
<field name="inherit_id" ref="loyalty_program_view_form"/>
|
||||
<field name="mode">primary</field>
|
||||
<field name="arch" type="xml">
|
||||
<form position="attributes">
|
||||
<attribute name="string">Gift & Ewallet</attribute>
|
||||
</form>
|
||||
<field name="program_type" position="attributes">
|
||||
<attribute name="options">{'whitelisted_values': ['gift_card', 'ewallet']}</attribute>
|
||||
</field>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<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="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">
|
||||
<h1>No loyalty program found.</h1>
|
||||
<p class="lead">Create a new one from scratch, or use one of the templates below.</p>
|
||||
</div>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record id="action_loyalty_program_tree_gift_card_ewallet" model="ir.actions.act_window.view">
|
||||
<field name="view_mode">tree</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"/>
|
||||
</record>
|
||||
|
||||
<record id="action_loyalty_program_form_gift_card_ewallet" model="ir.actions.act_window.view">
|
||||
<field name="view_mode">form</field>
|
||||
<field name="sequence">2</field>
|
||||
<field name="view_id" ref="loyalty_program_gift_ewallet_view_form"/>
|
||||
<field name="act_window_id" ref="loyalty_program_gift_ewallet_action"/>
|
||||
</record>
|
||||
</odoo>
|
||||
|
|
@ -0,0 +1,167 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<odoo>
|
||||
<record id="loyalty_reward_view_form" model="ir.ui.view">
|
||||
<field name="name">loyalty.reward.view.form</field>
|
||||
<field name="model">loyalty.reward</field>
|
||||
<field name="arch" type="xml">
|
||||
<form>
|
||||
<field name="program_type" invisible="1"/>
|
||||
<field name="user_has_debug" invisible="1"/>
|
||||
<field name="multi_product" invisible="1"/>
|
||||
<field name="reward_product_uom_id" invisible="1"/>
|
||||
<field name="reward_product_ids" invisible="1"/>
|
||||
<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"/>
|
||||
<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')]}"/>
|
||||
</group>
|
||||
|
||||
<group string="Among" attrs="{'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', '=', [])]}"/>
|
||||
</group>
|
||||
|
||||
<group string="Discount" attrs="{'invisible': ['|', ('reward_type', '!=', 'discount'), ('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')]}"/>
|
||||
</group>
|
||||
</group>
|
||||
<group string="Points" attrs="{'invisible': [('user_has_debug', '=', False), ('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="point_name" no_label="1"/>
|
||||
<span attrs="{'invisible': [('clear_wallet', '!=', True)]}"> (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'))]}">
|
||||
<field name="clear_wallet"/>
|
||||
</div>
|
||||
</group>
|
||||
</group>
|
||||
<group attrs="{'invisible': [('program_type', 'in', ('gift_card', 'ewallet'))]}">
|
||||
<field name="description" string="Description on order"/>
|
||||
<field name="discount_line_product_id" string="Discount product" groups="base.group_no_one"/>
|
||||
</group>
|
||||
</sheet>
|
||||
</form>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record id="loyalty_reward_view_kanban" model="ir.ui.view">
|
||||
<field name="name">loyalty.reward.view.kanban</field>
|
||||
<field name="model">loyalty.reward</field>
|
||||
<field name="arch" type="xml">
|
||||
<kanban>
|
||||
<field name="program_id"/>
|
||||
<field name="company_id"/>
|
||||
<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-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 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>
|
||||
|
||||
<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>
|
||||
</t>
|
||||
</templates>
|
||||
</kanban>
|
||||
</field>
|
||||
</record>
|
||||
</odoo>
|
||||
|
|
@ -0,0 +1,125 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<odoo>
|
||||
<record id="loyalty_rule_view_form" model="ir.ui.view">
|
||||
<field name="name">loyalty.rule.view.form</field>
|
||||
<field name="model">loyalty.rule</field>
|
||||
<field name="arch" type="xml">
|
||||
<form class="loyalty-rule-form">
|
||||
<field name="program_type" invisible="1"/>
|
||||
<field name="user_has_debug" invisible="1"/>
|
||||
<sheet>
|
||||
<group attrs="{'invisible': [('program_type', '!=', 'promo_code')]}">
|
||||
<group>
|
||||
<field name="code" attrs="{'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')]}"/>
|
||||
<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"/>
|
||||
<field name="product_domain" groups="base.group_no_one" widget="domain" options="{'model': 'product.product', 'in_dialog': true}"/>
|
||||
<field name="product_ids" widget="many2many_tags"/>
|
||||
<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'))]}">
|
||||
<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'))]}">
|
||||
<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'))]}"/>
|
||||
</group>
|
||||
</group>
|
||||
</sheet>
|
||||
</form>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record id="loyalty_rule_view_kanban" model="ir.ui.view">
|
||||
<field name="name">loyalty.rule.view.kanban</field>
|
||||
<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"/>
|
||||
<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-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">
|
||||
<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 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>
|
||||
</t>
|
||||
</templates>
|
||||
</kanban>
|
||||
</field>
|
||||
</record>
|
||||
</odoo>
|
||||
Loading…
Add table
Add a link
Reference in a new issue