customize invoice.odt

197 views
Skip to first unread message

Gunnar Thielebein

unread,
Dec 3, 2009, 7:30:58 PM12/3/09
to Tryton
I am just have the time to dive a little bit deeper into tryton.
That'swhy I started with a hopefully small task - customize of the
invoice.odt.
What I tried was to remove the taxes field if there are no taxes
entries.
I put above the taxes fields a condition:

<if test="len(invoice.taxes)>0">

Together it now looks like this:

<if test="len(invoice.taxes)>0">
Tax
Base
Amount
<for each="tax in invoice.taxes">
<'[' + unicode(tax.sequence_number) + ']'> <tax.description or ''>
<formatLang(tax.base, invoice.party.lang,
currency=invoice.currency)>
<formatLang(tax.amount, invoice.party.lang,
currency=invoice.currency)>
</for>
</if>

But this does not work. It shows no records also if the list returned
has more than one entry.
If I put the if statement within a single line output this works
correctly:

<if test="len(invoice.taxes)>0">
Invoices Taxes count: <len(invoice.taxes)>
</if>

Gunnar Thielebein

unread,
Dec 4, 2009, 7:29:28 AM12/4/09
to Tryton
Have found a new issue with this statement in invoice, wondering why
date was not printed.

<if test="invoice.invoice_date">
Date: <formatLang(invoice.invoice_date, invoice.party.lang,
date=True)>
</if>

The invoice is only printed when removing the if block.

This all happens under system spec:

Ubuntu/Karmic (amd64)

python-genshi-0.5.1-1build1
python-relatorio-0.5.1-1
ii tryton-client
1.4.1-1 Tryton Application Platform
(Client)
ii tryton-modules-account
1.4.1-1 Tryton Application Platform
(Financial and Accounting Module)
ii tryton-modules-account-de-skr03
1.4.0+20091104.112219 Tryton Application Platform
(Financial and Accounting Module for G
ii tryton-modules-account-invoice
1.4.1-1 Tryton Application Platform
(Financial and Accounting Module)
ii tryton-modules-account-invoice-history
1.4.0+20091104.112219 Tryton Application Platform
(Financial and Accounting Module)
ii tryton-modules-account-product
1.4.0+20091104.112219 Tryton Application Platform
(Financial and Accounting Module)
ii tryton-modules-account-statement
1.4.1-1 Tryton Application Platform
(Financial and Accounting Module)
ii tryton-modules-company
1.4.1-1 Tryton Application Platform
(Company Module)
ii tryton-modules-country
1.4.0+20091104.112220 Tryton Application Platform
(Country Module)
ii tryton-modules-currency
1.4.0+20091104.112220 Tryton Application Platform
(Currency Module)
ii tryton-modules-party
1.4.1-1 Tryton Application Platform
(Party Module)
ii tryton-modules-product
1.4.0+20091104.112220 Tryton Application Platform
(Product Module)
ii tryton-modules-sale
1.4.1-1 Tryton Application Platform
(Sale Module)
ii tryton-modules-stock
1.4.1-1 Tryton Application Platform
(Stock Module)
ii tryton-server
1.4.2-1 Tryton Application Platform
(Server)

Cédric Krier

unread,
Dec 4, 2009, 9:56:51 AM12/4/09
to try...@googlegroups.com
On 03/12/09 16:30 -0800, Gunnar Thielebein wrote:
> I am just have the time to dive a little bit deeper into tryton.
> That'swhy I started with a hopefully small task - customize of the
> invoice.odt.
> What I tried was to remove the taxes field if there are no taxes
> entries.
> I put above the taxes fields a condition:
>
> <if test="len(invoice.taxes)>0">
>
> Together it now looks like this:
>
> <if test="len(invoice.taxes)>0">
> Tax
> Base
> Amount
> <for each="tax in invoice.taxes">
> <'[' + unicode(tax.sequence_number) + ']'> <tax.description or ''>
> <formatLang(tax.base, invoice.party.lang,
> currency=invoice.currency)>
> <formatLang(tax.amount, invoice.party.lang,
> currency=invoice.currency)>
> </for>
> </if>
>
> But this does not work. It shows no records also if the list returned
> has more than one entry.

I try it and it works. You must be careful about where you put the if
statement.


--
Cédric Krier

B2CK SPRL
Rue de Rotterdam, 4
4000 Liège
Belgium
Tel: +32 472 54 46 59
Email: cedric...@b2ck.com
Jabber: cedric...@b2ck.com
Website: http://www.b2ck.com/
twitter: http://twitter.com/cedrickrier
identi.ca: http://identi.ca/cedrickrier

Cédric Krier

unread,
Dec 4, 2009, 9:57:29 AM12/4/09
to try...@googlegroups.com
On 04/12/09 04:29 -0800, Gunnar Thielebein wrote:
> Have found a new issue with this statement in invoice, wondering why
> date was not printed.
>
> <if test="invoice.invoice_date">
> Date: <formatLang(invoice.invoice_date, invoice.party.lang,
> date=True)>
> </if>
>
> The invoice is only printed when removing the if block.

Please use the bug tracker.
http://bugs.tryton.org/

Reply all
Reply to author
Forward
0 new messages