Files
odoo_source/addons/loyalty/wizard/loyalty_generate_wizard_views.xml
T
eres-odooandWilliam Braeckman 6927dcda9f [IMP] loyalty*: misc loyalty improvements
This commit improves some messages and usability for loyalty and its
submodules:
 - Coupons should not be restricted to the partner assigned to them
   anymore
 - Merged "I have a promo code" and "Use a gift card" into a single
   toggle
 - Boolean fields have been added to each app to disable them where we
   don't want them.
 - Reduced the size of coupon codes
   This means that we increase the risk of collision which should be
   handled by the model as well now.
   Creating a coupon with an existing code will retry the creation (up
   to 10 times) until the coupon is indeed created.
 - Make it clearer in the coupon generation wizard that an email will be
   sent to the customer.
 - Reintroduce coupon/gift card details on sale order lines in eCommerce
   which was wrongfully removed.
 - Remove the "on product with taxes: " message on order lines when
   the amount is not split between taxes or if the tax message would be
   empty.
 - Make it possible for some error messages to be displayed as warning
   instead of errors
 - Split program types in two menuitems, one for promotions discount
   loyalty etc and one for gift cards and ewallet, the latter has
   simplified views.
 - Views overall have been reviewed to make it easier to understand how
   to programs work. New program types have also been added.

TaskId-2951413

Part-of: odoo/odoo#99023
Co-authored-by: William Braeckman <wbr@odoo.com>
2022-09-02 20:10:59 +02:00

60 lines
3.7 KiB
XML

<?xml version="1.0" encoding="utf-8"?>
<odoo>
<record id="loyalty_generate_wizard_view_form" model="ir.ui.view">
<field name="name">loyalty.generate.wizard.view.form</field>
<field name="model">loyalty.generate.wizard</field>
<field name="arch" type="xml">
<form string="Generate">
<sheet>
<group>
<group>
<field name="program_id" invisible="1"/>
<field name="will_send_mail" invisible="1"/>
<field name="program_type" invisible="1"/>
<field name="mode" widget="radio" attrs="{'invisible': [('program_type', '=', 'ewallet')]}"/>
<field name="customer_ids" widget="many2many_tags" attrs="{'invisible': [('mode', '=', 'anonymous')]}"/>
<field name="customer_tag_ids" widget="many2many_tags" attrs="{'invisible': [('mode', '=', 'anonymous')]}" options="{'color_field': 'color'}"/>
<field name="coupon_qty" string="Quantity to generate" attrs="{'readonly': [('mode', '=', 'selected')], 'required': [('mode', '=', 'anonymous')]}"/>
<label string="Coupon value" for="points_granted" groups="base.group_no_one" attrs="{'invisible': [('program_type', '!=', 'coupons')]}"/>
<span class="d-inline-block" groups="base.group_no_one" attrs="{'invisible': [('program_type', '!=', 'coupons')]}">
<field name="points_granted" class="oe_inline"/>
<field name="points_name" class="oe_inline"/>
</span>
<label string="Gift Card value" for="points_granted" attrs="{'invisible': [('program_type', '!=', 'gift_card')]}"/>
<span class="d-inline-block" attrs="{'invisible': [('program_type', '!=', 'gift_card')]}">
<field name="points_granted" class="w-auto oe_inline me-1"/>
<field name="points_name" class="d-inline" no_label="1"/>
</span>
<label string="eWallet value" for="points_granted" attrs="{'invisible': [('program_type', '!=', 'ewallet')]}"/>
<span class="d-inline-block" attrs="{'invisible': [('program_type', '!=', 'ewallet')]}">
<field name="points_granted" class="w-auto oe_inline me-1"/>
<field name="points_name" class="d-inline" no_label="1"/>
</span>
<field name="valid_until"/>
</group>
</group>
</sheet>
<footer>
<button name="generate_coupons" type="object" class="btn-primary" data-hotkey="q">
<span attrs="{'invisible': [('will_send_mail', '=', False)]}">
Generate and Send
</span>
<span attrs="{'invisible': [('will_send_mail', '=', True)]}">
Generate
</span>
<field name="program_type" nolabel="1"/>
</button>
<button special="cancel" data-hotkey="z" string="Cancel"/>
</footer>
</form>
</field>
</record>
<record id="loyalty_generate_wizard_action" model="ir.actions.act_window">
<field name="name">Generate</field>
<field name="res_model">loyalty.generate.wizard</field>
<field name="view_mode">form</field>
<field name="target">new</field>
</record>
</odoo>