Add column to Sales Order card

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.

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.


This is how I would like to insert the additional column

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.

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?

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.

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.


Is that possible?

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

Or you need to develop your own module.