FIX : new tables loading system
This commit is contained in:
parent
2c840e80fb
commit
5daca35e79
@ -435,7 +435,7 @@ class modStockTransfer extends DolibarrModules
|
|||||||
{
|
{
|
||||||
global $conf, $langs;
|
global $conf, $langs;
|
||||||
|
|
||||||
$result = $this->_load_tables('/stocktransfer/sql/');
|
$result = $this->_load_tables('/install/mysql/tables/', 'stocktransfer');
|
||||||
if ($result < 0) return -1; // Do not activate module if error 'not allowed' returned when loading module SQL queries (the _load_table run sql with run_sql with the error allowed parameter set to 'default')
|
if ($result < 0) return -1; // Do not activate module if error 'not allowed' returned when loading module SQL queries (the _load_table run sql with run_sql with the error allowed parameter set to 'default')
|
||||||
|
|
||||||
// Create extrafields during init
|
// Create extrafields during init
|
||||||
|
|||||||
@ -342,87 +342,3 @@ ALTER TABLE llx_c_partnership_type ADD COLUMN keyword varchar(128);
|
|||||||
ALTER TABLE llx_eventorganization_conferenceorboothattendee ADD COLUMN firstname varchar(100);
|
ALTER TABLE llx_eventorganization_conferenceorboothattendee ADD COLUMN firstname varchar(100);
|
||||||
ALTER TABLE llx_eventorganization_conferenceorboothattendee ADD COLUMN lastname varchar(100);
|
ALTER TABLE llx_eventorganization_conferenceorboothattendee ADD COLUMN lastname varchar(100);
|
||||||
ALTER TABLE llx_eventorganization_conferenceorboothattendee ADD COLUMN email_company varchar(128) after email;
|
ALTER TABLE llx_eventorganization_conferenceorboothattendee ADD COLUMN email_company varchar(128) after email;
|
||||||
|
|
||||||
-- Stock transfers module
|
|
||||||
|
|
||||||
CREATE TABLE llx_stocktransfer_stocktransfer(
|
|
||||||
-- BEGIN MODULEBUILDER FIELDS
|
|
||||||
rowid integer AUTO_INCREMENT PRIMARY KEY NOT NULL,
|
|
||||||
entity integer DEFAULT 1 NOT NULL,
|
|
||||||
ref varchar(128) DEFAULT '(PROV)' NOT NULL,
|
|
||||||
label varchar(255),
|
|
||||||
fk_soc integer,
|
|
||||||
fk_project integer,
|
|
||||||
fk_warehouse_source integer,
|
|
||||||
fk_warehouse_destination integer,
|
|
||||||
description text,
|
|
||||||
note_public text,
|
|
||||||
note_private text,
|
|
||||||
tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
|
|
||||||
date_creation datetime NOT NULL,
|
|
||||||
date_prevue_depart date DEFAULT NULL,
|
|
||||||
date_reelle_depart date DEFAULT NULL,
|
|
||||||
date_prevue_arrivee date DEFAULT NULL,
|
|
||||||
date_reelle_arrivee date DEFAULT NULL,
|
|
||||||
lead_time_for_warning integer DEFAULT NULL,
|
|
||||||
fk_user_creat integer NOT NULL,
|
|
||||||
fk_user_modif integer,
|
|
||||||
import_key varchar(14),
|
|
||||||
model_pdf varchar(255),
|
|
||||||
last_main_doc varchar(255),
|
|
||||||
status smallint NOT NULL,
|
|
||||||
fk_incoterms integer, -- for incoterms
|
|
||||||
location_incoterms varchar(255)
|
|
||||||
-- END MODULEBUILDER FIELDS
|
|
||||||
) ENGINE=innodb;
|
|
||||||
|
|
||||||
ALTER TABLE llx_stocktransfer_stocktransfer ADD INDEX idx_stocktransfer_stocktransfer_rowid (rowid);
|
|
||||||
ALTER TABLE llx_stocktransfer_stocktransfer ADD INDEX idx_stocktransfer_stocktransfer_ref (ref);
|
|
||||||
ALTER TABLE llx_stocktransfer_stocktransfer ADD INDEX idx_stocktransfer_stocktransfer_fk_soc (fk_soc);
|
|
||||||
ALTER TABLE llx_stocktransfer_stocktransfer ADD INDEX idx_stocktransfer_stocktransfer_fk_project (fk_project);
|
|
||||||
ALTER TABLE llx_stocktransfer_stocktransfer ADD CONSTRAINT llx_stocktransfer_stocktransfer_fk_user_creat FOREIGN KEY (fk_user_creat) REFERENCES llx_user(rowid);
|
|
||||||
ALTER TABLE llx_stocktransfer_stocktransfer ADD INDEX idx_stocktransfer_stocktransfer_status (status);
|
|
||||||
|
|
||||||
CREATE TABLE llx_stocktransfer_stocktransferline(
|
|
||||||
-- BEGIN MODULEBUILDER FIELDS
|
|
||||||
rowid integer AUTO_INCREMENT PRIMARY KEY NOT NULL,
|
|
||||||
amount double DEFAULT NULL,
|
|
||||||
qty real,
|
|
||||||
fk_warehouse_source integer NOT NULL,
|
|
||||||
fk_warehouse_destination integer NOT NULL,
|
|
||||||
fk_stocktransfer integer NOT NULL,
|
|
||||||
fk_product integer NOT NULL,
|
|
||||||
batch varchar(128) DEFAULT NULL, -- Lot or serial number
|
|
||||||
pmp double,
|
|
||||||
rang integer DEFAULT 0,
|
|
||||||
fk_parent_line integer NULL
|
|
||||||
-- END MODULEBUILDER FIELDS
|
|
||||||
) ENGINE=innodb;
|
|
||||||
|
|
||||||
ALTER TABLE llx_stocktransfer_stocktransferline ADD INDEX idx_stocktransfer_stocktransferline_rowid (rowid);
|
|
||||||
|
|
||||||
create table llx_stocktransfer_stocktransfer_extrafields
|
|
||||||
(
|
|
||||||
rowid integer AUTO_INCREMENT PRIMARY KEY,
|
|
||||||
tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
|
|
||||||
fk_object integer NOT NULL,
|
|
||||||
import_key varchar(14) -- import key
|
|
||||||
) ENGINE=innodb;
|
|
||||||
|
|
||||||
ALTER TABLE llx_stocktransfer_stocktransfer_extrafields ADD INDEX idx_fk_object(fk_object);
|
|
||||||
|
|
||||||
create table llx_stocktransfer_stocktransferline_extrafields
|
|
||||||
(
|
|
||||||
rowid integer AUTO_INCREMENT PRIMARY KEY,
|
|
||||||
tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
|
|
||||||
fk_object integer NOT NULL,
|
|
||||||
import_key varchar(14) -- import key
|
|
||||||
) ENGINE=innodb;
|
|
||||||
|
|
||||||
ALTER TABLE llx_stocktransfer_stocktransferline_extrafields ADD INDEX idx_fk_object(fk_object);
|
|
||||||
|
|
||||||
ALTER TABLE llx_stock_mouvement CHANGE origintype origintype VARCHAR(64)
|
|
||||||
|
|
||||||
-- End Stock transfers module
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user