Add warehouse for production on MO

This commit is contained in:
Laurent Destailleur 2019-10-27 16:28:03 +01:00
parent afa3ed499f
commit 7f1b67f0e4
6 changed files with 11 additions and 6 deletions

View File

@ -368,7 +368,8 @@ CREATE TABLE llx_mrp_mo(
ref varchar(128) DEFAULT '(PROV)' NOT NULL,
entity integer DEFAULT 1 NOT NULL,
label varchar(255),
qty real NOT NULL,
qty real NOT NULL,
fk_warehouse integer,
fk_soc integer,
note_public text,
note_private text,

View File

@ -20,7 +20,8 @@ CREATE TABLE llx_mrp_mo(
ref varchar(128) DEFAULT '(PROV)' NOT NULL,
entity integer DEFAULT 1 NOT NULL,
label varchar(255),
qty real NOT NULL,
qty real NOT NULL,
fk_warehouse integer,
fk_soc integer,
note_public text,
note_private text,

View File

@ -39,4 +39,5 @@ QuantityConsumedInvariable=When this flag is set, the quantity consumed is alway
DisableStockChange=Disable stock change
DisableStockChangeHelp=When this flag is set, there is no stock change on this product, whatever is the quantity produced
BomAndBomLines=Bills Of Material and lines
BOMLine=Line of BOM
BOMLine=Line of BOM
WarehouseForProduction=Warehouse for production

View File

@ -71,7 +71,7 @@ class MyObject extends CommonObject
* 'visible' says if field is visible in list (Examples: 0=Not visible, 1=Visible on list and create/update/view forms, 2=Visible on list only, 3=Visible on create/update/view form only (not list), 4=Visible on list and update/view form only (not create). Using a negative value means field is not shown by default on list but can be selected for viewing)
* 'noteditable' says if field is not editable (1 or 0)
* 'notnull' is set to 1 if not null in database. Set to -1 if we must set data to null if empty ('' or 0).
* 'default' is a default value for creation (can still be replaced by the global setup of default values)
* 'default' is a default value for creation (can still be overwrote by the Setup of Default Values if field is editable in creation form). Note: If default is set to '(PROV)' and field is 'ref', the default value will be set to '(PROVid)' where id is rowid when a new record is created.
* 'index' if we want an index in database.
* 'foreignkey'=>'tablename.field' if the field is a foreign key (it is recommanded to name the field fk_...).
* 'position' is the sort order of field.

View File

@ -97,7 +97,8 @@ class Mo extends CommonObject
'label' => array('type'=>'varchar(255)', 'label'=>'Label', 'enabled'=>1, 'visible'=>1, 'position'=>30, 'notnull'=>-1, 'searchall'=>1, 'showoncombobox'=>'1',),
'qty' => array('type'=>'real', 'label'=>'QtyToProduce', 'enabled'=>1, 'visible'=>1, 'position'=>40, 'notnull'=>1, 'comment'=>"Qty to produce",),
'fk_soc' => array('type'=>'integer:Societe:societe/class/societe.class.php:1', 'label'=>'ThirdParty', 'enabled'=>1, 'visible'=>-1, 'position'=>50, 'notnull'=>-1, 'index'=>1),
'note_public' => array('type'=>'html', 'label'=>'NotePublic', 'enabled'=>1, 'visible'=>0, 'position'=>61, 'notnull'=>-1,),
'fk_warehouse' => array('type'=>'integer:Entrepot:product/stock/class/entrepot.class.php:0', 'label'=>'WarehouseForProduction', 'enabled'=>1, 'visible'=>-1, 'position'=>52),
'note_public' => array('type'=>'html', 'label'=>'NotePublic', 'enabled'=>1, 'visible'=>0, 'position'=>61, 'notnull'=>-1,),
'note_private' => array('type'=>'html', 'label'=>'NotePrivate', 'enabled'=>1, 'visible'=>0, 'position'=>62, 'notnull'=>-1,),
'date_creation' => array('type'=>'datetime', 'label'=>'DateCreation', 'enabled'=>1, 'visible'=>-2, 'position'=>500, 'notnull'=>1,),
'tms' => array('type'=>'timestamp', 'label'=>'DateModification', 'enabled'=>1, 'visible'=>-2, 'position'=>501, 'notnull'=>-1,),
@ -116,6 +117,7 @@ class Mo extends CommonObject
public $entity;
public $label;
public $qty;
public $fk_warehouse;
public $fk_soc;
public $note_public;
public $note_private;

View File

@ -369,7 +369,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
print '<table class="border centpercent">'."\n";
// Common attributes
$keyforbreak='qty';
$keyforbreak='fk_warehouse';
unset($object->fields['fk_project']);
unset($object->fields['fk_soc']);
include DOL_DOCUMENT_ROOT . '/core/tpl/commonfields_view.tpl.php';