Fix: Bad default value for finished property
This commit is contained in:
parent
32244743d2
commit
d9f5151c39
@ -225,7 +225,6 @@ class Product extends CommonObject
|
||||
|
||||
if (empty($this->status)) $this->status = 0;
|
||||
if (empty($this->status_buy)) $this->status_buy = 0;
|
||||
if (empty($this->finished)) $this->finished = 0;
|
||||
|
||||
$price_ht=0;
|
||||
$price_ttc=0;
|
||||
@ -315,7 +314,7 @@ class Product extends CommonObject
|
||||
$sql.= ", ".$this->status;
|
||||
$sql.= ", ".$this->status_buy;
|
||||
$sql.= ", '".$this->canvas."'";
|
||||
$sql.= ", ".$this->finished;
|
||||
$sql.= ", ".((! isset($this->finished) || $this->finished < 0)?'null':$this->finished);
|
||||
$sql.= ")";
|
||||
|
||||
dol_syslog(get_class($this)."::Create sql=".$sql);
|
||||
@ -446,7 +445,6 @@ class Product extends CommonObject
|
||||
if (empty($this->localtax1_tx)) $this->localtax1_tx = 0;
|
||||
if (empty($this->localtax2_tx)) $this->localtax2_tx = 0;
|
||||
|
||||
if (empty($this->finished)) $this->finished = 0;
|
||||
if (empty($this->country_id)) $this->country_id = 0;
|
||||
|
||||
$this->accountancy_code_buy = trim($this->accountancy_code_buy);
|
||||
@ -464,7 +462,7 @@ class Product extends CommonObject
|
||||
|
||||
$sql.= ",tosell = " . $this->status;
|
||||
$sql.= ",tobuy = " . $this->status_buy;
|
||||
$sql.= ",finished = " . ($this->finished<0 ? "null" : $this->finished);
|
||||
$sql.= ",finished = " . ((! isset($this->finished) || $this->finished < 0) ? "null" : $this->finished);
|
||||
$sql.= ",weight = " . ($this->weight!='' ? "'".$this->weight."'" : 'null');
|
||||
$sql.= ",weight_units = " . ($this->weight_units!='' ? "'".$this->weight_units."'": 'null');
|
||||
$sql.= ",length = " . ($this->length!='' ? "'".$this->length."'" : 'null');
|
||||
|
||||
@ -312,7 +312,6 @@ if (empty($reshook))
|
||||
$object->ref = GETPOST('clone_ref');
|
||||
$object->status = 0;
|
||||
$object->status_buy = 0;
|
||||
$object->finished = 1;
|
||||
$object->id = null;
|
||||
|
||||
if ($object->check())
|
||||
|
||||
Loading…
Reference in New Issue
Block a user