diff options
| author | Christophe Matthieu <chm@odoo.com> | 2016-05-04 16:26:50 +0200 |
|---|---|---|
| committer | Christophe Matthieu <chm@odoo.com> | 2016-06-14 13:12:14 +0200 |
| commit | d9efca0908e50d8c2edc6eea463baa68d2c30ab8 (patch) | |
| tree | 5539f9e5a380ad52e7eb57879a4c8fa42e6bd933 /addons | |
| parent | f4f396c4ab6c5c2efb9c3da4b650b2c17c475f22 (diff) | |
[IMP] qweb: t-field-options is a python dict, safe_eval for compile template, not need to eval in field methods
Diffstat (limited to 'addons')
20 files changed, 101 insertions, 102 deletions
diff --git a/addons/account/views/report_invoice.xml b/addons/account/views/report_invoice.xml index 80af37c8ee1..8e4401a7a16 100644 --- a/addons/account/views/report_invoice.xml +++ b/addons/account/views/report_invoice.xml @@ -85,7 +85,7 @@ </td> <td class="text-right"> <span t-field="l.price_subtotal" - t-field-options='{"widget": "monetary", "display_currency": "o.currency_id"}'/> + t-field-options='{"widget": "monetary", "display_currency": o.currency_id}'/> </td> </tr> </tbody> @@ -97,7 +97,7 @@ <tr class="border-black"> <td><strong>Subtotal</strong></td> <td class="text-right"> - <span t-field="o.amount_untaxed" t-field-options='{"widget": "monetary", "display_currency": "o.currency_id"}'/> + <span t-field="o.amount_untaxed" t-field-options='{"widget": "monetary", "display_currency": o.currency_id}'/> </td> </tr> <t t-foreach="o._get_tax_amount_by_group()" t-as="amount_by_group"> @@ -111,7 +111,7 @@ <tr class="border-black"> <td><strong>Total</strong></td> <td class="text-right"> - <span t-field="o.amount_total" t-field-options='{"widget": "monetary", "display_currency": "o.currency_id"}'/> + <span t-field="o.amount_total" t-field-options='{"widget": "monetary", "display_currency": o.currency_id}'/> </td> </tr> </table> diff --git a/addons/event/report/event_event_templates.xml b/addons/event/report/event_event_templates.xml index 39f4b21bf6f..efb46e5ce6f 100644 --- a/addons/event/report/event_event_templates.xml +++ b/addons/event/report/event_event_templates.xml @@ -18,7 +18,7 @@ <img t-att-src="'data:image/png;base64,%s' % o.event_id.organizer_id.company_id.logo_web" style="max-height:1cm; max-width:4cm;"/> </span> <h5 t-field="o.event_id.name"/> - <h5>( <i class="fa fa-clock-o"></i> <span itemprop="startDate" t-field="o.event_id.date_begin" t-field-options='{"hide_seconds":"True"}'> </span> <i>to</i> <span itemprop="endDate" t-field="o.event_id.date_end" t-field-options='{"hide_seconds":"True"}'> </span> )</h5> + <h5>( <i class="fa fa-clock-o"></i> <span itemprop="startDate" t-field="o.event_id.date_begin" t-field-options='{"hide_seconds": True}'> </span> <i>to</i> <span itemprop="endDate" t-field="o.event_id.date_end" t-field-options='{"hide_seconds": True}'> </span> )</h5> </div> <div class="row"> <div class="col-xs-12 text-center" id="o_event_name"> @@ -69,7 +69,7 @@ </div> </span> <h4 t-field="event.name"/> - <h5>( <i class="fa fa-clock-o"></i> <span itemprop="startDate" t-field="event.date_begin" t-field-options='{"hide_seconds":"True"}'> </span> <i>to</i> <span itemprop="endDate" t-field="event.date_end" t-field-options='{"hide_seconds":"True"}'> </span> )</h5> + <h5>( <i class="fa fa-clock-o"></i> <span itemprop="startDate" t-field="event.date_begin" t-field-options='{"hide_seconds": True}'> </span> <i>to</i> <span itemprop="endDate" t-field="event.date_end" t-field-options='{"hide_seconds": True}'> </span> )</h5> </div> </div> <div class="row" t-ignore="true"> diff --git a/addons/hr_expense/views/report_expense.xml b/addons/hr_expense/views/report_expense.xml index 78a0402a2ad..90c92c05792 100644 --- a/addons/hr_expense/views/report_expense.xml +++ b/addons/hr_expense/views/report_expense.xml @@ -55,7 +55,7 @@ </td> <td> <span t-field="line.unit_amount" - t-field-options='{"widget": "monetary", "display_currency":"line.currency_id"}'/> + t-field-options='{"widget": "monetary", "display_currency": line.currency_id}'/> </td> <td class="text-center"> <span t-field="line.quantity"/> @@ -75,7 +75,7 @@ </td> <td class="text-right"> <span t-field="line.total_amount" - t-field-options='{"widget": "monetary", "display_currency":"line.currency_id"}'/> + t-field-options='{"widget": "monetary", "display_currency": line.currency_id}'/> </td> </tr> </t> diff --git a/addons/lunch/report/lunch_order_templates.xml b/addons/lunch/report/lunch_order_templates.xml index 58af7ebdc46..588e5392d2a 100644 --- a/addons/lunch/report/lunch_order_templates.xml +++ b/addons/lunch/report/lunch_order_templates.xml @@ -51,7 +51,7 @@ </td> <td class="text-right"> <span t-field="line.price" - t-field-options='{"widget": "monetary", "display_currency": "user.company_id.currency_id"}'/> + t-field-options='{"widget": "monetary", "display_currency": user.company_id.currency_id}'/> </td> </tr> </t> diff --git a/addons/mrp_repair/views/report_mrprepairorder.xml b/addons/mrp_repair/views/report_mrprepairorder.xml index 0e66cba9ebc..df7e1049fa6 100644 --- a/addons/mrp_repair/views/report_mrprepairorder.xml +++ b/addons/mrp_repair/views/report_mrprepairorder.xml @@ -88,7 +88,7 @@ </td> <td class="text-right"> <span t-field="line.price_subtotal" - t-field-options='{"widget": "monetary", "display_currency": "o.pricelist_id.currency_id"}'/> + t-field-options='{"widget": "monetary", "display_currency": o.pricelist_id.currency_id}'/> </td> </t> </tr> @@ -112,7 +112,7 @@ </td> <td class="text-right"> <span t-field="fees.price_subtotal" - t-field-options='{"widget": "monetary", "display_currency": "o.pricelist_id.currency_id"}'/> + t-field-options='{"widget": "monetary", "display_currency": o.pricelist_id.currency_id}'/> </td> </t> </tr> @@ -127,21 +127,21 @@ <td><strong>Total Without Taxes</strong></td> <td class="text-right"> <span t-field="o.amount_untaxed" - t-field-options='{"widget": "monetary", "display_currency": "o.pricelist_id.currency_id"}'/> + t-field-options='{"widget": "monetary", "display_currency": o.pricelist_id.currency_id}'/> </td> </tr> <tr> <td>Taxes</td> <td class="text-right"> <span t-field="o.amount_tax" - t-field-options='{"widget": "monetary", "display_currency": "o.pricelist_id.currency_id"}'/> + t-field-options='{"widget": "monetary", "display_currency": o.pricelist_id.currency_id}'/> </td> </tr> <tr class="border-black"> <td><strong>Total</strong></td> <td class="text-right"> <span t-field="o.amount_total" - t-field-options='{"widget": "monetary", "display_currency": "o.pricelist_id.currency_id"}'/> + t-field-options='{"widget": "monetary", "display_currency": o.pricelist_id.currency_id}'/> </td> </tr> </table> diff --git a/addons/point_of_sale/views/report_statement.xml b/addons/point_of_sale/views/report_statement.xml index bc4cc70b473..cedd7f55309 100644 --- a/addons/point_of_sale/views/report_statement.xml +++ b/addons/point_of_sale/views/report_statement.xml @@ -34,11 +34,11 @@ </div> <div class="col-xs-3"> <strong>Starting Balance</strong>:<br/> - <span t-field="o.balance_start" t-field-options='{"widget": "monetary", "display_currency": "res_company.currency_id"}'/> + <span t-field="o.balance_start" t-field-options='{"widget": "monetary", "display_currency": res_company.currency_id}'/> </div> <div class="col-xs-3"> <strong>Ending Balance</strong>:<br/> - <span t-field="o.balance_end_real" t-field-options='{"widget": "monetary", "display_currency": "res_company.currency_id"}'/> + <span t-field="o.balance_end_real" t-field-options='{"widget": "monetary", "display_currency": res_company.currency_id}'/> </div> </div> @@ -56,7 +56,7 @@ <td><span t-esc="line.partner_id.name"/></td> <td class="text-right"> <span t-field="line.amount" - t-field-options='{"widget": "monetary", "display_currency": "res_company.currency_id"}'/> + t-field-options='{"widget": "monetary", "display_currency": res_company.currency_id}'/> </td> </tr> </tbody> @@ -67,7 +67,7 @@ <table class="table table-condensed"> <tr class="border-black"> <td><strong>Total</strong></td> - <td class="text-right"><span t-esc="sum([line.amount for line in o.line_ids])" t-esc-options='{"widget": "monetary", "display_currency": "res_company.currency_id"}'/></td> + <td class="text-right"><span t-esc="format(sum([line.amount for line in o.line_ids]), 'monetary', res_company.currency_id)"/></td> </tr> </table> </div> diff --git a/addons/purchase/views/report_purchaseorder.xml b/addons/purchase/views/report_purchaseorder.xml index 138f40ca7e1..cdc15a3e754 100644 --- a/addons/purchase/views/report_purchaseorder.xml +++ b/addons/purchase/views/report_purchaseorder.xml @@ -76,7 +76,7 @@ </td> <td class="text-right"> <span t-field="line.price_subtotal" - t-field-options='{"widget": "monetary", "display_currency": "o.currency_id"}'/> + t-field-options='{"widget": "monetary", "display_currency": o.currency_id}'/> </td> </tr> </tbody> @@ -89,21 +89,21 @@ <td><strong>Total Without Taxes</strong></td> <td class="text-right"> <span t-field="o.amount_untaxed" - t-field-options='{"widget": "monetary", "display_currency": "o.currency_id"}'/> + t-field-options='{"widget": "monetary", "display_currency": o.currency_id}'/> </td> </tr> <tr> <td>Taxes</td> <td class="text-right"> <span t-field="o.amount_tax" - t-field-options='{"widget": "monetary", "display_currency": "o.currency_id"}'/> + t-field-options='{"widget": "monetary", "display_currency": o.currency_id}'/> </td> </tr> <tr class="border-black"> <td><strong>Total</strong></td> <td class="text-right"> <span t-field="o.amount_total" - t-field-options='{"widget": "monetary", "display_currency": "o.currency_id"}'/> + t-field-options='{"widget": "monetary", "display_currency": o.currency_id}'/> </td> </tr> </table> diff --git a/addons/report_intrastat/report/report_intrastat_invoice_template.xml b/addons/report_intrastat/report/report_intrastat_invoice_template.xml index 65cb7c26cc4..4fa10563f72 100644 --- a/addons/report_intrastat/report/report_intrastat_invoice_template.xml +++ b/addons/report_intrastat/report/report_intrastat_invoice_template.xml @@ -67,7 +67,7 @@ <td t-if="display_discount" groups="sale.group_discount_per_so_line"><span t-field="l.discount"/></td> <td class="text-right"> <span t-field="l.price_subtotal" - t-field-options='{"widget": "monetary", "display_currency": "o.currency_id"}'/> + t-field-options='{"widget": "monetary", "display_currency": o.currency_id}'/> </td> </tr> </tbody> @@ -79,19 +79,19 @@ <tr class="border-black"> <td><strong>Total Without Taxes</strong></td> <td class="text-right"> - <span t-field="o.amount_untaxed" t-field-options='{"widget": "monetary", "display_currency": "o.currency_id"}'/> + <span t-field="o.amount_untaxed" t-field-options='{"widget": "monetary", "display_currency": o.currency_id}'/> </td> </tr> <tr> <td>Taxes</td> <td class="text-right"> - <span t-field="o.amount_tax" t-field-options='{"widget": "monetary", "display_currency": "o.currency_id"}'/> + <span t-field="o.amount_tax" t-field-options='{"widget": "monetary", "display_currency": o.currency_id}'/> </td> </tr> <tr class="border-black"> <td><strong>Total</strong></td> <td class="text-right"> - <span t-field="o.amount_total" t-field-options='{"widget": "monetary", "display_currency": "o.currency_id"}'/> + <span t-field="o.amount_total" t-field-options='{"widget": "monetary", "display_currency": o.currency_id}'/> </td> </tr> </table> @@ -112,7 +112,7 @@ <td><span t-field="t.name"/></td> <td class="text-right"> <span t-field="t.amount" - t-field-options='{"widget": "monetary", "display_currency": "o.currency_id"}'/> + t-field-options='{"widget": "monetary", "display_currency": o.currency_id}'/> </td> </tr> </tbody> diff --git a/addons/sale/views/report_invoice_layouted.xml b/addons/sale/views/report_invoice_layouted.xml index bcbf57de207..3ee9d65c707 100644 --- a/addons/sale/views/report_invoice_layouted.xml +++ b/addons/sale/views/report_invoice_layouted.xml @@ -48,7 +48,7 @@ </td> <td class="text-right"> <span t-field="l.price_subtotal" - t-field-options='{"widget": "monetary", "display_currency": "o.currency_id"}'/> + t-field-options='{"widget": "monetary", "display_currency": o.currency_id}'/> </td> </tr> </t> diff --git a/addons/sale/views/report_saleorder.xml b/addons/sale/views/report_saleorder.xml index 471c7a47ac3..a603688a19b 100644 --- a/addons/sale/views/report_saleorder.xml +++ b/addons/sale/views/report_saleorder.xml @@ -97,7 +97,7 @@ </td> <td class="text-right"> <span t-field="l.price_subtotal" - t-field-options='{"widget": "monetary", "display_currency": "doc.pricelist_id.currency_id"}'/> + t-field-options='{"widget": "monetary", "display_currency": doc.pricelist_id.currency_id}'/> </td> </tr> </t> @@ -128,7 +128,7 @@ <td><strong>Total Without Taxes</strong></td> <td class="text-right"> <span t-field="doc.amount_untaxed" - t-field-options='{"widget": "monetary", "display_currency": "doc.pricelist_id.currency_id"}'/> + t-field-options='{"widget": "monetary", "display_currency": doc.pricelist_id.currency_id}'/> </td> </tr> <t t-foreach="doc._get_tax_amount_by_group()" t-as="amount_by_group"> @@ -143,7 +143,7 @@ <td><strong>Total</strong></td> <td class="text-right"> <span t-field="doc.amount_total" - t-field-options='{"widget": "monetary", "display_currency": "doc.pricelist_id.currency_id"}'/> + t-field-options='{"widget": "monetary", "display_currency": doc.pricelist_id.currency_id}'/> </td> </tr> </table> diff --git a/addons/website/models/ir_qweb.py b/addons/website/models/ir_qweb.py index c8c0fe64613..6c9cd9f41b7 100644 --- a/addons/website/models/ir_qweb.py +++ b/addons/website/models/ir_qweb.py @@ -2,7 +2,6 @@ from openerp.addons.web.http import request from openerp.osv import orm import ast -from openerp.addons.base.ir.ir_qweb import utils class QWeb(orm.AbstractModel): @@ -29,7 +28,7 @@ class QWeb(orm.AbstractModel): ] def _website_build_attribute(self, tagName, name, value, qwebcontext): - context = qwebcontext.context or {} + context = qwebcontext.env.context or {} if not context.get('rendering_bundle'): if name == self.URL_ATTRS.get(tagName) and qwebcontext.get('url_for'): return qwebcontext.get('url_for')(value or '') diff --git a/addons/website_event_sale/views/website_event_sale_templates.xml b/addons/website_event_sale/views/website_event_sale_templates.xml index 10dff2e264b..f4f628bd501 100644 --- a/addons/website_event_sale/views/website_event_sale_templates.xml +++ b/addons/website_event_sale/views/website_event_sale_templates.xml @@ -40,13 +40,13 @@ <t t-if="(ticket.price-ticket.price_reduce) > 1"> <del class="text-danger mr4" style="white-space: nowrap;" t-field="ticket.price" t-field-options='{ "widget": "monetary", - "from_currency": "website.currency_id", - "display_currency": "user_id.partner_id.property_product_pricelist.currency_id" + "from_currency": website.currency_id, + "display_currency": user_id.partner_id.property_product_pricelist.currency_id }'/> </t> <span t-field="ticket.price_reduce" t-field-options='{ "widget": "monetary", - "display_currency": "website.pricelist_id.currency_id" + "display_currency": website.pricelist_id.currency_id }'/> <span itemprop="price" style="display:none;" t-esc="ticket.price"/> <span itemprop="priceCurrency" style="display:none;" t-esc="website.pricelist_id.currency_id.name"/> diff --git a/addons/website_event_track/views/website_event_track_templates.xml b/addons/website_event_track/views/website_event_track_templates.xml index 860ea6e1bd1..1e85296688f 100644 --- a/addons/website_event_track/views/website_event_track_templates.xml +++ b/addons/website_event_track/views/website_event_track_templates.xml @@ -248,7 +248,7 @@ <b>Date</b><br/> <span t-field="track.date" t-field-options='{"hide_seconds":"True"}'/><br/> <b>Duration</b><br/> - <span t-field="track.duration" t-field-options="{"widget": "duration", "unit": "hour"}"/><br/> + <span t-field="track.duration" t-field-options='{"widget": "duration", "unit": "hour"}'/><br/> <b>Location</b><br/> <span t-field="track.location_id"/><br/> </div> diff --git a/addons/website_portal_sale/views/templates.xml b/addons/website_portal_sale/views/templates.xml index 80103dca671..0b251c6abb9 100644 --- a/addons/website_portal_sale/views/templates.xml +++ b/addons/website_portal_sale/views/templates.xml @@ -91,7 +91,7 @@ <span class="label label-default"><i class="fa fa-fw fa-clock-o"/> Expired</span> </t> </td> - <td><span t-field="quotation.amount_total" t-field-options='{"widget": "monetary", "display_currency": "quotation.pricelist_id.currency_id"}'/> + <td><span t-field="quotation.amount_total" t-field-options='{"widget": "monetary", "display_currency": quotation.pricelist_id.currency_id}'/> </td> </tr> </t> @@ -136,7 +136,7 @@ <span class="label label-default"><i class="fa fa-fw fa-check"/> Done</span> </t> </td> - <td><span t-field="order.amount_total" t-field-options='{"widget": "monetary", "display_currency": "order.pricelist_id.currency_id"}'/></td> + <td><span t-field="order.amount_total" t-field-options='{"widget": "monetary", "display_currency": order.pricelist_id.currency_id}'/></td> </tr> </t> </table> @@ -186,7 +186,7 @@ <td> <a t-if="invoice.state == 'open'" t-attf-href="/website_payment/pay?reference=#{invoice.number}&amount=#{invoice.residual}&currency_id=#{invoice.currency_id.id}&country_id=#{invoice.partner_id.country_id.id}" alt="Pay Now" class="btn btn-xs btn-primary"><i class="fa fa-arrow-circle-right"/> Pay Now</a> </td> - <td><span t-field="invoice.residual" t-field-options='{"widget": "monetary", "display_currency": "invoice.currency_id"}'/></td> + <td><span t-field="invoice.residual" t-field-options='{"widget": "monetary", "display_currency": invoice.currency_id}'/></td> </tr> </t> </table> @@ -319,7 +319,7 @@ <span t-esc="ol.product_id.name"/> </div> <div class="col-md-2 text-right"> - <span t-field="ol.price_unit" t-field-options='{"widget": "monetary", "display_currency": "order.pricelist_id.currency_id"}'/> + <span t-field="ol.price_unit" t-field-options='{"widget": "monetary", "display_currency": order.pricelist_id.currency_id}'/> </div> <div class="col-md-2 text-right"> <t t-if="ol._name == 'sale.order.line'"> @@ -330,7 +330,7 @@ </t> </div> <div class="col-md-2 text-right"> - <span t-field="ol.price_subtotal" t-field-options='{"widget": "monetary", "display_currency": "order.pricelist_id.currency_id"}'/> + <span t-field="ol.price_subtotal" t-field-options='{"widget": "monetary", "display_currency": order.pricelist_id.currency_id}'/> </div> </div> </t> @@ -350,7 +350,7 @@ Untaxed Amount: </div> <div class="col-md-2 text-right"> - <span t-field="order.amount_untaxed" t-field-options='{"widget": "monetary", "display_currency": "order.pricelist_id.currency_id"}'/> + <span t-field="order.amount_untaxed" t-field-options='{"widget": "monetary", "display_currency": order.pricelist_id.currency_id}'/> </div> </div> <div class="row"> @@ -358,7 +358,7 @@ Taxes: </div> <div class="col-md-2 text-right"> - <span t-field="order.amount_tax" t-field-options='{"widget": "monetary", "display_currency": "order.pricelist_id.currency_id"}'/> + <span t-field="order.amount_tax" t-field-options='{"widget": "monetary", "display_currency": order.pricelist_id.currency_id}'/> </div> </div> <div class="row"> @@ -366,7 +366,7 @@ <strong>Total:</strong> </div> <div class="col-md-2 text-right"> - <strong><span t-field="order.amount_total" t-field-options='{"widget": "monetary", "display_currency": "order.pricelist_id.currency_id"}'/></strong> + <strong><span t-field="order.amount_total" t-field-options='{"widget": "monetary", "display_currency": order.pricelist_id.currency_id}'/></strong> </div> </div> </div> diff --git a/addons/website_quote/views/report_saleorder.xml b/addons/website_quote/views/report_saleorder.xml index bb70ad82778..1a2ad2606b5 100644 --- a/addons/website_quote/views/report_saleorder.xml +++ b/addons/website_quote/views/report_saleorder.xml @@ -38,7 +38,7 @@ <td> <strong class="text-right"> <div t-field="option.price_unit" - t-field-options='{"widget": "monetary", "display_currency": "doc.pricelist_id.currency_id"}' + t-field-options='{"widget": "monetary", "display_currency": doc.pricelist_id.currency_id}' t-att-style="option.discount and 'text-decoration: line-through' or None" t-att-class="option.discount and 'text-danger' or None"/> <div t-if="option.discount"> diff --git a/addons/website_quote/views/website_quotation.xml b/addons/website_quote/views/website_quotation.xml index d1b309dc62f..7ba8c719aaf 100644 --- a/addons/website_quote/views/website_quotation.xml +++ b/addons/website_quote/views/website_quotation.xml @@ -61,7 +61,7 @@ </td> <td class="text-right"> <div t-field="line.price_unit" - t-field-options='{"widget": "monetary", "display_currency": "quotation.pricelist_id.currency_id"}' + t-field-options='{"widget": "monetary", "display_currency": quotation.pricelist_id.currency_id}' t-att-style="line.discount and 'text-decoration: line-through' or None" t-att-class="(line.discount and 'text-danger' or '') + ' text-right'"/> <!-- TODO: apply monetary widget formating --> @@ -72,7 +72,7 @@ <td> <div class="text-right" t-field="line.price_subtotal" - t-field-options='{"widget": "monetary", "display_currency": "quotation.pricelist_id.currency_id"}'/> + t-field-options='{"widget": "monetary", "display_currency": quotation.pricelist_id.currency_id}'/> </td> <td class="text-center"> <a t-attf-href="./update_line/#{ line.id }/?order_id=#{ quotation.id }&unlink=True&token=#{ quotation.access_token }" class="mb8 js_update_line_json hidden-print" t-if="line.option_line_id"> @@ -99,7 +99,7 @@ <td></td><td></td><td></td><td></td> <td class="text-right"><strong>Subtotal:</strong></td> <td class="text-right"> - <strong data-id="total_amount" t-field="quotation.amount_untaxed" t-field-options='{"widget": "monetary","display_currency": "quotation.pricelist_id.currency_id"}'/> + <strong data-id="total_amount" t-field="quotation.amount_untaxed" t-field-options='{"widget": "monetary","display_currency": quotation.pricelist_id.currency_id}'/> </td> <td></td> </tr> @@ -108,7 +108,7 @@ <td></td><td></td><td></td><td></td> <td class="text-right">Taxes:</td> <td class="text-right"> - <span data-id="total_amount" t-field="quotation.amount_tax" t-field-options='{"widget": "monetary","display_currency": "quotation.pricelist_id.currency_id"}'/> + <span data-id="total_amount" t-field="quotation.amount_tax" t-field-options='{"widget": "monetary","display_currency": quotation.pricelist_id.currency_id}'/> </td> <td></td> </tr> @@ -116,7 +116,7 @@ <td></td><td></td><td></td><td></td> <td class="text-right"><strong>Total:</strong></td> <td class="text-right"> - <strong data-id="total_amount" t-field="quotation.amount_total" t-field-options='{"widget": "monetary","display_currency": "quotation.pricelist_id.currency_id"}'/> + <strong data-id="total_amount" t-field="quotation.amount_total" t-field-options='{"widget": "monetary","display_currency": quotation.pricelist_id.currency_id}'/> </td> <td></td> </tr> @@ -220,22 +220,22 @@ <p class="text-muted mb8">Your advantage:</p> <t t-if="quotation.amount_untaxed == quotation.amount_total"> <strong t-field="quotation.amount_total" - t-field-options='{"widget": "monetary", "display_currency": "quotation.pricelist_id.currency_id"}'/> + t-field-options='{"widget": "monetary", "display_currency": quotation.pricelist_id.currency_id}'/> <strong t-field="quotation.amount_undiscounted" - t-field-options='{"widget": "monetary", "display_currency": "quotation.pricelist_id.currency_id"}' + t-field-options='{"widget": "monetary", "display_currency": quotation.pricelist_id.currency_id}' style="text-decoration: line-through" class="text-danger"/> </t> <t t-if="quotation.amount_untaxed != quotation.amount_total"> <strong t-field="quotation.amount_untaxed" - t-field-options='{"widget": "monetary", "display_currency": "quotation.pricelist_id.currency_id"}'/> + t-field-options='{"widget": "monetary", "display_currency": quotation.pricelist_id.currency_id}'/> <strong t-field="quotation.amount_undiscounted" - t-field-options='{"widget": "monetary", "display_currency": "quotation.pricelist_id.currency_id"}' + t-field-options='{"widget": "monetary", "display_currency": quotation.pricelist_id.currency_id}' style="text-decoration: line-through" class="text-danger"/> <br /> (<span t-field="quotation.amount_total" - t-field-options='{"widget": "monetary", "display_currency": "quotation.pricelist_id.currency_id"}'/> Incl. tax) + t-field-options='{"widget": "monetary", "display_currency": quotation.pricelist_id.currency_id}'/> Incl. tax) </t> </div> </div> @@ -292,7 +292,7 @@ <span>I agree that by signing this proposal, I accept it on the behalf of </span><b t-field="quotation.company_id"/><span>, for an amount of </span> <b data-id="total_amount" t-field="quotation.amount_total" - t-field-options='{"widget": "monetary", "display_currency": "quotation.pricelist_id.currency_id"}'/> + t-field-options='{"widget": "monetary", "display_currency": quotation.pricelist_id.currency_id}'/> <span>with payment terms: </span><b t-field="quotation.payment_term_id"/>. </p> <div id="signer" class="form-group"> @@ -319,7 +319,7 @@ <span>I agree that by paying this proposal, I accept it on the behalf of </span><b t-field="quotation.company_id"/><span>, for an amount of </span> <b data-id="total_amount" t-field="quotation.amount_total" - t-field-options='{"widget": "monetary", "display_currency": "quotation.pricelist_id.currency_id"}'/> + t-field-options='{"widget": "monetary", "display_currency": quotation.pricelist_id.currency_id}'/> <span>with payment terms: </span><b t-field="quotation.payment_term_id"/>. </p> </div> @@ -587,7 +587,7 @@ <td> <strong class="text-right"> <div t-field="option.price_unit" - t-field-options='{"widget": "monetary", "display_currency": "quotation.pricelist_id.currency_id"}' + t-field-options='{"widget": "monetary", "display_currency": quotation.pricelist_id.currency_id}' t-att-style="option.discount and 'text-decoration: line-through' or None" t-att-class="option.discount and 'text-danger' or None"/> <div t-if="option.discount"> @@ -699,7 +699,7 @@ <span class="label label-default"><i class="fa fa-fw fa-clock-o"/> Expired</span> </t> </td> - <td><span t-field="quotation.amount_total" t-field-options='{"widget": "monetary", "display_currency": "quotation.pricelist_id.currency_id"}'/> + <td><span t-field="quotation.amount_total" t-field-options='{"widget": "monetary", "display_currency": quotation.pricelist_id.currency_id}'/> </td> </tr> </t> diff --git a/addons/website_sale/views/report_shop_saleorder.xml b/addons/website_sale/views/report_shop_saleorder.xml index 823c16d32ae..74519e6b78a 100644 --- a/addons/website_sale/views/report_shop_saleorder.xml +++ b/addons/website_sale/views/report_shop_saleorder.xml @@ -35,7 +35,7 @@ </td> <td class="text-right"> <span t-field="doc.amount_total" - t-field-options='{"widget": "monetary", "display_currency": "doc.pricelist_id.currency_id"}'/> + t-field-options='{"widget": "monetary", "display_currency": doc.pricelist_id.currency_id}'/> </td> </tr> </tbody> diff --git a/addons/website_sale/views/templates.xml b/addons/website_sale/views/templates.xml index 3b1df7dd892..3ad3e76dced 100644 --- a/addons/website_sale/views/templates.xml +++ b/addons/website_sale/views/templates.xml @@ -78,7 +78,7 @@ </div> <div class="oe_product_image"> <a itemprop="url" t-att-href="keep('/shop/product/%s' % slug(product), page=(pager['page']['num'] if pager['page']['num']>1 else None))"> - <span itemprop="image" t-field="product.image" t-field-options='{"widget": "image" #{None if product_image_big else ", \"resize\": \"300x300\""}}' t-att-alt="product.name"/> + <span itemprop="image" t-field="product.image" t-field-options='{"widget": "image", "resize": None if product_image_big else "300x300"}' t-att-alt="product.name"/> </a> </div> <t t-if="show_publish"> @@ -97,13 +97,13 @@ <t t-if="(compute_currency(product.lst_price) - product.price) > 0.1"> <del class="text-danger mr8" style="white-space: nowrap;" t-field="product.lst_price" t-field-options='{ "widget": "monetary", - "from_currency": "product.currency_id", - "display_currency": "website.currency_id" + "from_currency": product.currency_id, + "display_currency": website.currency_id }'/> </t> <span t-field="product.price" style="white-space: nowrap;" t-field-options='{ "widget": "monetary", - "display_currency": "website.currency_id" + "display_currency": website.currency_id }'> </span> <span itemprop="price" style="display:none;" t-esc="product.price"/> @@ -437,14 +437,14 @@ t-field="product.lst_price" t-field-options='{ "widget": "monetary", - "from_currency": "product.currency_id", - "display_currency": "website.currency_id" + "from_currency": product.currency_id, + "display_currency": website.currency_id }'/> <b class="oe_price" style="white-space: nowrap;" t-field="product.price" t-field-options='{ "widget": "monetary", - "display_currency": "website.currency_id" + "display_currency": website.currency_id }'/> <span itemprop="price" style="display:none;" t-esc="product.price"/> <span itemprop="priceCurrency" style="display:none;" t-esc="website.currency_id.name"/> @@ -453,7 +453,7 @@ <span t-field="product.lst_price" t-field-options='{ "widget": "monetary", - "display_currency": "product.currency_id" + "display_currency": product.currency_id }'/> </h4> <h4 class="hidden oe_not_available bg-warning">Product not available</h4> @@ -473,8 +473,8 @@ <span class="badge" t-if="variant_id.price_extra"> <t t-esc="variant_id.price_extra > 0 and '+' or ''"/><span t-field="variant_id.price_extra" style="white-space: nowrap;" t-field-options='{ "widget": "monetary", - "from_currency": "product.currency_id", - "display_currency": "website.currency_id" + "from_currency": product.currency_id, + "display_currency": website.currency_id }'/> </span> </label> @@ -498,8 +498,8 @@ <span t-if="value_id.price_extra"> <t t-esc="value_id.price_extra > 0 and '+' or ''"/><span t-field="value_id.price_extra" style="white-space: nowrap;" t-field-options='{ "widget": "monetary", - "from_currency": "product.currency_id", - "display_currency": "website.currency_id" + "from_currency": product.currency_id, + "display_currency": website.currency_id }'/> </span> </option> @@ -518,8 +518,8 @@ <span class="badge" t-if="value_id.price_extra"> <t t-esc="value_id.price_extra > 0 and '+' or ''"/><span t-field="value_id.price_extra" style="white-space: nowrap;" t-field-options='{ "widget": "monetary", - "from_currency": "product.currency_id", - "display_currency": "website.currency_id" + "from_currency": product.currency_id, + "display_currency": website.currency_id }'/> </span> </label> @@ -793,12 +793,12 @@ <del t-attf-class="text-danger #{'' if line.product_id.lst_price > line.discounted_price else 'hidden'}" style="text-decoration: line-through; white-space: nowrap;" t-field="line.product_id.lst_price" t-field-options='{ "widget": "monetary", - "from_currency": "line.company_id.currency_id", - "display_currency": "website.currency_id" + "from_currency": line.company_id.currency_id, + "display_currency": website.currency_id }'/> <span t-field="line.discounted_price" style="white-space: nowrap;" t-field-options='{ "widget": "monetary", - "display_currency": "website.currency_id" + "display_currency": website.currency_id }'/> </td> </tr> @@ -914,13 +914,13 @@ <del class="text-danger mr8" style="white-space: nowrap;" t-field="product.lst_price" t-field-options='{ "widget": "monetary", - "from_currency": "product.currency_id", - "display_currency": "website.currency_id" + "from_currency": product.currency_id, + "display_currency": website.currency_id }'/> </t> <span t-field="product.price" style="white-space: nowrap;" t-field-options='{ "widget": "monetary", - "display_currency": "website.currency_id" + "display_currency": website.currency_id }'/> </td> <td class="text-center"> @@ -1169,8 +1169,8 @@ <td class="text-center"> <span t-field="line.price_unit" style="white-space: nowrap;" t-field-options='{ "widget": "monetary", - "from_currency": "website_sale_order.pricelist_id.currency_id", - "display_currency": "website.currency_id" + "from_currency": website_sale_order.pricelist_id.currency_id, + "display_currency": website.currency_id }'/> </td> </tr> @@ -1310,13 +1310,13 @@ <td> <strong class="text-right"> <div t-field="line.price_unit" - t-field-options='{"widget": "monetary", "display_currency": "order.pricelist_id.currency_id"}'/> + t-field-options='{"widget": "monetary", "display_currency": order.pricelist_id.currency_id}'/> </strong> </td> <td> <div class="text-right" t-field="line.price_subtotal" - t-field-options='{"widget": "monetary", "display_currency": "order.pricelist_id.currency_id"}'/> + t-field-options='{"widget": "monetary", "display_currency": order.pricelist_id.currency_id}'/> </td> </tr> <tr> @@ -1324,7 +1324,7 @@ <td class="text-right"><strong>Total:</strong></td> <td class="text-right"> <strong t-field="order.amount_total" - t-field-options='{"widget": "monetary", "display_currency": "order.pricelist_id.currency_id"}'/> + t-field-options='{"widget": "monetary", "display_currency": order.pricelist_id.currency_id}'/> </td> </tr> </tbody> @@ -1341,7 +1341,7 @@ <td class="text-right" width="100"><strong>Total:</strong></td> <td class="text-right" width="100"> <strong t-field="order.amount_total" - t-field-options='{"widget": "monetary", "display_currency": "order.pricelist_id.currency_id"}'/> + t-field-options='{"widget": "monetary", "display_currency": order.pricelist_id.currency_id}'/> </td> </tr> </tbody> @@ -1410,8 +1410,8 @@ <span class="col-xs-6 text-left text-muted"> <span t-field="website_sale_order.amount_untaxed" style="white-space: nowrap;" t-field-options='{ "widget": "monetary", - "from_currency": "website_sale_order.pricelist_id.currency_id", - "display_currency": "website.currency_id" + "from_currency": website_sale_order.pricelist_id.currency_id, + "display_currency": website.currency_id }'/> </span> </div> @@ -1420,8 +1420,8 @@ <span class="col-xs-6 text-left text-muted"> <span t-field="website_sale_order.amount_tax" style="white-space: nowrap;" t-field-options='{ "widget": "monetary", - "from_currency": "website_sale_order.pricelist_id.currency_id", - "display_currency": "website.currency_id" + "from_currency": website_sale_order.pricelist_id.currency_id, + "display_currency": website.currency_id }'/> </span> </div> @@ -1430,8 +1430,8 @@ <span class="col-xs-6 text-left h4" style="white-space: nowrap;"> <span t-field="website_sale_order.amount_total" style="white-space: nowrap;" t-field-options='{ "widget": "monetary", - "from_currency": "website_sale_order.pricelist_id.currency_id", - "display_currency": "website.currency_id" + "from_currency": website_sale_order.pricelist_id.currency_id, + "display_currency": website.currency_id }'/> </span> </div> diff --git a/addons/website_sale_delivery/views/website_sale_delivery.xml b/addons/website_sale_delivery/views/website_sale_delivery.xml index 8beffca2b70..90d9e2665cc 100644 --- a/addons/website_sale_delivery/views/website_sale_delivery.xml +++ b/addons/website_sale_delivery/views/website_sale_delivery.xml @@ -9,8 +9,8 @@ <span class="col-xs-6 text-left text-muted"> <span t-field="website_sale_order.amount_delivery" style="white-space: nowrap;" t-field-options='{ "widget": "monetary", - "from_currency": "website_sale_order.currency_id", - "display_currency": "user_id.partner_id.property_product_pricelist.currency_id" + "from_currency": website_sale_order.currency_id, + "display_currency": user_id.partner_id.property_product_pricelist.currency_id }'/> </span> </div> @@ -38,8 +38,8 @@ <span class="badge" t-field="delivery.price" t-field-options='{ "widget": "monetary", - "from_currency": "delivery.product_id.company_id.currency_id", - "display_currency": "website_sale_order.currency_id" + "from_currency": delivery.product_id.company_id.currency_id, + "display_currency": website_sale_order.currency_id }'/> <div t-field="delivery.website_description" class="text-muted"/> </label> diff --git a/addons/website_sale_options/views/templates.xml b/addons/website_sale_options/views/templates.xml index cf262d3abfb..b36e1eb7cb9 100644 --- a/addons/website_sale_options/views/templates.xml +++ b/addons/website_sale_options/views/templates.xml @@ -59,15 +59,15 @@ t-field="product.lst_price" t-field-options='{ "widget": "monetary", - "from_currency": "product.currency_id", - "display_currency": "website.currency_id" + "from_currency": product.currency_id, + "display_currency": website.currency_id }'/> <span class="oe_price" style="white-space: nowrap;" t-att-data-product-id="product.id" t-field="product.price" t-field-options='{ "widget": "monetary", - "display_currency": "website.currency_id" + "display_currency": website.currency_id }'/> </td> <td> @@ -106,14 +106,14 @@ t-field="product.lst_price" t-field-options='{ "widget": "monetary", - "from_currency": "product.currency_id", - "display_currency": "website.currency_id" + "from_currency": product.currency_id, + "display_currency": website.currency_id }'/><br/> <span class="oe_price" style="white-space: nowrap;" t-field="product.price" t-field-options='{ "widget": "monetary", - "display_currency": "website.currency_id" + "display_currency": website.currency_id }'/> <p class="css_not_available_msg bg-danger" style="position:absolute; padding: 15px;">Product not available</p> </td> |
