# Create new report (invoice) odt

**URL:** <https://discuss.tryton.org/t/create-new-report-invoice-odt/2633>\
**Category:** User\
**Created:** [April 25, 2020, 8:18am UTC](https://discuss.tryton.org/t/create-new-report-invoice-odt/2633 "2020-04-25T08:18:02Z")\
**Posts on this page:** 17\
**Page:** 1

<div class="post-metadata">

**Author:** ![herrdeh](https://discuss-cdn.tryton.org/user_avatar/discuss.tryton.org/herrdeh/32/821_2.png) [@herrdeh](https://discuss.tryton.org/u/herrdeh)\
**Post date:** [April 25, 2020, 8:18am UTC](https://discuss.tryton.org/t/create-new-report-invoice-odt/2633/1 "2020-04-25T08:18:02Z")

</div>

I’m trying to create a custom invoice template for my company, I need various types. Under  
`Administration > UI > Actions > Reports` I downloaded “invoice.odt”, did some changes, created a new report and applied keywords as in the original.

 ![Bildschirmfoto von 2020-04-25 10-15-27](https://discuss-cdn.tryton.org/uploads/default/original/1X/212ac480b1572b3ac53a31c3c0c05ed6d8da6e74.png)

But now, when trying to create a customer invoice, the new template does not show up as a choice. The above form lacks the “path” box - is that the problem, and how can I resolve it?

Cheers,  
Wolf

---

<div class="post-metadata">

**Author:** ![ioanp](https://discuss-cdn.tryton.org/user_avatar/discuss.tryton.org/ioanp/32/782_2.png) [@ioanp](https://discuss.tryton.org/u/ioanp)\
**Post date:** [April 25, 2020, 10:12am UTC](https://discuss.tryton.org/t/create-new-report-invoice-odt/2633/2 "2020-04-25T10:12:01Z")

</div>

Hello @herrdeh

Look Invoice Report [here](https://hg.tryton.org/modules/account_invoice/file/tip/invoice.xml) and override this .

---

<div class="post-metadata">

**Author:** ![herrdeh](https://discuss-cdn.tryton.org/user_avatar/discuss.tryton.org/herrdeh/32/821_2.png) [@herrdeh](https://discuss.tryton.org/u/herrdeh)\
**Post date:** [April 25, 2020, 10:15am UTC](https://discuss.tryton.org/t/create-new-report-invoice-odt/2633/3 "2020-04-25T10:15:01Z")

</div>

Hi, thanks for your quick answer. Sorry, I don’t understand a word. Could you be more dummie-compatible, please ? (-;

---

<div class="post-metadata">

**Author:** ![ced](https://discuss-cdn.tryton.org/user_avatar/discuss.tryton.org/ced/32/1237_2.png) [@ced](https://discuss.tryton.org/u/ced)\
**Post date:** [April 25, 2020, 10:17am UTC](https://discuss.tryton.org/t/create-new-report-invoice-odt/2633/4 "2020-04-25T10:17:01Z")

</div>

You must not duplicate the report record but just upload the modified template on the current report record. Tryton will store the custom version and use it instead of the standard.  
This is the proper way when customizing from the user interface.

---

<div class="post-metadata">

**Author:** ![herrdeh](https://discuss-cdn.tryton.org/user_avatar/discuss.tryton.org/herrdeh/32/821_2.png) [@herrdeh](https://discuss.tryton.org/u/herrdeh)\
**Post date:** [April 25, 2020, 10:19am UTC](https://discuss.tryton.org/t/create-new-report-invoice-odt/2633/5 "2020-04-25T10:19:14Z")

</div>

@ ced  
Well, I understood that. But actually I’d like to have differently looking templates - one for company customers, one for private customers. How can I achieve that?

---

<div class="post-metadata">

**Author:** ![ioanp](https://discuss-cdn.tryton.org/user_avatar/discuss.tryton.org/ioanp/32/782_2.png) [@ioanp](https://discuss.tryton.org/u/ioanp)\
**Post date:** [April 25, 2020, 10:19am UTC](https://discuss.tryton.org/t/create-new-report-invoice-odt/2633/6 "2020-04-25T10:19:16Z")

</div>

read …  
[https://tryton-documentation.readthedocs.io/en/latest/developer\_guide/basic\_concepts.html](https://tryton-documentation.readthedocs.io/en/latest/developer_guide/basic_concepts.html)

> **[Extending View — Tryton server](https://docs.tryton.org/latest/server/topics/views/extension.html)**

---

<div class="post-metadata">

**Author:** ![ced](https://discuss-cdn.tryton.org/user_avatar/discuss.tryton.org/ced/32/1237_2.png) [@ced](https://discuss.tryton.org/u/ced)\
**Post date:** [April 25, 2020, 10:21am UTC](https://discuss.tryton.org/t/create-new-report-invoice-odt/2633/7 "2020-04-25T10:21:13Z")

</div>

Inside the same template, you can put both layouts inside two big [`<choose/>`](https://genshi.edgewall.org/wiki/Documentation/xml-templates.html#id2).

---

<div class="post-metadata">

**Author:** ![herrdeh](https://discuss-cdn.tryton.org/user_avatar/discuss.tryton.org/herrdeh/32/821_2.png) [@herrdeh](https://discuss.tryton.org/u/herrdeh)\
**Post date:** [April 25, 2020, 10:22am UTC](https://discuss.tryton.org/t/create-new-report-invoice-odt/2633/8 "2020-04-25T10:22:09Z")

</div>

Ah great,m I’ll try.

---

<div class="post-metadata">

**Author:** ![herrdeh](https://discuss-cdn.tryton.org/user_avatar/discuss.tryton.org/herrdeh/32/821_2.png) [@herrdeh](https://discuss.tryton.org/u/herrdeh)\
**Post date:** [April 25, 2020, 10:53am UTC](https://discuss.tryton.org/t/create-new-report-invoice-odt/2633/9 "2020-04-25T10:53:53Z")

</div>

Sorry, it’s me again. Please be dummy- and noob-proof. 🙄

- How can I upload a fodt file in the UI?
- How can I determine where a layout starts and ends?

Please excuse my noobishness…

---

<div class="post-metadata">

**Author:** ![ced](https://discuss-cdn.tryton.org/user_avatar/discuss.tryton.org/ced/32/1237_2.png) [@ced](https://discuss.tryton.org/u/ced)\
**Post date:** [April 25, 2020, 11:00am UTC](https://discuss.tryton.org/t/create-new-report-invoice-odt/2633/10 "2020-04-25T11:00:45Z")

</div>

> [@herrdeh](#):
>
> How can I upload a fodt file in the UI?

By using the _select_ button on the data field (you have to remove content first), see

 ![image](https://discuss-cdn.tryton.org/uploads/default/original/1X/307a04953a31323adffa83a5d23f47b641062354.png)

> [@herrdeh](#):
>
> How can I determine where a layout starts and ends?

I’m not sure to understand the question.  
But I guess your layout will look like (pseudo-code):

```auto
<choose>
<when test="invoice.party.is_company">
layout company
</when>
<otherwise test="">
other layout
</otherwise>
</choose>

```

---

<div class="post-metadata">

**Author:** ![herrdeh](https://discuss-cdn.tryton.org/user_avatar/discuss.tryton.org/herrdeh/32/821_2.png) [@herrdeh](https://discuss.tryton.org/u/herrdeh)\
**Post date:** [June 2, 2020, 2:02pm UTC](https://discuss.tryton.org/t/create-new-report-invoice-odt/2633/11 "2020-06-02T14:02:06Z")

</div>

Yet another question around this topic:  
How can i test my fodt drafts without creating a “real” invoice every time? - I guess I’ll need something like \>100 attempts till I get what I want.

---

<div class="post-metadata">

**Author:** ![pokoli](https://discuss-cdn.tryton.org/user_avatar/discuss.tryton.org/pokoli/32/22_2.png) [@pokoli](https://discuss.tryton.org/u/pokoli)\
**Post date:** [June 2, 2020, 2:15pm UTC](https://discuss.tryton.org/t/create-new-report-invoice-odt/2633/12 "2020-06-02T14:15:24Z")

</div>

> [@herrdeh](#):
>
> How can i test my fodt drafts without creating a “real” invoice every time? - I guess I’ll need something like \>100 attempts till I get what I want.

You can print a draft invoice before posting it. Every print version will use the current template value, so if you update it you will see on the draft invoice.

Once the invoice is posted a copy of the invoice is stored on the database, so you must clear this copy in order to regenerate it.

---

<div class="post-metadata">

**Author:** ![herrdeh](https://discuss-cdn.tryton.org/user_avatar/discuss.tryton.org/herrdeh/32/821_2.png) [@herrdeh](https://discuss.tryton.org/u/herrdeh)\
**Post date:** [June 2, 2020, 2:17pm UTC](https://discuss.tryton.org/t/create-new-report-invoice-odt/2633/13 "2020-06-02T14:17:45Z")

</div>

Tks a lot, Master Pokoli.  
So I tried the right thing, but always got this error message:

```
Traceback (most recent call last):
  File "/usr/local/lib/python37/dist-packages/trytond/wsgipy", line 108, in dispatch_request
    return endpoint(request, **requestview_args)
  File "/usr/local/lib/python37/dist-packages/trytond/protocols/dispatcherpy", line 48, in rpc
    request, database_name, *requestrpc_params)
  File "/usr/local/lib/python37/dist-packages/trytond/wsgipy", line 76, in auth_required
    return wrapped(*args, **kwargs)
  File "/usr/local/lib/python37/dist-packages/trytond/protocols/wrapperspy", line 131, in wrapper
    return func(request, pool, *args, **kwargs)
  File "/usr/local/lib/python37/dist-packages/trytond/protocols/dispatcherpy", line 186, in _dispatch
    result = rpcresult(meth(*c_args, **c_kwargs))
  File "/usr/local/lib/python37/dist-packages/trytond/modules/account_invoice/invoicepy", line 2518, in execute
    result = super(InvoiceReport, cls)execute(ids, data)
  File "/usr/local/lib/python37/dist-packages/trytond/report/reportpy", line 195, in execute
    oext, content = cls_execute(records, data, action_report)
  File "/usr/local/lib/python37/dist-packages/trytond/modules/account_invoice/invoicepy", line 2499, in _execute
    result = super(InvoiceReport, cls)_execute(records, data, action)
  File "/usr/local/lib/python37/dist-packages/trytond/report/reportpy", line 203, in _execute
    return clsconvert(action, clsrender(action, report_context))
  File "/usr/local/lib/python37/dist-packages/trytond/report/reportpy", line 302, in render
    data = rel_report(**report_context)render()
  File "/usr/local/lib/python37/dist-packages/relatorio/reportingpy", line 121, in __call__
    template = selftmpl_loaderload(selffpath, selfmimetype)
  File "/usr/local/lib/python37/dist-packages/relatorio/reportingpy", line 81, in load
    path, cls=cls, relative_to=relative_to)
  File "/genshi/template/loaderpy", line 236, in load
    filename, encoding=encoding)
  File "/genshi/template/loaderpy", line 274, in _instantiate
    allow_exec=selfallow_exec)
  File "/usr/local/lib/python37/dist-packages/relatorio/templates/opendocumentpy", line 267, in __init__
    encoding, lookup, allow_exec)
  File "/genshi/template/markuppy", line 67, in __init__
    allow_exec=allow_exec)
  File "/genshi/template/basepy", line 418, in __init__
    self_stream = self_parse(source, encoding)
  File "/usr/local/lib/python37/dist-packages/relatorio/templates/opendocumentpy", line 294, in _parse
    styles = template_parse(selfinsert_directives(styles), encoding)
  File "/usr/local/lib/python37/dist-packages/relatorio/templates/opendocumentpy", line 347, in insert_directives
    self_handle_relatorio_tags(tree)
  File "/usr/local/lib/python37/dist-packages/relatorio/templates/opendocumentpy", line 459, in _handle_relatorio_tags
    r_statements, closing_tags = self_relatorio_statements(tree)
  File "/usr/local/lib/python37/dist-packages/relatorio/templates/opendocumentpy", line 434, in _relatorio_statements
    assert not opened_tags
AssertionError

Fault:

```

---

<div class="post-metadata">

**Author:** ![pokoli](https://discuss-cdn.tryton.org/user_avatar/discuss.tryton.org/pokoli/32/22_2.png) [@pokoli](https://discuss.tryton.org/u/pokoli)\
**Post date:** [June 2, 2020, 2:18pm UTC](https://discuss.tryton.org/t/create-new-report-invoice-odt/2633/14 "2020-06-02T14:18:32Z")

</div>

> [@herrdeh](#):
>
> assert not opened\_tags  
> AssertionError

This means that there is an error on your template file.  
Normally this is because there is an opened tag (if, for, choose) which does not have it’s corresponding closing tag (/if, /for, /choose)

---

<div class="post-metadata">

**Author:** ![herrdeh](https://discuss-cdn.tryton.org/user_avatar/discuss.tryton.org/herrdeh/32/821_2.png) [@herrdeh](https://discuss.tryton.org/u/herrdeh)\
**Post date:** [June 2, 2020, 3:25pm UTC](https://discuss.tryton.org/t/create-new-report-invoice-odt/2633/15 "2020-06-02T15:25:31Z")

</div>

Allright. Got it.  
Cheers for your patience!

---

<div class="post-metadata">

**Author:** ![ced](https://discuss-cdn.tryton.org/user_avatar/discuss.tryton.org/ced/32/1237_2.png) [@ced](https://discuss.tryton.org/u/ced)\
**Post date:** [November 9, 2022, 3:48pm UTC](https://discuss.tryton.org/t/create-new-report-invoice-odt/2633/16 "2022-11-09T15:48:06Z")

</div>

Split this topic on November 9, 2022, 3:48pm UTC

A post was split to a new topic: [How to adapt report based on party being memeber of a category](https://discuss.tryton.org/t/how-to-adapt-report-based-on-party-being-memeber-of-a-category/5693)

---

<div class="post-metadata">

**Author:** ![system](https://discuss-cdn.tryton.org/uploads/default/original/1X/c6f8ec0a40525cdcd50058c734283450a4b3d38b.png) [@system](https://discuss.tryton.org/u/system)\
**Post date:** [December 9, 2022, 3:48pm UTC](https://discuss.tryton.org/t/create-new-report-invoice-odt/2633/17 "2022-12-09T15:48:48Z")

</div>

Closed on December 9, 2022, 3:48pm UTC

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.
