[Vtigercrm-commits] [Vtiger development] #8360: Import Duplicate Handling (Step3) for Inventory Modules
Vtiger development
vtiger-tickets at trac.vtiger.com
Mon Dec 8 18:21:15 GMT 2014
#8360: Import Duplicate Handling (Step3) for Inventory Modules
-------------------------------------------------+-------------------------
Reporter: mathdesc | Owner: mathdesc
Type: known issue | Status: new
Priority: major | Milestone: Unassigned
Component: vtigercrm | Version:
Severity: High | Resolution:
Keywords: |
import,duplicate,invoice,salesorder, |
-------------------------------------------------+-------------------------
Comment (by mathdesc):
Tracing the import process, I pinpoint the "uniq subject issue" in
''utils/InventoryUtils.php'' in createRecords functions. Actually the
process function of ''modules/Import/actions/Data.php'' leads to the
latter dedicated & 1-param function for inventory modules, whereas it
leads to a generic 0-param function .
{{{
#!div style="font-size: 80%"
Code highlighting:
{{{#!php
$focus = CRMEntity::getInstance($this->module);
if(method_exists($focus, 'createRecords')) {
$focus->createRecords($this);
} else
{
$this->createRecords();
}
}}}
}}}
Indeed a '''hardcoded''' GROUP BY clause on module.subject by design sets
this field as pseudo-uniq
{{{
#!div style="font-size: 80%"
Code highlighting:
{{{#!php
function createRecords($obj) {
[...]
$tableName = Import_Utils_Helper::getDbTableName($obj->user);
$sql = 'SELECT * FROM ' . $tableName . ' WHERE status = '.
Import_Data_Action::$IMPORT_RECORD_NONE .' GROUP BY subject';
[...]
}
}}}
}}}
To me if a group by clause has to be, it should rather be on creation
time.
It appears it'll do fine as for instance for Invoices, one could name
(subject) multiple invoices the same for customer convenience (as it is
permitted by the app already) while relying on the Created Time to group
by them moreover, multiple items lines within an invoice are created on
the exact same date.
--
Ticket URL: <http://trac.vtiger.com/cgi-bin/trac.cgi/ticket/8360#comment:2>
Vtiger development <http://trac.vtiger.com/>
Vtiger CRM
More information about the vtigercrm-commits
mailing list