[CLN] sale_loyalty: xml & files cleanup
* Files ordering * Indentation * Simplified xpath when possible * Menus in specific file * Clear file names Part-of: odoo/odoo#120245
This commit is contained in:
@@ -10,14 +10,18 @@
|
||||
'auto_install': True,
|
||||
'data': [
|
||||
'security/ir.model.access.csv',
|
||||
|
||||
'data/sale_loyalty_data.xml',
|
||||
|
||||
'wizard/sale_loyalty_coupon_wizard_views.xml',
|
||||
'wizard/sale_loyalty_reward_wizard_views.xml',
|
||||
|
||||
'views/loyalty_card_views.xml',
|
||||
'views/loyalty_program_views.xml',
|
||||
'views/sale_order_views.xml',
|
||||
'views/templates.xml',
|
||||
'views/sale_portal_templates.xml',
|
||||
'views/res_partner_views.xml',
|
||||
'views/sale_loyalty_menus.xml',
|
||||
],
|
||||
'license': 'LGPL-3',
|
||||
}
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<odoo>
|
||||
<data noupdate="1">
|
||||
<record id="loyalty.gift_card_product_50" model="product.product">
|
||||
<field name="taxes_id" eval="False"/>
|
||||
</record>
|
||||
<record id="loyalty.ewallet_product_50" model="product.product">
|
||||
<field name="taxes_id" eval="False"/>
|
||||
</record>
|
||||
</data>
|
||||
<odoo noupdate="1">
|
||||
|
||||
<record id="loyalty.gift_card_product_50" model="product.product">
|
||||
<field name="taxes_id" eval="False"/>
|
||||
</record>
|
||||
<record id="loyalty.ewallet_product_50" model="product.product">
|
||||
<field name="taxes_id" eval="False"/>
|
||||
</record>
|
||||
|
||||
</odoo>
|
||||
|
||||
@@ -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" attrs="{'invisible': [('order_id', '=', False)]}"/>
|
||||
</field>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
</odoo>
|
||||
|
||||
@@ -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>
|
||||
@@ -20,21 +21,4 @@
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<menuitem
|
||||
id="menu_discount_loyalty_type_config"
|
||||
action="loyalty.loyalty_program_discount_loyalty_action"
|
||||
name="Discount & 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 & eWallet"
|
||||
parent="sale.product_menu_catalog"
|
||||
groups="sales_team.group_sale_manager"
|
||||
sequence="50"
|
||||
/>
|
||||
</odoo>
|
||||
|
||||
@@ -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>
|
||||
@@ -1,20 +1,22 @@
|
||||
<?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">
|
||||
<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"/>
|
||||
string="Coupon Code" type="action" 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"
|
||||
string="Promotions" type="object" states="draft,sent,sale"
|
||||
help="Update current promotional lines and select new rewards if applicable."/>
|
||||
</div>
|
||||
</xpath>
|
||||
</group>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
</odoo>
|
||||
|
||||
+17
-13
@@ -1,7 +1,7 @@
|
||||
<?xml version="1.0" ?>
|
||||
<odoo>
|
||||
|
||||
<template id="sale_loyalty.used_gift_card">
|
||||
<template id="used_gift_card">
|
||||
<div class="text-muted d-md-block small"
|
||||
t-if="line.coupon_id and line.order_id != line.coupon_id.order_id and not line.coupon_id.program_id.is_nominative">
|
||||
<span>
|
||||
@@ -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">
|
||||
@@ -58,4 +46,20 @@
|
||||
</div>
|
||||
</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>
|
||||
|
||||
</odoo>
|
||||
Reference in New Issue
Block a user