Fix missing columns

This commit is contained in:
Laurent Destailleur 2021-05-12 08:53:29 +02:00
parent 4da5aeedf4
commit 3ea6cd1c66
4 changed files with 12 additions and 5 deletions

View File

@ -403,6 +403,8 @@ UPDATE llx_propal SET date_signature = date_cloture WHERE date_signature IS NULL
ALTER TABLE llx_product ADD COLUMN batch_mask VARCHAR(32) NULL;
ALTER TABLE llx_product ADD COLUMN lifetime INTEGER NULL;
ALTER TABLE llx_product ADD COLUMN qc_frequency INTEGER NULL;
insert into llx_c_type_contact(rowid, element, source, code, libelle, active ) values (210, 'conferenceorbooth', 'internal', 'MANAGER', 'Conference or Booth manager', 1);
insert into llx_c_type_contact(rowid, element, source, code, libelle, active ) values (211, 'conferenceorbooth', 'external', 'SPEAKER', 'Conference Speaker', 1);

View File

@ -94,6 +94,8 @@ create table llx_product
fk_default_warehouse integer DEFAULT NULL,
canvas varchar(32) DEFAULT NULL,
finished tinyint DEFAULT NULL, -- see dictionnary c_product_nature
lifetime integer DEFAULT NULL,
qc_frequency integer DEFAULT NULL,
hidden tinyint DEFAULT 0, -- Not used. Deprecated.
import_key varchar(14), -- Import key
model_pdf varchar(255), -- model save dodument used

View File

@ -609,7 +609,7 @@ if ($object->id > 0) {
print '</tr>';
}
// Request to show lines of inventory (prefilled during creation)
// Request to show lines of inventory (prefilled after start/validate step)
$sql = 'SELECT id.rowid, id.datec as date_creation, id.tms as date_modification, id.fk_inventory, id.fk_warehouse,';
$sql .= ' id.fk_product, id.batch, id.qty_stock, id.qty_view, id.qty_regulated';
$sql .= ' FROM '.MAIN_DB_PREFIX.'inventorydet as id';
@ -641,8 +641,8 @@ if ($object->id > 0) {
$product_static = $cacheOfProducts[$obj->fk_product];
} else {
$product_static = new Product($db);
$product_static->fetch($obj->fk_product);
$result = $product_static->fetch($obj->fk_product, '', '', '', 1, 1, 1);
var_dump($result);
$option = 'nobatch';
$option .= ',novirtual';
$product_static->load_stock($option); // Load stock_reel + stock_warehouse. This can also call load_virtual_stock()

View File

@ -141,8 +141,11 @@ class PdfDocTest extends PHPUnit\Framework\TestCase
$db=$this->savdb;
$localproduct=new Product($this->savdb);
$localproduct->fetch(0, 'PIDRESS');
$product_id=$localproduct->id;
$result = $localproduct->fetch(0, 'PIDRESS');
if ($result < 0) {
print "\n".__METHOD__." Failed to make the fetch of product PIDRESS. ".$localproduct->error; die(1);
}
$product_id = $localproduct->id;
if ($product_id <= 0) {
print "\n".__METHOD__." A product with ref PIDRESS must exists into database"; die(1);
}