diff --git a/htdocs/bom/class/bom.class.php b/htdocs/bom/class/bom.class.php index 0c1e887dd17..606693bbed6 100644 --- a/htdocs/bom/class/bom.class.php +++ b/htdocs/bom/class/bom.class.php @@ -44,7 +44,7 @@ class BOM extends CommonObject /** * @var int Does bom support multicompany module ? 0=No test on entity, 1=Test with field entity, 2=Test with link by societe */ - public $ismultientitymanaged = 0; + public $ismultientitymanaged = 1; /** * @var int Does bom support extrafields ? 0=No, 1=Yes @@ -57,6 +57,9 @@ class BOM extends CommonObject public $picto = 'bom'; + public $table_element_line = 'bom_bomline'; + + /** * 'type' if the field format. * 'label' the translation key. @@ -587,7 +590,8 @@ class BOM extends CommonObject */ public function initAsSpecimen() { - $this->initAsSpecimenCommon(); + $this->initAsSpecimenCommon(); + $this->date = $this->date_creation; } diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php index e0b852f32d8..f6232fd9394 100644 --- a/htdocs/core/class/commonobject.class.php +++ b/htdocs/core/class/commonobject.class.php @@ -7455,9 +7455,18 @@ abstract class CommonObject */ public function initAsSpecimenCommon() { - $this->id = 0; + global $user; - // TODO... + $this->id = 0; + if (array_key_exists('label', $this->fields)) $this->label='This is label'; + if (array_key_exists('note_public', $this->fields)) $this->note_public='Public note'; + if (array_key_exists('note_private', $this->fields)) $this->note_private='Private note'; + if (array_key_exists('date_creation', $this->fields)) $this->date_creation=(dol_now()-3600*24); + if (array_key_exists('date_modification', $this->fields)) $this->date_modification=(dol_now()-3600*24); + if (array_key_exists('fk_user_creat', $this->fields)) $this->fk_user_creat=$user->id; + if (array_key_exists('fk_user_modif', $this->fields)) $this->fk_user_modif=$user->id; + if (array_key_exists('date', $this->fields)) $this->date=dol_now(); + // ... }