# ODT Templates and Array of object attributes

**URL:** <https://www.dolibarr.org/forum/t/odt-templates-and-array-of-object-attributes/24777>\
**Category:** Developing for Dolibarr\
**Created:** [January 4, 2024, 12:36pm UTC](https://www.dolibarr.org/forum/t/odt-templates-and-array-of-object-attributes/24777 "2024-01-04T12:36:20Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![muhannedzo](https://www.dolibarr.org/forum/user_avatar/www.dolibarr.org/muhannedzo/32/6563_2.png) [@muhannedzo](https://www.dolibarr.org/forum/u/muhannedzo)\
**Post date:** [January 4, 2024, 12:36pm UTC](https://www.dolibarr.org/forum/t/odt-templates-and-array-of-object-attributes/24777/1 "2024-01-04T12:36:20Z")

</div>

Hello all!  
I have two questions please:  
1- I’m creating a new ODT template for the project module. My question here is when i create this ODT i want it to be converted to pdf. How can i do it?  
2- I want to add a new attribute to the project module. But, this new attribute is an array of objects from another module. How can i add it as list of objects?  
Thanks in advance

---

<div class="post-metadata">

**Author:** ![ksar](https://www.dolibarr.org/forum/user_avatar/www.dolibarr.org/ksar/32/514_2.png) [@ksar](https://www.dolibarr.org/forum/u/ksar)\
**Post date:** [January 4, 2024, 1:54pm UTC](https://www.dolibarr.org/forum/t/odt-templates-and-array-of-object-attributes/24777/2 "2024-01-04T13:54:15Z")

</div>

Hello,

> [@muhannedzo](#):
>
> 1- I’m creating a new ODT template for the project module. My question here is when i create this ODT i want it to be converted to pdf. How can i do it?

Not simple, you need to install OpenOffice on the server where Dolibarr is installed. Depending on where it’s installed, it could be not possible.  
search for it : [SOLVED: ODT to PDF](https://www.dolibarr.org/forum/t/solved-odt-to-pdf/16931)

> [@muhannedzo](#):
>
> 2- I want to add a new attribute to the project module. But, this new attribute is an array of objects from another module. How can i add it as list of objects?

You need to be a bit more explicit.

---

<div class="post-metadata">

**Author:** ![muhannedzo](https://www.dolibarr.org/forum/user_avatar/www.dolibarr.org/muhannedzo/32/6563_2.png) [@muhannedzo](https://www.dolibarr.org/forum/u/muhannedzo)\
**Post date:** [January 4, 2024, 2:03pm UTC](https://www.dolibarr.org/forum/t/odt-templates-and-array-of-object-attributes/24777/3 "2024-01-04T14:03:19Z")

</div>

For question number 2:  
I have a new module called “Store” module and I want inside the “project” module to add a new selector to choose multiple Stores for this project. So i want to add an extra attribute to the project module covering and following the previous workflow.

---

<div class="post-metadata">

**Author:** ![muhannedzo](https://www.dolibarr.org/forum/user_avatar/www.dolibarr.org/muhannedzo/32/6563_2.png) [@muhannedzo](https://www.dolibarr.org/forum/u/muhannedzo)\
**Post date:** [January 9, 2024, 8:10am UTC](https://www.dolibarr.org/forum/t/odt-templates-and-array-of-object-attributes/24777/4 "2024-01-09T08:10:05Z")

</div>

@ksar any kind of help in this issue? The second one which is creating a new attribute on Project module and this attribute should be contain multiple rowid of another module. The point that i want to create the selector of the Stores automatically in the project creation page.

---

<div class="post-metadata">

**Author:** ![ksar](https://www.dolibarr.org/forum/user_avatar/www.dolibarr.org/ksar/32/514_2.png) [@ksar](https://www.dolibarr.org/forum/u/ksar)\
**Post date:** [January 9, 2024, 8:12am UTC](https://www.dolibarr.org/forum/t/odt-templates-and-array-of-object-attributes/24777/5 "2024-01-09T08:12:59Z")

</div>

Hello,

Sorry, but has explained above, if you are not able to provide details, I can’t help.

My crystal ball is broken…

---

<div class="post-metadata">

**Author:** ![muhannedzo](https://www.dolibarr.org/forum/user_avatar/www.dolibarr.org/muhannedzo/32/6563_2.png) [@muhannedzo](https://www.dolibarr.org/forum/u/muhannedzo)\
**Post date:** [January 9, 2024, 8:21am UTC](https://www.dolibarr.org/forum/t/odt-templates-and-array-of-object-attributes/24777/6 "2024-01-09T08:21:20Z")

</div>

Sorry, I thought that I explained a little bit more. Anyway, I will explain now:  
I created a new module called “Stores” module. and already in the system there is “Project” module. So now when i create a new Project I want to assign it to many Stores directly and i want this to be done through Selector of multiple values. So, in my mind that i can add a new attribute to the Project module on its setting page in “Home → Setup → Modules/Application → Projects or leads → setup → complementary attributes (projects)” but here when i want to create the new attribute i don’t know how to add it as a multiple “link to an object”.  
I hope that i could explain it.

---

<div class="post-metadata">

**Author:** ![ksar](https://www.dolibarr.org/forum/user_avatar/www.dolibarr.org/ksar/32/514_2.png) [@ksar](https://www.dolibarr.org/forum/u/ksar)\
**Post date:** [January 9, 2024, 9:02am UTC](https://www.dolibarr.org/forum/t/odt-templates-and-array-of-object-attributes/24777/7 "2024-01-09T09:02:14Z")

</div>

Hello,

Sorry but it’s not enough, how your new module called “Store” has the list ?  
Database ? Then use  
 ![image](https://www.dolibarr.org/forum/uploads/dolibarrorg/original/2X/e/e6017aa8afca9969e55a9759eb9497e200cbd749.png)

> List of values comes from a table  
> Syntax: table\_name:label\_field:id\_field::filtersql  
> Example: c\_typent:libelle:id::filtersql
> 
> - id\_field is necessarly a primary int key
> - filtersql is a SQL condition. It can be a simple test (eg active=1) to display only active value  
> You can also use $ID$ in filter which is the current id of current object  
> To use a SELECT into the filter use the keyword $SEL$ to bypass anti-injection protection.  
> if you want to filter on extrafields use syntax extra.fieldcode=… (where field code is the code of extrafield)
> 
> In order to have the list depending on another complementary attribute list:  
> c\_typent:libelle:id:options\__parent\_list\_code_|parent\_column:filter
> 
> In order to have the list depending on another list:  
> c\_typent:libelle:id:_parent\_list\_code_|parent\_column:filter  
> Class ? THen use  
> ![image](https://www.dolibarr.org/forum/uploads/dolibarrorg/original/2X/a/a5be21b32a271f5018cd4457f1af92395df5a063.png)

> Parameters must be ObjectName:Classpath  
> Syntax: ObjectName:Classpath
> 
> Examples:  
> Societe:societe/class/societe.class.php  
> Contact:contact/class/contact.class.php  
> Product:product/class/product.class.php  
> Project:projet/class/project.class.php

But remember that I don’t know how you have built your module “Stores”…

---

<div class="post-metadata">

**Author:** ![muhannedzo](https://www.dolibarr.org/forum/user_avatar/www.dolibarr.org/muhannedzo/32/6563_2.png) [@muhannedzo](https://www.dolibarr.org/forum/u/muhannedzo)\
**Post date:** [January 12, 2024, 8:23am UTC](https://www.dolibarr.org/forum/t/odt-templates-and-array-of-object-attributes/24777/8 "2024-01-12T08:23:30Z")

</div>

![Screenshot 2024-01-12 121722](https://www.dolibarr.org/forum/uploads/dolibarrorg/original/2X/f/f15c382ed424623ddf78633af17ce80b42c9dd64.png)  
 ![Screenshot 2024-01-12 121808](https://www.dolibarr.org/forum/uploads/dolibarrorg/original/2X/b/b47b094392600aec7e1dcb0d56c475acd09d5fbb.png)

@ksar This what i meant. I added the new Stores selector field but the point here that in the creation of the Project the selector of Stores is added successfully but also i need to filter the Stores list according to the chosen Thirdparty. So in the new attribute ypu can see that i added fk\_soc=515 which needs to be replaced with the right value of the chosen Thirdparty. Do you have any idea?

---

<div class="post-metadata">

**Author:** ![muhannedzo](https://www.dolibarr.org/forum/user_avatar/www.dolibarr.org/muhannedzo/32/6563_2.png) [@muhannedzo](https://www.dolibarr.org/forum/u/muhannedzo)\
**Post date:** [January 16, 2024, 8:03am UTC](https://www.dolibarr.org/forum/t/odt-templates-and-array-of-object-attributes/24777/9 "2024-01-16T08:03:00Z")

</div>

Hello @ksar ! About the last issue i sent, in the documentation, they said that i can use $ID$ but i want to use Thirdparty so i tried to use it like this: $Thirdparty$ but i didn’t work and it says:  
Error in request SELECT rowid as rowid, b\_number FROM llx\_stores\_branch WHERE fk\_soc=$thirdparty$ Unknown column ‘$thirdparty$’ in ‘where clause’. Check setup of extra parameters.  
Do you have any experience with this?
