Merge pull request #14220 from FHenry/11.0

fix missing entity into fetch wharehouse
This commit is contained in:
Laurent Destailleur 2020-07-18 19:32:24 +02:00 committed by GitHub
commit 384cb22d3a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 1 deletions

View File

@ -104,6 +104,7 @@ class Entrepot extends CommonObject
*/
public $fields=array(
'rowid' =>array('type'=>'integer', 'label'=>'ID', 'enabled'=>1, 'visible'=>0, 'notnull'=>1, 'position'=>10),
'entity' =>array('type'=>'integer', 'label'=>'Entity', 'enabled'=>1, 'visible'=>0, 'default'=>1, 'notnull'=>1, 'index'=>1, 'position'=>15),
'ref' =>array('type'=>'varchar(255)', 'label'=>'Ref', 'enabled'=>1, 'visible'=>1, 'showoncombobox'=>1, 'position'=>25),
'entity' =>array('type'=>'integer', 'label'=>'Entity', 'enabled'=>1, 'visible'=>0, 'notnull'=>1, 'position'=>30),
'description' =>array('type'=>'text', 'label'=>'Description', 'enabled'=>1, 'visible'=>-2, 'position'=>35),
@ -441,6 +442,7 @@ class Entrepot extends CommonObject
}
$sql = "SELECT rowid, fk_parent, ref as label, description, statut, lieu, address, zip, town, fk_pays as country_id";
$sql .= " , entity";
$sql .= " FROM ".MAIN_DB_PREFIX."entrepot";
if ($id)
{
@ -460,6 +462,7 @@ class Entrepot extends CommonObject
$obj=$this->db->fetch_object($result);
$this->id = $obj->rowid;
$this->entity = $obj->entity;
$this->fk_parent = $obj->fk_parent;
$this->ref = $obj->label;
$this->label = $obj->label;

View File

@ -209,7 +209,7 @@ $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."c_country as ccount ON ccount.rowid = t.fk
$sql .= " WHERE t.entity IN (".getEntity('stock').")";
foreach ($search as $key => $val)
{
if ($key == 'status' && $search[$key] == -1) continue;
if (($key == 'status' && $search[$key] == -1) || $key=='entity') continue;
$mode_search = (($object->isInt($object->fields[$key]) || $object->isFloat($object->fields[$key])) ? 1 : 0);
if (strpos($object->fields[$key]['type'], 'integer:') === 0) {
if ($search[$key] == '-1') $search[$key] = '';