2
0
forked from Wavyzz/dolibarr

Work on modulebuilder

This commit is contained in:
Laurent Destailleur
2017-10-24 19:57:36 +02:00
parent f24204c79a
commit f381361c8b
5 changed files with 17 additions and 12 deletions

View File

@@ -251,7 +251,11 @@ function rebuildObjectSql($destdir, $module, $objectname, $newmask, $readdir='',
foreach($object->fields as $key => $val)
{
$i++;
$texttoinsert.= "\t".$key." ".$val['type'];
$type = $val['type'];
$type = preg_replace('/:.*$/', '', $type); // For case type = 'integer:Societe:societe/class/societe.class.php'
$texttoinsert.= "\t".$key." ".$type;
if ($key == 'rowid') $texttoinsert.= ' AUTO_INCREMENT PRIMARY KEY';
if ($key == 'entity') $texttoinsert.= ' DEFAULT 1';
else