Fix bug when entity=null on DB
This commit is contained in:
parent
21df700325
commit
f1d1fdf951
@ -201,6 +201,7 @@ class Productlot extends CommonObject
|
|||||||
*/
|
*/
|
||||||
public function fetch($id = 0, $product_id = 0, $batch = '')
|
public function fetch($id = 0, $product_id = 0, $batch = '')
|
||||||
{
|
{
|
||||||
|
global $conf;
|
||||||
dol_syslog(__METHOD__, LOG_DEBUG);
|
dol_syslog(__METHOD__, LOG_DEBUG);
|
||||||
|
|
||||||
$sql = 'SELECT';
|
$sql = 'SELECT';
|
||||||
@ -233,7 +234,7 @@ class Productlot extends CommonObject
|
|||||||
//$this->ref = $obj->fk_product.'_'.$obj->batch;
|
//$this->ref = $obj->fk_product.'_'.$obj->batch;
|
||||||
|
|
||||||
$this->batch = $obj->batch;
|
$this->batch = $obj->batch;
|
||||||
$this->entity = $obj->entity;
|
$this->entity = (!empty($obj->entity)?$obj->entity:$conf->entity); // Prevent "null" entity
|
||||||
$this->fk_product = $obj->fk_product;
|
$this->fk_product = $obj->fk_product;
|
||||||
$this->eatby = $this->db->jdate($obj->eatby);
|
$this->eatby = $this->db->jdate($obj->eatby);
|
||||||
$this->sellby = $this->db->jdate($obj->sellby);
|
$this->sellby = $this->db->jdate($obj->sellby);
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user