Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[12.0/master] wishlist: ability to edit report header and footer with Odoo Studio #28070

Closed
Yenthe666 opened this issue Oct 23, 2018 · 9 comments
Assignees

Comments

@Yenthe666
Copy link
Collaborator

Impacted versions: 12.0 / master

Steps to reproduce:

  1. Go to sales > quotations, open studio, click on, click on reports and choose the quotation.
  2. Try to edit the header or the footer now, it is impossible

Current behavior: An enduser is not able to edit the report header and footer, two very important parts on a report. The only way to edit the report header and footer now is by finding the right report from the four templates and by opening the right one under settings > views.

<template id="external_layout_background">
<div class="header">
<div class="o_background_header">
<div class="float-right">
<h3 class="mt0 text-right" t-field="company.report_header"/>
</div>
<img t-if="company.logo" t-att-src="image_data_uri(company.logo)" class="float-left" alt="Logo"/>
<div class="float-left company_address">
<div>
<strong t-field="company.partner_id.name"/>
</div>
<span t-field="company.partner_id"
t-options='{"widget": "contact", "fields": ["address"], "no_marker": true}'/>
</div>
<div class="clearfix mb8"/>
</div>
</div>
<div class="article o_report_layout_background" t-att-data-oe-model="o and o._name" t-att-data-oe-id="o and o.id">
<t t-call="web.address_layout"/>
<t t-raw="0"/>
</div>
<div class="footer o_background_footer">
<div class="text-center">
<ul class="list-inline">
<li t-if="company.phone" class="list-inline-item"><i class="fa fa-phone" role="img" aria-label="Phone" title="Phone"/> <span t-field="company.phone"/></li>
<li t-if="company.email" class="list-inline-item"><i class="fa fa-at" role="img" aria-label="Email" title="Email"/> <span t-field="company.email"/></li>
<li t-if="company.website" class="list-inline-item"><i class="fa fa-globe" role="img" aria-label="Website" title="Website"/> <span t-field="company.website"/></li>
<li t-if="company.vat" class="list-inline-item"><i class="fa fa-building-o" role="img" aria-label="Fiscal number"/><t t-esc="company.country_id.vat_label or 'Tax ID'"/>: <span t-field="company.vat"/></li>
</ul>
<div t-field="company.report_footer"/>
<div t-if="report_type == 'pdf'" class="text-muted">
Page:
<span class="page"/>
of
<span class="topage"/>
</div>
</div>
</div>
</template>
<template id="external_layout_boxed">
<div class="header">
<div class="o_boxed_header">
<div class="row mb8">
<div class="col-6">
<img t-if="company.logo" t-att-src="image_data_uri(company.logo)" alt="Logo"/>
</div>
<div class="col-6 text-right mb4">
<h4 class="mt0" t-field="company.report_header"/>
<div name="company_address" class="mb4">
<span class="company_address" t-field="company.partner_id"
t-options='{"widget": "contact", "fields": ["address", "name"], "no_marker": true}'/>
</div>
</div>
</div>
</div>
</div>
<div class="article o_report_layout_boxed" t-att-data-oe-model="o and o._name" t-att-data-oe-id="o and o.id">
<t t-call="web.address_layout"/>
<t t-raw="0"/>
</div>
<div class="footer o_boxed_footer">
<div class="text-center">
<ul class="list-inline">
<li t-if="company.phone" class="list-inline-item">Tel: <span t-field="company.phone"/></li>
<li t-if="company.email" class="list-inline-item">Mail: <span t-field="company.email"/></li>
<li t-if="company.website" class="list-inline-item">Web: <span t-field="company.website"/></li>
<li t-if="company.vat" class="list-inline-item"><t t-esc="company.country_id.vat_label or 'Tax ID'"/>: <span t-field="company.vat"/></li>
</ul>
<div t-field="company.report_footer"/>
<div t-if="report_type == 'pdf'">
Page: <span class="page"/> / <span class="topage"/>
</div>
</div>
</div>
</template>
<template id="external_layout_clean">
<div class="header">
<div class="o_clean_header">
<div class="row">
<div class="col-6">
<img t-if="company.logo" t-att-src="image_data_uri(company.logo)" alt="Logo"/>
</div>
<div class="col-5 offset-1" name="company_address">
<ul class="list-unstyled">
<strong><li t-if="company.name"><span t-field="company.name"/></li></strong>
<li t-if="company.vat"><t t-esc="company.country_id.vat_label or 'Tax ID'"/>: <span t-field="company.vat"/></li>
<li t-if="company.phone">Tel: <span t-field="company.phone"/></li>
<li t-if="company.email"><span t-field="company.email"/></li>
<li t-if="company.website"><span t-field="company.website"/></li>
</ul>
</div>
</div>
</div>
</div>
<div class="article o_report_layout_clean" t-att-data-oe-model="o and o._name" t-att-data-oe-id="o and o.id">
<t t-call="web.address_layout"/>
<t t-raw="0"/>
</div>
<div class="footer o_clean_footer">
<div class="row mt8">
<div class="col-3">
<span t-field="company.report_footer"/>
</div>
<div class="col-4 text-right">
<span class="company_address" t-field="company.partner_id"
t-options='{"widget": "contact", "fields": ["address"], "no_marker": true}'/>
</div>
<div class="col-4">
<h4 class="mt0 mb0 text-uppercase" t-field="company.report_header"/>
</div>
<div class="col-1">
<ul t-if="report_type != 'html'" class="list-inline pagenumber float-right text-center">
<li class="list-inline-item"><strong><span class="page"/></strong></li>
</ul>
</div>
</div>
</div>
</template>
<template id="external_layout_standard">
<div class="header">
<div class="row">
<div class="col-3 mb4">
<img t-if="company.logo" t-att-src="image_data_uri(company.logo)" style="max-height: 45px;" alt="Logo"/>
</div>
<div class="col-9 text-right" style="margin-top:22px;" t-field="company.report_header" name="moto"/>
</div>
<div t-if="company.logo or company.report_header" class="row zero_min_height">
<div class="col-12">
<div style="border-bottom: 1px solid black;"/>
</div>
</div>
<div class="row">
<div class="col-6" name="company_address">
<div t-field="company.partner_id"
t-options='{"widget": "contact", "fields": ["address", "name"], "no_marker": true}'
/>
</div>
</div>
</div>
<div class="article o_report_layout_standard" t-att-data-oe-model="o and o._name" t-att-data-oe-id="o and o.id">
<t t-call="web.address_layout"/>
<t t-raw="0"/>
</div>
<div class="footer o_standard_footer">
<div class="text-center" style="border-top: 1px solid black;">
<ul class="list-inline mb4">
<li t-if="company.phone" class="list-inline-item">Phone: <span t-field="company.phone"/></li>
<li t-if="company.email" class="list-inline-item">Email: <span t-field="company.email"/></li>
<li t-if="company.website" class="list-inline-item">Web: <span t-field="company.website"/></li>
<li t-if="company.vat" class="list-inline-item"><t t-esc="company.country_id.vat_label or 'Tax ID'"/>: <span t-field="company.vat"/></li>
</ul>
<div name="financial_infos">
<span t-field="company.report_footer"/>
</div>
<div t-if="report_type == 'pdf'" class="text-muted">
Page: <span class="page"/> / <span class="topage"/>
</div>
</div>
</div>
</template>

This means:

  • User needs advanced rights on settings
  • User needs good knowledge of how the reporting engine works
  • User needs technical knowledge to modify/code XML.

Expected behavior: Ability to modify the report header and footer with Odoo studio too.

@Yenthe666
Copy link
Collaborator Author

@ged-odoo, @aab-odoo and @mge-odoo I'd love to discuss this one with you guys. I assume there is a technical reason why this is not in place yet? Perhaps because it is another QWeb view that is being rendered in another Qweb view which is rendered in the FormView?

We already have people asking how they can edit their own header/footer with Studio and I assume the number of people asking this will go up. Are there any plans to add this in and if so, would that be V13 or? I'd like to hear something from the team that made this as I'm curious. 👍

@mgeubelle
Copy link
Contributor

Hi @Yenthe666

There were both functional and technical reasons for not to allow the user to edit the header/footer.

About the functional, we didn't want the user to think "I'm customizing this report" while in fact, when customizing the header/footer, he was actually modifying all reports using the template.

About the technical, in the external layout, the layout templates are called with a dynamic t-call (see https://github.com/odoo/odoo/blob/12.0/addons/web/views/report_templates.xml#L357 ) which makes the parsing of t-call more difficult (see https://github.com/odoo/enterprise/blob/12.0/web_studio/controllers/report.py#L146 ).

We thus decided to let these templates non editable.

We however wanted to do something special for the header/footer in 12.0, in a functional point of view. Like a special screen for header/footer customization. We didn't find a good way to do it back then but the task is still there and needs to be specified so probably for master.

I have shared your feedback with the Studio PO to help him specify this.

@mgeubelle mgeubelle self-assigned this Oct 24, 2018
@Yenthe666
Copy link
Collaborator Author

Hi @mge-odoo,

Thanks a lot for the feedback and the valuable insights!
Two options I can think of to solve the functional part:

  • A button to open studio from the settings > views menu with a domain set so it is hidden for all other views.
  • A new menuitem with a domain that filters out those header/footer views and the ability to open the Studio editor from there.

Regards,
Yenthe

@farazbdm
Copy link

farazbdm commented Jul 4, 2020

@Yenthe666 was this possibility made available later to be able to modify header footer using studio ?

@Yenthe666
Copy link
Collaborator Author

@farazda1 no, it is not yet implemented.

@juchheim-gmbh
Copy link

This would be really a nice feature and is really expected behauvior.

@timdri01
Copy link

@Yenthe666 Any word if this has been implemented yet in 15?

@Yenthe666
Copy link
Collaborator Author

Nope, still exactly the same as in V12 I'm afraid :(

@timdri01
Copy link

timdri01 commented Apr 4, 2022

Looking at 15 enterprise and it does offer some basic ability to modify the header and footer.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants