Webkit Report doesn't support company-specific headers/footers

Bug #1012184 reported by Janis Elmeris
12
This bug affects 2 people
Affects Status Importance Assigned to Milestone
Odoo Addons (MOVED TO GITHUB)
Invalid
Undecided
Unassigned
OpenERP WebKit Report
New
Undecided
Unassigned

Bug Description

I have prepared a special webkit header/footer for a specific company.
Now I attach it to a company in "Settings -> Companies -> Companies -> [open a company] -> Webkit -> Headers".
When I print an invoice, still the global header/footer is used - that which is set in "Settings -> Customisation -> Low Level Objects -> Actions -> Reports -> [open a report] -> Webkit -> Webkit Header".

I'm using OpenERP 6.1 with Webkit Report 6.1.0.9.

In addition, the user interface for attaching headers/footers to companies is confusing. Currently it allows to add several headers/footers to each company, so it's not clear which one of the selected will actually be used (once this bug is fixed). So, maybe something needs to be changed in this regard as well.

Revision history for this message
Nicolas Bessi - Camptocamp (nbessi-c2c-deactivatedaccount) wrote :

You have to add webkit_header attribute in your report xml tag (from 6.1).

In V5/6.0 You can change it in the client in the report action

Please take in account that report webkit is an official addons for version >5.

Regards

Nicolas

Changed in openobject-addons:
status: New → Invalid
Revision history for this message
Janis Elmeris (janis-elmeris) wrote :

> You have to add webkit_header attribute in your report xml tag (from 6.1).

Please, read my report more carefully!

The problem is not in being unable to specify a header for a webkit report.
The problem is to make the header dependant on the company of the invoice.

I can add headers for each company, but it doesn't have any effect on which header will actually be used in the invoice report (which is the header specified for the particular report action).

Revision history for this message
Nicolas Bessi - Camptocamp (nbessi-c2c-deactivatedaccount) wrote : Re: [Bug 1012184] Webkit Report doesn't support company-specific headers/footers

Hello,

On the report header is a property fields.:

        'webkit_header': fields.property(
                                            'ir.header_webkit',
                                            type='many2one',
                                            relation='ir.header_webkit',
                                            string='Webkit Header',
                                            help="The header linked to the report",
                                            view_load=True,
                                            required=True
                                        ),

You have to set it for each company. Different value will be store for each company.
You have to login in each company and set the value.

I fi it does not work the bug is related to property filed.

Regards

Nicolas

Le 13 juin 2012 à 17:52, Janis Elmeris a écrit :

>> You have to add webkit_header attribute in your report xml tag (from
> 6.1).
>
> Please, read my report more carefully!
>
> The problem is not in being unable to specify a header for a webkit report.
> The problem is to make the header dependant on the company of the invoice.
>
> I can add headers for each company, but it doesn't have any effect on
> which header will actually be used in the invoice report (which is the
> header specified for the particular report action).
>
> --
> You received this bug notification because you are subscribed to OpenERP
> Project Group.
> https://bugs.launchpad.net/bugs/1012184
>
> Title:
> Webkit Report doesn't support company-specific headers/footers
>
> Status in OpenERP WebKit Report:
> New
> Status in OpenERP Addons (modules):
> Invalid
>
> Bug description:
> I have prepared a special webkit header/footer for a specific company.
> Now I attach it to a company in "Settings -> Companies -> Companies -> [open a company] -> Webkit -> Headers".
> When I print an invoice, still the global header/footer is used - that which is set in "Settings -> Customisation -> Low Level Objects -> Actions -> Reports -> [open a report] -> Webkit -> Webkit Header".
>
> I'm using OpenERP 6.1 with Webkit Report 6.1.0.9.
>
> In addition, the user interface for attaching headers/footers to
> companies is confusing. Currently it allows to add several
> headers/footers to each company, so it's not clear which one of the
> selected will actually be used (once this bug is fixed). So, maybe
> something needs to be changed in this regard as well.
>
> To manage notifications about this bug go to:
> https://bugs.launchpad.net/openerpwebkitreport/+bug/1012184/+subscriptions

--------------------------------------------------------------------
Nicolas Bessi
Senior ERP consultant
Business Solution technical manager

Camptocamp SA
PSE A
CH-1015 Lausanne
http://openerp.camptocamp.com

Phone: +41 21 619 10 26
Office: +41 21 619 10 10
Fax : +41 21 619 10 00
--------------------------------------------------------------------

Revision history for this message
Janis Elmeris (janis-elmeris) wrote :

Oh, I didn't realize that what's displayed in Settings (which I'm using being the global administrator) is affected by what company I've selected in the preferences.

You're right, I can select a different header for each company by using the company switcher in the preferences.

But, does the headers adding to the company at "Settings -> Companies -> Companies -> [open a company] -> Webkit -> Headers" have any meaning at all then?

Revision history for this message
Janis Elmeris (janis-elmeris) wrote :

OK, actually the header property value doesn't get stored properly.

I was just creating a new report and trying to make all companies to use the same header for it. However, when I set it for one company and then tried to set for another company, the first company got it set back to another header. I reset the header for the first company, and now it got reset to another header for the second company.

When I looked at ir_property table, there were only two webkit_header property values stored even though I have several companies and several reports for which I've tried to set the headers.

If I edit the table and add all the references manually, then the right headers seem to show up in Settings -> Customisation -> Low Level Objects -> Actions -> Reports and also in the actual printed files.

Revision history for this message
Janis Elmeris (janis-elmeris) wrote :

P.S. To the previous comment: it seems as if though each report can have only one property value stored.

Revision history for this message
Francisco Rignanese (frignanese) wrote :

> You have to add webkit_header attribute in your report xml tag (from 6.1).

how do i do that?

I tried it in the .xml file which is outside the report folder, it looks like this:

report_webkit_html_view.xml ---->
<?xml version="1.0" encoding="utf-8"?>
<openerp>
    <data>
        <report auto="False" id="invoice_report" model="account.invoice" name="webkit.invoice" string="Invoice Report" report_type="webkit" file="nt-sale/report/invoice_report_html.mako"/>
    </data>
</openerp>

but i get the following error:
     File "/usr/local/lib/python2.6/dist-packages/openerp-server/tools/convert.py", line 965, in convert_xml_import
    relaxng.assert_(doc)
  File "lxml.etree.pyx", line 2767, in lxml.etree._Validator.assert_ (src/lxml/lxml.etree.c:113500)
AssertionError: Invalid attribute webkit_header for element report, line 7

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.