19.0 vanilla

This commit is contained in:
Ernad Husremovic 2026-03-09 09:32:12 +01:00
parent 79f83631d5
commit 73afc09215
6267 changed files with 1534193 additions and 1130106 deletions

View file

@ -1,13 +1,15 @@
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<record id="loyalty_card_view_form_inherit_sale_loyalty" model="ir.ui.view">
<field name="name">loyalty.card.view.form.inherit.sale.loyalty</field>
<field name="model">loyalty.card</field>
<field name="inherit_id" ref="loyalty.loyalty_card_view_form"/>
<field name="arch" type="xml">
<xpath expr="//field[@name='partner_id']" position="after">
<field name="order_id" readonly="1" attrs="{'invisible': [('order_id', '=', False)]}" />
</xpath>
<field name="partner_id" position="after">
<field name="order_id" invisible="not order_id"/>
</field>
</field>
</record>
</odoo>

View file

@ -1,5 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<record id="loyalty_program_view_form_inherit_sale_loyalty" model="ir.ui.view">
<field name="name">loyalty.program.view.form.inherit.sale.loyalty</field>
<field name="model">loyalty.program</field>
@ -12,29 +13,12 @@
<attribute name="invisible">0</attribute>
</xpath>
<xpath expr="//div[@id='o_loyalty_program_availabilities']" position="inside">
<span class="d-inline-block">
<field name="sale_ok" class="w-auto me-0"/>
<label for="sale_ok" class="me-3"/>
<span class="d-inline-flex text-break">
<field name="sale_ok"/>
<label for="sale_ok"/>
</span>
</xpath>
</field>
</record>
<menuitem
id="menu_discount_loyalty_type_config"
action="loyalty.loyalty_program_discount_loyalty_action"
name="Discount &amp; Loyalty"
parent="sale.product_menu_catalog"
groups="sales_team.group_sale_manager"
sequence="40"
/>
<menuitem
id="menu_gift_ewallet_type_config"
action="loyalty.loyalty_program_gift_ewallet_action"
name="Gift cards &amp; eWallet"
parent="sale.product_menu_catalog"
groups="sales_team.group_sale_manager"
sequence="50"
/>
</odoo>

View file

@ -0,0 +1,15 @@
<?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="loyalty.res_partner_form"/>
<field name="arch" type="xml">
<button name="action_view_loyalty_cards" position="attributes">
<attribute name="groups" separator="," add="sales_team.group_sale_salesman"/>
</button>
</field>
</record>
</odoo>

View file

@ -0,0 +1,16 @@
<?xml version="1.0" encoding="UTF-8"?>
<odoo>
<menuitem id="menu_discount_loyalty_type_config"
action="loyalty.loyalty_program_discount_loyalty_action"
parent="sale.product_menu_catalog"
groups="sales_team.group_sale_manager"
sequence="40"/>
<menuitem id="menu_gift_ewallet_type_config"
action="loyalty.loyalty_program_gift_ewallet_action"
parent="sale.product_menu_catalog"
groups="sales_team.group_sale_manager"
sequence="50"/>
</odoo>

View file

@ -1,20 +1,75 @@
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<record id="sale_order_view_form_inherit_sale_loyalty" model="ir.ui.view">
<field name="name">sale.order.view.form.inherit.sale.loyalty</field>
<field name="model">sale.order</field>
<field name="inherit_id" ref="sale.view_order_form"/>
<field name="priority">10</field>
<field name="arch" type="xml">
<xpath expr="//group[@name='note_group']" position="before">
<div class="oe_right">
<button name="%(sale_loyalty.sale_loyalty_coupon_wizard_action)d" class="btn btn-secondary"
string="Coupon Code" type="action" groups="base.group_user" states="draft,sent,sale"/>
<button name="action_open_reward_wizard" class="btn btn-secondary"
string="Promotions" type="object" groups="base.group_user" states="draft,sent,sale"
help="Update current promotional lines and select new rewards if applicable."/>
</div>
<div name="button_box" position="inside">
<button
name="action_view_gift_cards"
class="oe_stat_button"
type="object"
icon="fa-gift"
invisible="gift_card_count == 0"
>
<field string="Gift Cards" name="gift_card_count" widget="statinfo"/>
</button>
</div>
<button name="action_open_discount_wizard" position="before">
<button
string="Coupon Code"
name="%(sale_loyalty.sale_loyalty_coupon_wizard_action)d"
type="action"
class="btn btn-secondary"
invisible="locked or state == 'cancel'"
/>
<button
string="Coupon Code"
name="%(sale_loyalty.sale_loyalty_coupon_wizard_action)d"
type="action"
class="btn btn-secondary"
disabled="1"
invisible="not (locked or state == 'cancel')"
/>
<button
string="Reward"
name="action_open_reward_wizard"
type="object"
class="btn btn-secondary"
help="Update current promotional lines and select new rewards if applicable."
invisible="locked or state == 'cancel'"
/>
<button
string="Reward"
name="action_open_reward_wizard"
type="object"
class="btn btn-secondary"
help="Update current promotional lines and select new rewards if applicable."
disabled="1"
invisible="not (locked or state == 'cancel')"
/>
</button>
<xpath expr="//list//field[@name='product_uom_qty']" position="before">
<field name="is_reward_line" column_invisible="True"/>
</xpath>
<xpath expr="//list//field[@name='product_uom_qty']" position="attributes">
<attribute name="readonly" add="is_reward_line" separator=" or "/>
</xpath>
<xpath expr="//list//field[@name='price_unit']" position="attributes">
<attribute name="readonly" add="is_reward_line" separator=" or "/>
</xpath>
<xpath expr="//list//field[@name='tax_ids']" position="attributes">
<attribute name="readonly" add="is_reward_line" separator=" or "/>
</xpath>
<group name="note_group" position="after">
<group class="d-flex flex-row-reverse oe_subtotal_footer border-0">
<field name="loyalty_data" widget="loyalty_data_field" nolabel="1" readonly="1"/>
</group>
</group>
</field>
</record>
</odoo>

View file

@ -1,8 +1,8 @@
<?xml version="1.0" ?>
<odoo>
<template id="sale_loyalty.used_gift_card">
<div class="text-muted d-md-block small"
<template id="used_gift_card">
<div class="d-md-block mb-2 small text-muted"
t-if="line.coupon_id and line.order_id != line.coupon_id.order_id and not line.coupon_id.program_id.is_nominative">
<span>
Code:
@ -18,18 +18,6 @@
</div>
</template>
<template id="sale_order_portal_content_inherit" name="Gift Card Products Portal" inherit_id="sale.sale_order_portal_content">
<xpath expr="//section[@id='details']//td[@id='product_name']/*[last()]" position="after">
<t t-if="line.coupon_id and line.coupon_id.program_id.program_type == 'gift_card'" t-call="sale_loyalty.used_gift_card"/>
</xpath>
<xpath expr="//div[@id='total']" position="after">
<t t-call="sale_loyalty.sale_purchased_gift_card">
<t t-set="order" t-value="sale_order"/>
<t t-set="hide_intro" t-value="1"/>
</t>
</xpath>
</template>
<template id="sale_purchased_gift_card">
<t t-set="gift_cards" t-value="order.coupon_point_ids.filtered(lambda pe: pe.coupon_id.program_id.program_type == 'gift_card').coupon_id"/>
<div class="card mt-3 " t-if="gift_cards and order.state in ('sale', 'done')">
@ -58,4 +46,48 @@
</div>
</div>
</template>
<template id="sale_order_portal_loyalty_content">
<t t-set="loyalty_data" t-value="sale_order.loyalty_data"/>
<div class="col-xs-5 col-md-6 col-lg-5" t-if="loyalty_data">
<table class="table table-sm">
<tr>
<td><strong>Loyalty Card</strong></td>
</tr>
<tr t-if="loyalty_data['issued']">
<td>Issued</td>
<td class="text-end">
+<span t-out="loyalty_data['issued']"/>
<span class="d-none d-md-inline" t-out="loyalty_data['point_name']"/>
</td>
</tr>
<tr t-if="loyalty_data['cost']">
<td>Used</td>
<td class="text-end">
-<span t-out="loyalty_data['cost']"/>
<span class="d-none d-md-inline" t-out="loyalty_data['point_name']"/>
</td>
</tr>
</table>
</div>
</template>
<template id="sale_order_portal_content_inherit"
name="Gift Card Products Portal"
inherit_id="sale.sale_order_portal_content">
<xpath expr="//section[@id='details']//td[@name='td_product_name']/*[last()]" position="after">
<t t-if="line.coupon_id and line.coupon_id.program_id.program_type == 'gift_card'"
t-call="sale_loyalty.used_gift_card"/>
</xpath>
<xpath expr="//div[@id='total']" position="after">
<t t-call="sale_loyalty.sale_purchased_gift_card">
<t t-set="order" t-value="sale_order"/>
<t t-set="hide_intro" t-value="1"/>
</t>
</xpath>
<xpath expr="//div[@id='total']/*" position="after">
<t t-call="sale_loyalty.sale_order_portal_loyalty_content" />
</xpath>
</template>
</odoo>