Merge branch '11.0' of git@github.com:Dolibarr/dolibarr.git into 12.0
This commit is contained in:
commit
ecfdb4bbac
@ -7963,18 +7963,17 @@ abstract class CommonObject
|
||||
$now = dol_now();
|
||||
|
||||
$fieldvalues = $this->setSaveQuery();
|
||||
|
||||
if (array_key_exists('date_creation', $fieldvalues) && empty($fieldvalues['date_creation'])) $fieldvalues['date_creation'] = $this->db->idate($now);
|
||||
if (array_key_exists('fk_user_creat', $fieldvalues) && !($fieldvalues['fk_user_creat'] > 0)) $fieldvalues['fk_user_creat'] = $user->id;
|
||||
unset($fieldvalues['rowid']); // The field 'rowid' is reserved field name for autoincrement field so we don't need it into insert.
|
||||
if (array_key_exists('ref', $fieldvalues)) $fieldvalues['ref'] = dol_string_nospecial($fieldvalues['ref']); // If field is a ref, we sanitize data
|
||||
|
||||
$keys = array();
|
||||
$values = array();
|
||||
$values = array(); // Array to store string forged for SQL syntax
|
||||
foreach ($fieldvalues as $k => $v) {
|
||||
$keys[$k] = $k;
|
||||
$value = $this->fields[$k];
|
||||
$values[$k] = $this->quote($v, $value);
|
||||
$values[$k] = $this->quote($v, $value); // May return string 'NULL' if $value is null
|
||||
}
|
||||
|
||||
// Clean and check mandatory
|
||||
@ -7984,8 +7983,7 @@ abstract class CommonObject
|
||||
if (preg_match('/^integer:/i', $this->fields[$key]['type']) && $values[$key] == '-1') $values[$key] = '';
|
||||
if (!empty($this->fields[$key]['foreignkey']) && $values[$key] == '-1') $values[$key] = '';
|
||||
|
||||
//var_dump($key.'-'.$values[$key].'-'.($this->fields[$key]['notnull'] == 1));
|
||||
if (isset($this->fields[$key]['notnull']) && $this->fields[$key]['notnull'] == 1 && !isset($values[$key]) && is_null($this->fields[$key]['default']))
|
||||
if (isset($this->fields[$key]['notnull']) && $this->fields[$key]['notnull'] == 1 && (!isset($values[$key]) || $values[$key] === 'NULL') && is_null($this->fields[$key]['default']))
|
||||
{
|
||||
$error++;
|
||||
$this->errors[] = $langs->trans("ErrorFieldRequired", $this->fields[$key]['label']);
|
||||
|
||||
@ -234,12 +234,14 @@ function print_eldy_menu($db, $atarget, $type_user, &$tabMenu, &$menu, $noout =
|
||||
!empty($conf->ficheinter->enabled)
|
||||
) ? 1 : 0,
|
||||
'perms'=>(!empty($user->rights->propal->lire) ||
|
||||
!empty($user->rights->commande->lire) ||
|
||||
!empty($user->rights->fournisseur->lire) ||
|
||||
!empty($user->rights->supplier_proposal->lire) ||
|
||||
!empty($user->rights->supplier_order->lire) ||
|
||||
!empty($user->rights->contrat->lire) ||
|
||||
!empty($user->rights->ficheinter->lire)
|
||||
!empty($user->rights->commande->lire) ||
|
||||
!empty($user->rights->fournisseur->lire) ||
|
||||
!empty($user->rights->supplier_proposal->lire) ||
|
||||
!empty($user->rights->supplier_order->lire) ||
|
||||
!empty($user->rights->contrat->lire) ||
|
||||
!empty($user->rights->ficheinter->lire) ||
|
||||
!empty($user->rights->supplier_order->lire) ||
|
||||
!empty($user->rights->fournisseur->commande->lire)
|
||||
),
|
||||
'module'=>'propal|commande|supplier_proposal|supplier_order|contrat|ficheinter'
|
||||
);
|
||||
|
||||
@ -98,7 +98,7 @@ ALTER TABLE llx_bom_bomline ADD COLUMN position integer NOT NULL DEFAULT 0;
|
||||
ALTER TABLE llx_bom_bomline ADD COLUMN qty_frozen smallint DEFAULT 0;
|
||||
ALTER TABLE llx_bom_bomline ADD COLUMN disable_stock_change smallint DEFAULT 0;
|
||||
|
||||
ALTER TABLE llx_bom_bomline DROP COLUMN rank;
|
||||
ALTER TABLE llx_bom_bomline DROP COLUMN `rank`;
|
||||
|
||||
create table llx_categorie_warehouse
|
||||
(
|
||||
|
||||
Loading…
Reference in New Issue
Block a user