Merge pull request #22663 from atm-maxime/fix_product_import_finished

Fix : remove duplicate code and fix #22176
This commit is contained in:
Laurent Destailleur 2022-10-24 16:53:48 +02:00 committed by GitHub
commit 9c776437c8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -650,16 +650,7 @@ class modProduct extends DolibarrModules
}
// End add extra fields
$this->import_fieldshidden_array[$r] = array('extra.fk_object'=>'lastrowid-'.MAIN_DB_PREFIX.'product'); // aliastable.field => ('user->id' or 'lastrowid-'.tableparent)
$this->import_regex_array[$r] = array(
'p.ref'=>'[^ ]',
'p.price_base_type' => 'HT|TTC',
'p.tosell'=>'^[0|1]$',
'p.tobuy'=>'^[0|1]$',
'p.fk_product_type'=>'^[0|1]$',
'p.datec'=>'^[0-9][0-9][0-9][0-9]-[0-9][0-9]-[0-9][0-9]$',
'p.recuperableonly' => '^[0|1]$',
'p.finished' => '^[0|1]$'
);
// field order as per structure of table llx_product
$import_sample = array(
'p.ref' => "ref:PREF123456",