# Add column to Sales Order card

**URL:** <https://www.dolibarr.org/forum/t/add-column-to-sales-order-card/24661>\
**Category:** Maintaining my Dolibarr\
**Created:** [December 8, 2023, 3:24pm UTC](https://www.dolibarr.org/forum/t/add-column-to-sales-order-card/24661 "2023-12-08T15:24:14Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![Passko](https://www.dolibarr.org/forum/letter_avatar_proxy/v4/letter/p/b19c9b/32.png) [@Passko](https://www.dolibarr.org/forum/u/Passko)\
**Post date:** [December 8, 2023, 3:24pm UTC](https://www.dolibarr.org/forum/t/add-column-to-sales-order-card/24661/1 "2023-12-08T15:24:14Z")

</div>

Hello,  
I am using dolibarr 18.0.0

I want to add an additional column in specific table, but I am new to dolibarr and I can not handle it by myself. Any help is much appreciated.

In Products and Services modules setup, I have added Complementary attribute called “location”, which will point the place where each product is stored in my warehouse.

 ![2023-12-07_191527](https://www.dolibarr.org/forum/uploads/dolibarrorg/original/2X/3/3c786f5e7ee0ce9677db9ec80b3e0af7384560c5.png)

I would like to add an additional column, also called “location” in products list table at Sales Orders section.

The idea is, when I open an order card, to have this additional column with Complementary attribute “location” of each product in the table with all purchased products.

Is it possible to implement this column?

If anyone has a solution to a similar problem, I will be very grateful for sharing the solution.

---

<div class="post-metadata">

**Author:** ![Passko](https://www.dolibarr.org/forum/letter_avatar_proxy/v4/letter/p/b19c9b/32.png) [@Passko](https://www.dolibarr.org/forum/u/Passko)\
**Post date:** [December 8, 2023, 3:39pm UTC](https://www.dolibarr.org/forum/t/add-column-to-sales-order-card/24661/2 "2023-12-08T15:39:20Z")

</div>

![2023-12-07_192015](https://www.dolibarr.org/forum/uploads/dolibarrorg/original/2X/9/9ee4366454234c3f4828f3966fbcc21cd384c466.png)  
This is how I would like to insert the additional column

---

<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:** [December 8, 2023, 3:50pm UTC](https://www.dolibarr.org/forum/t/add-column-to-sales-order-card/24661/3 "2023-12-08T15:50:08Z")

</div>

Hello,

I you want to have an extrafiled on Sales Order line, then you should create this extra filed on Sales order module not in product

I encourage you to describe the workflow you want to achieve, in order for us to guide you.

---

<div class="post-metadata">

**Author:** ![Passko](https://www.dolibarr.org/forum/letter_avatar_proxy/v4/letter/p/b19c9b/32.png) [@Passko](https://www.dolibarr.org/forum/u/Passko)\
**Post date:** [December 8, 2023, 4:36pm UTC](https://www.dolibarr.org/forum/t/add-column-to-sales-order-card/24661/4 "2023-12-08T16:36:52Z")

</div>

> [@ksar](#):
>
> I you want to have an extrafiled on Sales Order line, then you should create this extra filed on Sales order module not in product

Hi,  
Thank you for your quick replay.

I will try to explain what I want to achieve.

In the product module I created extrafield, called “location”.  
When I create or edit product, I enter the value of the “location” extrafield.

Then, when I open Sales order card there is a table with products, purchased in that order.  
I want in that table to be visual the “location” of each product.

You suggest to create an extrafield ‘location’ on Sales Order line, but how to call the value of the ‘location’ extrafield already created and stored at product card?

---

<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:** [December 8, 2023, 4:56pm UTC](https://www.dolibarr.org/forum/t/add-column-to-sales-order-card/24661/5 "2023-12-08T16:56:36Z")

</div>

Hello Ok understood.

Then you need to create :

- One extrafield on product called location type “String”
- One extrafiled on Sales Order line, called location (or anything else we don’t care), type : “computed filed”, value :  
`(($reloadedobj = new Product($db)) && ($reloadedobj->fetch($objectoffield->fk_product))) ? $reloadedobj->array_options['options_location'] : 'Not found'`

With that it should work.

---

<div class="post-metadata">

**Author:** ![Passko](https://www.dolibarr.org/forum/letter_avatar_proxy/v4/letter/p/b19c9b/32.png) [@Passko](https://www.dolibarr.org/forum/u/Passko)\
**Post date:** [December 15, 2023, 1:56pm UTC](https://www.dolibarr.org/forum/t/add-column-to-sales-order-card/24661/7 "2023-12-15T13:56:55Z")

</div>

Thank you Ksar!

The value of the product’s extrafield “location” now appears below the product’s name, but it should appear in additional column in the table.

 ![2023-12-08_215734](https://www.dolibarr.org/forum/uploads/dolibarrorg/original/2X/f/f48285ac77d63ea9d3f7178df5472fd94bd34203.png)  
Is that possible?

---

<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:** [December 16, 2023, 9:05pm UTC](https://www.dolibarr.org/forum/t/add-column-to-sales-order-card/24661/8 "2023-12-16T21:05:40Z")

</div>

Hello,

It’s an open source software, so everything is possible !  
For this one, I’m afraid not natively

I know one external module that can do it : [Dolitools](https://www.dolistore.com/en/modules/1199-Dolitools.html)

Or you need to develop your own module.
