How to create template .ods for Tryton report?

304 views
Skip to first unread message

oscar_alvarez

unread,
Sep 19, 2012, 7:48:00 PM9/19/12
to tryto...@googlegroups.com

Hi, boys

I am trying to create a .ods template file for a report in Tryton, but it doesn't work, I think that my tryton code is fine, because I can to generate empty file (opened in Libreoffice Calc) without objects, but when I put in it the placeholders/fields for the objects inside of the template file .ods with hyperlink option, tryton show protocol error.

In Writer LO, we use menu Insert >> Fields, but in Calc doesn't exits it?

Oscar Alvarez Montero
Colombia

Nicolas Évrard

unread,
Sep 20, 2012, 6:48:32 AM9/20/12
to tryto...@googlegroups.com
* oscar_alvarez [2012-09-20 01:48 +0200]:
You can also use the alternate syntax that uses the "Insert >
Hyperlink" system:

http://relatorio.openhex.org/wiki/IndepthIntroduction

Has an example (and a link to an ods file).

--
Nicolas Évrard

B2CK SPRL
rue de Rotterdam, 4
4000 Liège
Belgium
Tel: +32 472 54 46 59
E-mail/Jabber: nicolas...@b2ck.com
Website: http://www.b2ck.com/
signature.asc

Oscar Alvarez

unread,
Sep 26, 2012, 7:30:32 PM9/26/12
to tryto...@googlegroups.com
El 20/09/12 05:48, Nicolas Évrard escribió:
> * oscar_alvarez [2012-09-20 01:48 +0200]:
>> I am trying to create a .ods template file for a report in Tryton,
>> but it
>> doesn't work, I think that my tryton code is fine, because I can to
>> generate empty file (opened in Libreoffice Calc) without objects, but
>> when
>> I put in it the placeholders/fields for the objects inside of the
>> template
>> file .ods with hyperlink option, tryton show protocol error.
>>
>> In Writer LO, we use menu Insert >> Fields, but in Calc doesn't exits
>> it?
>
> You can also use the alternate syntax that uses the "Insert >
> Hyperlink" system:
>
> http://relatorio.openhex.org/wiki/IndepthIntroduction
>
> Has an example (and a link to an ods file).
>

Thanks, Solved it!

Oscar Alvarez
Colombia

zodman

unread,
Sep 26, 2012, 7:46:56 PM9/26/12
to tryto...@googlegroups.com
> --
> tryto...@googlegroups.com mailing list

@oscar can you share the code ?

Oscar Alvarez

unread,
Sep 27, 2012, 8:02:25 AM9/27/12
to tryto...@googlegroups.com
El 26/09/12 18:46, zodman escribió:
Of course,

First you must to create spreadsheet blank file (example named "letter.ods") and put in company module.
 
so then in setup.py, add "*.ods" extension:


    package_data={
        'trytond.modules.my_module': info.get('xml', []) \
            + info.get('translation', []) \
            + ['*.odt', '*.ods', 'icons/*.svg'],
    },


in xml file:

        <record model="ir.action.report" id="report_my_module">
            <field name="name">My Module Report</field>
            <field name="model">module.my_module</field>
            <field name="report_name">module.my_module_report</field>
            <field name="report">module/report.ods</field>
            <field name="style">company/letter.ods</field>
        </record>


the link for the file example "report.ods":

http://ubuntuone.com/22b4wKLPKQQYubvDXQQ13z


best regards,

Oscar Alvarez Montero


Reply all
Reply to author
Forward
0 new messages