Files
odoo_source/addons/coupon/views/coupon_views.xml
T
f57a13f3f6 [IMP] website: add the possibility to share coupon and promotion links
Coupons and promotion programs can now be shared by creating a link that can
directly be used by the customer.

Using the link, the system will try to apply the coupon/promotion to the
customer's order.
If this can't be done, the error will be shown to the user, for instance
"A minimum amount of 1000$ is required to get the free ipad".
That coupon/promotion will then be stored in session and the system will try
automatically reapply it when something is added to the cart.

task-2489749

closes odoo/odoo#69053

Signed-off-by: Jérémy Kersten (jke) <jke@openerp.com>
Co-authored-by: Romain Derie <rde@odoo.com>
Co-authored-by: Jeremy Kersten <jke@odoo.com>
Co-authored-by: Tom De Caluwé <tdc@odoo.com>
2021-08-09 14:16:54 +00:00

50 lines
2.3 KiB
XML

<?xml version="1.0" encoding="utf-8"?>
<odoo>
<record id="coupon_view_tree" model="ir.ui.view">
<field name="name">coupon.coupon.tree</field>
<field name="model">coupon.coupon</field>
<field name="arch" type="xml">
<tree string="Coupons" create="false" edit="false" delete="false">
<field name="code"/>
<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" attrs="{'invisible': [('state', 'not in', ['new', 'sent'])]}"/>
<button name="action_coupon_cancel" string="Cancel" type="object" icon="fa-times" attrs="{'invisible': [('state', '!=', 'new')]}"/>
<field name="state"/>
</tree>
</field>
</record>
<record id="coupon_action" model="ir.actions.act_window">
<field name="name">Coupons</field>
<field name="res_model">coupon.coupon</field>
<field name="view_id" ref="coupon_view_tree"/>
<field name="domain">[('program_id', '=', active_id)]</field>
<field name="context">{}</field>
</record>
<record id="coupon_view_form" model="ir.ui.view">
<field name="name">coupon.coupon.form</field>
<field name="model">coupon.coupon</field>
<field name="arch" type="xml">
<form string="Coupons" create="false" edit="false" delete="false">
<header>
<button name="action_coupon_send" type="object" string="Send by Email" class="oe_highlight" attrs="{'invisible': [('state', 'not in', ['new', 'sent'])]}"/>
<button name="action_coupon_cancel" type="object" string="Cancel" class="oe_highlight" attrs="{'invisible': [('state', '!=', 'new')]}"/>
<field name="state" widget="statusbar" statusbar_visible="new,sent,used,expired" context="{'state': state}"/>
</header>
<sheet>
<group>
<field name="code"/>
<field name="expiration_date"/>
<field name="partner_id"/>
</group>
</sheet>
</form>
</field>
</record>
</odoo>