Hi Maxime,
Thanks for this quick answer !
unfortunately the following code is present in 9.0 but not in develop in
extrafields.class.php :
// If field is a computed field, value must become result of
compute
if ($computed)
{
// Make the eval of compute string
//var_dump($computed);
$value = dol_eval($computed, 1, 0);
}
i do not understand why !
also, why this method is in two classes ? (extrafields and commonobject)
not very easy to maintain, isnt'it ?
Best regards
Christophe
Le 11/07/2019 à 10:57, Maxime Kohlhaas a écrit :
Hi Christophe,
On my side I tested with a simple formula :
image.png
And on the product card and in the product list I have this field
calculated.
Test done in 9.0
Bien cordialement,
--
*Maxime Kohlhaas* | Consultant associé
------------------------------------------------------------------------------------
Tél : 06 33 42 92 43
Le jeu. 11 juil. 2019 à 10:52, Christophe Battarel
<christophe.batta...@altairis.fr
<mailto:christophe.batta...@altairis.fr>> a écrit :
Hello,
I am trying to use computed values in extrafields but cannot
understand how it works :
example : $object->id in a product extrafield !
i have done some investigations in the code and here is where i am :
there is two places where ShowOutputField is coded :
commonobject.class.php (where the dol_eval is called) and
extrafields.class.php (used in product card to display extrafields
but not calling dol_eval !).
doeas anyone (@eldy ?) can help me ? (i am on the develop branch).
Best regards
Christophe
_______________________________________________
Dolibarr-dev mailing list
Dolibarr-dev@nongnu.org <mailto:Dolibarr-dev@nongnu.org>
https://lists.nongnu.org/mailman/listinfo/dolibarr-dev
<https://www.atm-consulting.fr>
_______________________________________________
Dolibarr-dev mailing list
Dolibarr-dev@nongnu.org
https://lists.nongnu.org/mailman/listinfo/dolibarr-dev
_______________________________________________
Dolibarr-dev mailing list
Dolibarr-dev@nongnu.org
https://lists.nongnu.org/mailman/listinfo/dolibarr-dev