Fix unit test on accounting

This commit is contained in:
Laurent Destailleur 2019-01-20 17:06:24 +01:00
parent 24cb6ecf03
commit f7c11ec7f4
3 changed files with 8 additions and 6 deletions

View File

@ -312,8 +312,8 @@ script:
- |
echo "Upgrading Dolibarr"
# Ensure we catch errors
set +e
# Ensure we catch errors. Set this to +e if you want to go to the end to see log files.
set -e
cd htdocs/install
php upgrade.php 3.5.0 3.6.0 ignoredbversion > $TRAVIS_BUILD_DIR/upgrade350360.log
php upgrade2.php 3.5.0 3.6.0 > $TRAVIS_BUILD_DIR/upgrade350360-2.log

View File

@ -273,11 +273,11 @@ class AccountingAccount extends CommonObject
$sql .= ", " . (empty($this->pcg_type) ? 'NULL' : "'" . $this->db->escape($this->pcg_type) . "'");
$sql .= ", " . (empty($this->pcg_subtype) ? 'NULL' : "'" . $this->db->escape($this->pcg_subtype) . "'");
$sql .= ", " . (empty($this->account_number) ? 'NULL' : "'" . $this->db->escape($this->account_number) . "'");
$sql .= ", " . (empty($this->account_parent) ? '0' : "'" . $this->db->escape($this->account_parent) . "'");
$sql .= ", " . (empty($this->label) ? 'NULL' : "'" . $this->db->escape($this->label) . "'");
$sql .= ", " . (empty($this->account_category) ? 0 : $this->db->escape($this->account_category));
$sql .= ", " . (empty($this->account_parent) ? 0 : (int) $this->db->escape($this->account_parent));
$sql .= ", " . (empty($this->label) ? "''" : "'" . $this->db->escape($this->label) . "'");
$sql .= ", " . (empty($this->account_category) ? 0 : (int) $this->db->escape($this->account_category));
$sql .= ", " . $user->id;
$sql .= ", " . (! isset($this->active) ? 'NULL' : $this->db->escape($this->active));
$sql .= ", " . (empty($this->active) ? 0 : (int) $this->active);
$sql .= ")";
$this->db->begin();

View File

@ -255,3 +255,5 @@ CREATE TABLE llx_pos_cash_fence(
import_key VARCHAR(14)
) ENGINE=innodb;
-- VMYSQL4.3 ALTER TABLE llx_accounting_account MODIFY COLUMN account_number varchar(32) NOT NULL;
-- VPGSQL8.2 ALTER TABLE llx_accounting_account ALTER COLUMN account_number SET NOT NULL;