llx_mrp_production.sql 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738
  1. -- Copyright (C) 2019 Laurent Destailleur <eldy@users.sourceforge.net>
  2. --
  3. -- This program is free software: you can redistribute it and/or modify
  4. -- it under the terms of the GNU General Public License as published by
  5. -- the Free Software Foundation, either version 3 of the License, or
  6. -- (at your option) any later version.
  7. --
  8. -- This program is distributed in the hope that it will be useful,
  9. -- but WITHOUT ANY WARRANTY; without even the implied warranty of
  10. -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  11. -- GNU General Public License for more details.
  12. --
  13. -- You should have received a copy of the GNU General Public License
  14. -- along with this program. If not, see http://www.gnu.org/licenses/.
  15. CREATE TABLE llx_mrp_production(
  16. rowid integer AUTO_INCREMENT PRIMARY KEY NOT NULL,
  17. fk_mo integer NOT NULL,
  18. origin_id integer,
  19. origin_type varchar(10), -- 'bom' bom production line or 'free' free production line added after Mo creation from bom
  20. position integer NOT NULL DEFAULT 0,
  21. fk_product integer NOT NULL,
  22. fk_warehouse integer,
  23. qty real NOT NULL DEFAULT 1,
  24. qty_frozen smallint DEFAULT 0,
  25. disable_stock_change smallint DEFAULT 0,
  26. batch varchar(128),
  27. role varchar(10), -- 'toconsume' or 'toproduce' (initialized at MO creation), 'consumed' or 'produced' (added after MO validation)
  28. fk_mrp_production integer, -- if role = 'consumed', id of line with role 'toconsume', if role = 'produced' id of line with role 'toproduce'
  29. fk_stock_movement integer, -- id of stock movement when movements are validated
  30. date_creation datetime NOT NULL,
  31. tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  32. fk_user_creat integer NOT NULL,
  33. fk_user_modif integer,
  34. import_key varchar(14)
  35. ) ENGINE=innodb;