ExtraFields Computed

Hi,

I am having the extra field called cost_price in the shipment lines. I am looking to get the average cost (pmp) field of the Product.

I am not sure how to get this one - what will be the syntax for the Computed field. I tried with $product->pmp (and few other combinations) - but it is always returning 0.

Can some one help me in getting the correct syntax for this one.

https://wiki.dolibarr.org/index.php/Extrafields

Hello,

On a line computed filed, you can’t have access to the product object.
You need to go through custom module.

1 Like

Can you give me an example?