diff options
| author | Nasreddin (bon) <bon@odoo.com> | 2020-10-23 11:01:20 +0000 |
|---|---|---|
| committer | Nicolas Martinelli <nim@odoo.com> | 2020-10-23 13:42:12 +0000 |
| commit | ee1580a85c9942e9a98748fa568f9f664c67a320 (patch) | |
| tree | bf0dc1ce970130b2ebcafa6d43ba663fd014fa4b | |
| parent | c51867b785aab707b1059d6545b9fce7e95a2488 (diff) | |
[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#60609
Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
| -rw-r--r-- | addons/account/views/report_invoice.xml | 6 | ||||
| -rw-r--r-- | addons/l10n_ar/views/report_invoice.xml | 15 | ||||
| -rw-r--r-- | addons/l10n_cl/views/report_invoice.xml | 16 |
3 files changed, 35 insertions, 2 deletions
diff --git a/addons/account/views/report_invoice.xml b/addons/account/views/report_invoice.xml index 45f07cef452..f43de9c3dc4 100644 --- a/addons/account/views/report_invoice.xml +++ b/addons/account/views/report_invoice.xml @@ -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> diff --git a/addons/l10n_ar/views/report_invoice.xml b/addons/l10n_ar/views/report_invoice.xml index e8f3897868c..661c7d4c5ce 100644 --- a/addons/l10n_ar/views/report_invoice.xml +++ b/addons/l10n_ar/views/report_invoice.xml @@ -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> diff --git a/addons/l10n_cl/views/report_invoice.xml b/addons/l10n_cl/views/report_invoice.xml index e0dfade0a02..13df416d002 100644 --- a/addons/l10n_cl/views/report_invoice.xml +++ b/addons/l10n_cl/views/report_invoice.xml @@ -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> |
