← Back to team overview

openerp-expert-localization team mailing list archive

Re: Change invoice template in a localization package

 

Hi, your solution works like a charm, thanks!
--
Rgds,
Marek Stopka
Senior IT Consultant (at) Perlur

www.perlur.cz                             website
+420 608 149 955                     mobile
marek.stopka@xxxxxxxxx            e-mail



---------- Forwarded message ----------
From: Ronald Portier <rportier@xxxxxxxx>
Date: 2013/3/19
Subject: Re: [Openerp-expert-localization] Change invoice template in
a localization package
To: Marek Stopka <marek.stopka@xxxxxxxxx>


Hello Marek,

You have to create your own  module, with your own rml file in it.

Then have an xml file with a report tag to override the invoice report
with your own rml.

You have to specify the path to the rml file including your module name.

You can not change everything from the report tag. For instance if you
also want to recreate an
invoice each time you print, you have to specify a record for model
ir.actions.report.xml.

We ALWAYS do this, otherwise users will edit their invoices and see no
effect at all, because the old invoice gets reprinted over and again.

Below contents of a possible xml file in your module:

<openerp>
    <data>
        <!-- Ignore standard invoice, and replace it with your own layout.
        -->
        <report
            id="account.account_invoices"
            model="account.invoice"
            name="account.invoice"
            string="Invoices"
            rml="your_module/report/jma_account_invoice.rml" />

        <!--  If you also want a new pdf, each time you use print button
        -->
        <record
            id="account.account_invoices"
            model="ir.actions.report.xml">
            <field
                name="attachment_use"
                eval="False" />
        </record>
    </data>
</openerp>

Kind regards,

Ronald Portier, Therp BV

Op 19-03-13 08:50, Marek Stopka schreef:
> Hello, I am working on a Czech localization package and legal
> requirements for invoice in Czech republic are quite strict and
> OpenERP invoice template is not compliant with them. How can I define
> a new report type for invoice in OpenERP l10n_cs package and replace
> the original one from account package so that all printed invoices in
> OpenERP will be compliant?
>
> Thanks
> --
> Rgds,
> Marek Stopka
> Senior IT Consultant (at) Perlur
>
> www.perlur.cz                             website
> +420 608 149 955                     mobile
> marek.stopka@xxxxxxxxx            e-mail
>
> _______________________________________________
> Mailing list: https://launchpad.net/~openerp-expert-localization
> Post to     : openerp-expert-localization@xxxxxxxxxxxxxxxxxxx
> Unsubscribe : https://launchpad.net/~openerp-expert-localization
> More help   : https://help.launchpad.net/ListHelp


References