[IMP] sale_coupon: coupon pdf design

as per the task requirements pdf coupon design changed
same as email design.

Task-ID: 2027296
Closes #34620

Signed-off-by: Damien Bouvy (dbo) <dbo@odoo.com>
This commit is contained in:
mgh-odoo
2020-01-31 12:46:17 +00:00
committed by Damien Bouvy
parent bb87d3f674
commit d25fac7e8d
@@ -11,44 +11,48 @@
Congratulations
<t t-esc="o.partner_id.name"/>,
</h4>
<t t-set="text">OFF ON YOUR NEXT ORDER !</t>
<t t-set="text">on your next order</t>
<h4>Here is your reward from <t t-esc="o.program_id.company_id.name"/>.</h4>
<t t-if="o.program_id.reward_type == 'discount'">
<h1 t-if="o.program_id.discount_type == 'fixed_amount'" class="text-success">
<t t-set="trans_text">off %s</t>
<t t-set="text" t-value="trans_text % text"/>
<h1 t-if="o.program_id.discount_type == 'fixed_amount'" style="font-size: 55px; color: #875A7B">
<strong><span t-field="o.program_id.discount_fixed_amount" t-options='{"widget": "monetary", "display_currency": o.program_id.currency_id}'/></strong>
</h1>
<h1 t-if="o.program_id.discount_type == 'percentage'" class="text-success">
<strong><span t-field="o.program_id.discount_percentage"/>%</strong>
<h1 t-if="o.program_id.discount_type == 'percentage'" style="font-size: 55px; color: #875A7B">
<strong><span t-field="o.program_id.discount_percentage"/> %</strong>
</h1>
<t t-if="o.program_id.discount_apply_on == 'specific_products'">
<t t-if="len(o.program_id.discount_specific_product_ids) > 1">
<t t-set="text">OFF ON SOME PRODUCTS*</t>
<t t-set="text">off on some products*</t>
<t t-set="display_specific_products" t-value="True"/>
</t>
<t t-else="">
<t t-set="trans_text">OFF ON %s</t>
<t t-set="text" t-value="trans_text % o.program_id.discount_specific_product_ids.name.upper()"/>
<t t-set="trans_text">off on %s</t>
<t t-set="text" t-value="trans_text % o.program_id.discount_specific_product_ids.name"/>
</t>
</t>
<t t-if="o.program_id.discount_apply_on == 'cheapest_product'">
<t t-set="text">OFF ON THE CHEAPEST PRODUCT</t>
<t t-set="text">off on the cheapest product</t>
</t>
</t>
<t t-if="o.program_id.reward_type == 'product'">
<t t-set="trans_text">GET %s FREE %s ON YOUR NEXT ORDER !</t>
<t t-set="text" t-value="trans_text % (o.program_id.reward_product_quantity, o.program_id.reward_product_id.name.upper())"/>
<strong style="font-size: 55px; color: #875A7B">
<t t-esc="'get %s free %s' % (o.program_id.reward_product_quantity, o.program_id.reward_product_id.name)"/>
</strong>
</t>
<t t-if="o.program_id.reward_type == 'free_shipping'">
<t t-set="text">GET FREE SHIPPING ON YOUR NEXT ORDER !</t>
<strong style="font-size: 55px; color: #875A7B">get free shipping</strong>
</t>
<h3 t-esc="text"/>
<h3 t-if="o.expiration_date">
<h1 class="font-weight-bold" style="font-size: 34px" t-esc="text"/>
<br/>
<h4 t-if="o.expiration_date">
Use this promo code before
<strong t-field="o.expiration_date" t-options='{"format": "d MMMM y"}'/>
</h3>
<h3>
CODE:
<strong class="bg-success" t-esc="o.code"></strong>
</h3>
<span t-field="o.expiration_date" t-options='{"format": "yyyy-MM-d"}'/>
</h4>
<h2 class="mt32">
<strong class="bg-light" t-esc="o.code" style="padding: 20px 10px;"></strong>
</h2>
<h4 t-if="o.program_id.rule_min_quantity > 1">
<span>Minimum purchase of</span>
<strong t-esc="o.program_id.rule_min_quantity"/> <span>products</span>
@@ -59,15 +63,17 @@
</h4>
<p t-if="display_specific_products">
<small>
*Valid for following products: <t t-esc="', '.join(o.program_id.discount_specific_product_ids.mapped('name')).upper()"/>
*Valid for following products: <t t-esc="', '.join(o.program_id.discount_specific_product_ids.mapped('name'))"/>
</small>
</p>
<br/>
<img alt="Barcode" t-att-src="'/report/barcode/Code128/%s' % o.code"/>
<br/><br/>
<h4>Thank you,</h4>
<br/>
<div class="mt64">
<div class="mt32">
<div class="text-center">
<img alt="Logo" t-att-src="'/logo?company=%d' % (o.program_id.company_id)" t-att-alt="'%s' % (o.program_id.company_id.name)" style="border:0px solid transparent; height: 50; width: 200px;" height="50"/>
<img alt="Logo" t-att-src="'/logo?company=%d' % (o.program_id.company_id)" t-att-alt="'%s' % (o.program_id.company_id.name)" style="border:0px solid transparent; height: 50; width: 200px;" height="50"/>
</div>
</div>
<div>