Openbravo Issue Tracking System - Modules | |||||
View Issue Details | |||||
ID | Project | Category | View Status | Date Submitted | Last Update |
0041142 | Modules | SAP Connector | public | 2019-06-20 18:24 | 2022-02-01 08:05 |
Reporter | martinsdan | ||||
Assigned To | Triage Platform Base | ||||
Priority | normal | Severity | major | Reproducibility | always |
Status | new | Resolution | open | ||
Platform | OS | 45 | OS Version | 10.12 | |
Product Version | |||||
Target Version | Fixed in Version | ||||
Merge Request Status | |||||
Regression date | |||||
Regression introduced by commit | |||||
Regression level | |||||
Review Assigned To | |||||
Support ticket | |||||
OBNetwork customer | |||||
Regression introduced in release | |||||
Summary | 0041142: Problem creating several mappings for the same iDoc | ||||
Description | We need to sync several transactions like shipments and distribution orders for example. In this case, we have a problem because we want to map 2 Openbravo entities with the same idoc. In this case, we should have 2 Mapping entries with the same External Entity but a different Openbravo Entity. Everything seems ok when generating the idoc, but an error is thrown when getting the path to save the idoc. org.openbravo.service.integration.sapecc.process.SapEccExporterSynchronizableBusinessObjectExporter.java String fileName = getFilePath(idocType); This will eventually call: org.openbravo.service.integration.sapecc.process.SapEccExporterSynchronizableBusinessObjectExporter.java private EntityMapping getEntityMapping(String idocType) { OBCriteria<EntityMapping> criteria = OBDal.getInstance().createCriteria(EntityMapping.class); criteria.add(Restrictions.eq(EntityMapping.PROPERTY_SYSTEMTYPE, SapEccConstants.SYSTEM_TYPE)); criteria.add(Restrictions.eq(EntityMapping.PROPERTY_MAPPEDENTITY, idocType)); criteria.add(Restrictions.eq(EntityMapping.PROPERTY_INTEGRATIONDIRECTION, IntegrationDirection.EXPORT_FROM_OB.getLabel())); criteria.setFilterOnReadableClients(false); criteria.setFilterOnReadableOrganization(false); return (EntityMapping) criteria.uniqueResult(); } Here is the problem, this will throw an error because the query returns 2 results. org.hibernate.NonUniqueResultException: query did not return a unique result: 2 | ||||
Steps To Reproduce | We need to create 2 mappings to export the same idoc. | ||||
Proposed Solution | I think we should get this information somehow from the context we are executing the process because it should be possible to have several combinations for the same idoc and entity and schedule the selected implementation. A proposed solution patch is attached. | ||||
Additional Information | |||||
Tags | No tags attached. | ||||
Relationships | |||||
Attached Files | noUniqueError.diff (4,327) 2019-06-20 18:24 https://issues.openbravo.com/file_download.php?file_id=13041&type=bug | ||||
Issue History | |||||
Date Modified | Username | Field | Change | ||
2019-06-20 18:24 | martinsdan | New Issue | |||
2019-06-20 18:24 | martinsdan | Assigned To | => platform | ||
2019-06-20 18:24 | martinsdan | File Added: noUniqueError.diff | |||
2022-02-01 08:05 | alostale | Assigned To | platform => Triage Platform Base |
There are no notes attached to this issue. |