# "article" with free text

**URL:** https://discuss.tryton.org/t/article-with-free-text/2867
**Category:** User
**Created:** [June 13, 2020, 12:20pm UTC](https://discuss.tryton.org/t/article-with-free-text/2867 "2020-06-13T12:20:26Z")
**Posts on this page:** 8
**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: [June 13, 2020, 12:20pm UTC](https://discuss.tryton.org/t/article-with-free-text/2867/1 "2020-06-13T12:20:26Z")

</div>

Often, I have to bill (or buy) articles which are tailor made and only sold or purchased once. For that reason, I need to use free text to describe it. AFAIK, in the articles field, I cannot type in free text, tryton wants something from the stock. I tried only to type in the description and leave articles blank - that works, the text appears in the invoice. But it does not appear in tryton when dealing with the order, the purchase or whatever. So I may not have found the ideal strategy - what do experts recommend?

---

<div class="post-metadata">

### Author: ![German](https://discuss-cdn.tryton.org/user_avatar/discuss.tryton.org/german/32/143_2.png) [@German](https://discuss.tryton.org/u/German)
#### Post date: [June 13, 2020, 5:21pm UTC](https://discuss.tryton.org/t/article-with-free-text/2867/2 "2020-06-13T17:21:50Z")

</div>

I don’t think it’s a good idea, as I know Tryton makes a good process for accounting ,movements, stock and integrity of the information. Maybe you can create a general purpose product? And change the price directly on invoice ?

---

<div class="post-metadata">

### Author: ![jeromarquez](https://discuss-cdn.tryton.org/user_avatar/discuss.tryton.org/jeromarquez/32/452_2.png) [@jeromarquez](https://discuss.tryton.org/u/jeromarquez)
#### Post date: [June 14, 2020, 1:14am UTC](https://discuss.tryton.org/t/article-with-free-text/2867/3 "2020-06-14T01:14:48Z")

</div>

Also you can show the description of the product instead of the name on the invoice line and change it every time you have to make a movement/purchase/invoice.

---

<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: [March 3, 2022, 12:28pm UTC](https://discuss.tryton.org/t/article-with-free-text/2867/4 "2022-03-03T12:28:50Z")

</div>

As I now have that task in reality, I’m coming back to this.  
In my invoice template, I have the lines

```auto
<if test="line.product">
<line.product.name>
(<line.product.description>)
</if>

```

This works nicely to display product descriptions from articles. It does not work for descriptions manually added in customer invoices. Would I need a further entry in the template?

 ![Bildschirmfoto von 2022-03-03 13-29-33](https://discuss-cdn.tryton.org/uploads/default/original/2X/6/60d4dc5bc4942789dbc2aea37f19ad6e5c1d80d5.png)

Cheers,  
Wolf

---

<div class="post-metadata">

### Author: ![acaubet](https://discuss-cdn.tryton.org/user_avatar/discuss.tryton.org/acaubet/32/1493_2.png) [@acaubet](https://discuss.tryton.org/u/acaubet)
#### Post date: [March 3, 2022, 2:34pm UTC](https://discuss.tryton.org/t/article-with-free-text/2867/5 "2022-03-03T14:34:59Z")

</div>

Yes, you will need to add something like the following:

```auto
<if test="line.product">
<line.product.name>
(<line.product.description>)
</if>
<if test="line.description">
<for each="description in line.description.split('\n')">
<description>
</for>
</if>

```

---

<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: [March 4, 2022, 11:38am UTC](https://discuss.tryton.org/t/article-with-free-text/2867/6 "2022-03-04T11:38:23Z")

</div>

Thank you very much for this valuable advice. Works nicely, but it puts each of the terms in a separate line, a line break is created also in case no entry is present in the 1st or 2nd term.  
I tried

```auto
<if test="line.product">
<line.product.name>
</if><if test="line.product.description">
(<line.product.description>)
</if><if test="line.description">
<for each="description in line.description.split('\n')">
<description></for>
</if>

```

but then I only get the output of `LINE.PRODUCT.NAME`.  
What should I do to avoid line breaks?

---

<div class="post-metadata">

### Author: ![acaubet](https://discuss-cdn.tryton.org/user_avatar/discuss.tryton.org/acaubet/32/1493_2.png) [@acaubet](https://discuss.tryton.org/u/acaubet)
#### Post date: [March 7, 2022, 10:19am UTC](https://discuss.tryton.org/t/article-with-free-text/2867/7 "2022-03-07T10:19:40Z")

</div>

I think you can use empty description like:

```auto
<if test="line.product">
<line.product.name>
(<line.product.description>)
</if>
<for each="description in (line.description o '').split('\n')">
<description>
</for>

```

But it will generte a new line space between `</if> <for`.

> [@herrdeh](#):
>
> `</if><if test="line.product.description">`

This does not work, each statement needs a new line. That’s why may reports use tables to skip rows. You can check default [invoice template for Tryton](https://hg.tryton.org/modules/account_invoice/raw-file/ad69676d7dab/invoice.fodt).

---

<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: [August 4, 2023, 4:45pm UTC](https://discuss.tryton.org/t/article-with-free-text/2867/8 "2023-08-04T16:45:54Z")

</div>

A post was split to a new topic: [Add an article where it does not appear in print anywhere](https://discuss.tryton.org/t/add-an-article-where-it-does-not-appear-in-print-anywhere/6409)
