[FIX] account, l10n_ar, l10n_cl: web_studio broken due to dynamic view call

Issue

	- Install "Accounting" & "Studio" modules
	- Go to "Accounting" and switch studio editor
	- Go to "Reports" tab and select "Invoices" report
	- Click on any block to edit.

	Not possible to edit document.

Cause

	Studio cannot parse dynamic `t-call` and therefore not able
	to render the corrects hooks to edit the report.
	The issue has been introduced by this commit: https://github.com/odoo/odoo/commit/5c5710ae8ea045569fd94504f9d8dd5209f7b662

Solution

	In the corresponding localization report template,
	add an 'Inheritance Specs' (position="after") that will add a condition
	where it will retrieve the rigth report name
	in case localization enabled.

opw-2362257

closes odoo/odoo#60660

X-original-commit: ee1580a85c9942e9a98748fa568f9f664c67a320
Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
Signed-off-by: bon-odoo <nboulif@users.noreply.github.com>
This commit is contained in:
Nasreddin (bon)
2020-10-23 17:20:09 +00:00
committed by Nicolas Martinelli
parent 1738273e4a
commit 17bee9e723
3 changed files with 35 additions and 2 deletions
+4 -2
View File
@@ -213,7 +213,8 @@
<t t-call="web.html_container">
<t t-foreach="docs" t-as="o">
<t t-set="lang" t-value="o.invoice_user_id.sudo().lang if o.move_type in ('in_invoice', 'in_refund') else o.partner_id.lang"/>
<t t-call="#{ o._get_name_invoice_report() }" t-lang="lang"/>
<t t-if="o._get_name_invoice_report() == 'account.report_invoice_document'"
t-call="account.report_invoice_document" t-lang="lang"/>
</t>
</t>
</template>
@@ -223,7 +224,8 @@
<t t-foreach="docs" t-as="o">
<t t-set="lang" t-value="o.invoice_user_id.sudo().lang if o.move_type in ('in_invoice', 'in_refund') else o.partner_id.lang"/>
<t t-set="print_with_payments" t-value="True"/>
<t t-call="#{ o._get_name_invoice_report() }" t-lang="lang"/>
<t t-if="o._get_name_invoice_report() == 'account.report_invoice_document'"
t-call="account.report_invoice_document" t-lang="lang"/>
</t>
</t>
</template>
+15
View File
@@ -244,4 +244,19 @@
</xpath>
</template>
<!-- FIXME: Temp fix to allow fetching invoice_documemt in Studio Reports with localisation -->
<template id="report_invoice" inherit_id="account.report_invoice">
<xpath expr='//t[@t-call="account.report_invoice_document"]' position="after">
<t t-if="o._get_name_invoice_report() == 'l10n_ar.report_invoice_document'"
t-call="l10n_ar.report_invoice_document" t-lang="lang"/>
</xpath>
</template>
<template id="report_invoice_with_payments" inherit_id="account.report_invoice_with_payments">
<xpath expr='//t[@t-call="account.report_invoice_document"]' position="after">
<t t-if="o._get_name_invoice_report() == 'l10n_ar.report_invoice_document'"
t-call="l10n_ar.report_invoice_document" t-lang="lang"/>
</xpath>
</template>
</odoo>
+16
View File
@@ -201,4 +201,20 @@
</template>
<!-- FIXME: Temp fix to allow fetching invoice_documemt in Studio Reports with localisation -->
<template id="report_invoice" inherit_id="account.report_invoice">
<xpath expr='//t[@t-call="account.report_invoice_document"]' position="after">
<t t-if="o._get_name_invoice_report() == 'l10n_cl.report_invoice_document'"
t-call="l10n_cl.report_invoice_document" t-lang="lang"/>
</xpath>
</template>
<template id="report_invoice_with_payments" inherit_id="account.report_invoice_with_payments">
<xpath expr='//t[@t-call="account.report_invoice_document"]' position="after">
<t t-if="o._get_name_invoice_report() == 'l10n_cl.report_invoice_document'"
t-call="l10n_cl.report_invoice_document" t-lang="lang"/>
</xpath>
</template>
</odoo>