Openbravo Issue Tracking System - Retail Modules
View Issue Details
0038583Retail ModulesAuto BOM For Retailpublic2018-05-18 14:202018-06-01 13:39
umartirena 
rqueralta 
normalmajorhave not tried
closedinvalid 
5
 
 
jorge-garcia
No
0038583: Orders having BOM products made by raw materials with attributes give a weird error while processing if there is no stock
Orders having BOM products made by raw materials with attributes give a weird error while processing if there is no stock. This problem happens even if "Auto BOM: Allow negative stock in raw materials" preference is configured.
Install https://code.openbravo.com/erp/pmods/org.openbravo.retail.autobom [^] module.

Login to Openbravo backoffice:
 * Go to Preference window and create a new preference for Property "Auto BOM: Allow negative stock in raw materials" with value "Y"
 * Go to "Lot Number Sequence" window and create a new record:
   - Name: LOT
   - Starting No: 100
   - Incremented By: 1
   - Next Assigned Number: 100
 * Go to "Attribute Set" window and create a new record:
   - Name: LOT
   - Lot flag checked.
   - Lot Control: LOT
 * Go to Product window and search "Mountain pack" product.
   - Check "Auto Generate BOM" property
   - Set "Attribute Set": Lot
   - In "Manufacturing" tab (In order to display this tab the instance needs to be active and "Apply configuration script" flag in Retail Template unchecked. After unchecking update.database is needed) add new record:
      * Organization: Vall Blanca Store
      * Storage Bin: VBS/001 0-0-0
 * Search "Europe mountains guide" product in Product window.
   - Set "Attribute Set": Lot

Login into Web POS:
  * Add "Mountain pack" product.
  * Pay and close the ticket.

Login into backoffice:
  * Open Errors While Importing window. The following error appears:

org.postgresql.util.PSQLException: ERROR: @20112@ - Mountain pack
    at org.postgresql.core.v3.QueryExecutorImpl.receiveErrorResponse(QueryExecutorImpl.java:2433)
    at org.postgresql.core.v3.QueryExecutorImpl.processResults(QueryExecutorImpl.java:2178)
    at org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:479)
    at org.postgresql.jdbc.PgStatement.executeBatch(PgStatement.java:835)
    at org.postgresql.jdbc.PgPreparedStatement.executeBatch(PgPreparedStatement.java:1556)
    at sun.reflect.GeneratedMethodAccessor811.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:498)
    at org.apache.tomcat.jdbc.pool.StatementFacade$StatementProxy.invoke(StatementFacade.java:138)
    at com.sun.proxy.$Proxy26.executeBatch(Unknown Source)
    at org.hibernate.jdbc.BatchingBatcher.doExecuteBatch(BatchingBatcher.java:70)
    at org.hibernate.jdbc.AbstractBatcher.executeBatch(AbstractBatcher.java:268)
    at org.hibernate.jdbc.AbstractBatcher.prepareStatement(AbstractBatcher.java:114)
    at org.hibernate.jdbc.AbstractBatcher.prepareStatement(AbstractBatcher.java:109)
    at org.hibernate.jdbc.AbstractBatcher.prepareBatchStatement(AbstractBatcher.java:244)
    at org.hibernate.persister.entity.AbstractEntityPersister.insert(AbstractEntityPersister.java:2411)
    at org.hibernate.persister.entity.AbstractEntityPersister.insert(AbstractEntityPersister.java:2868)
    at org.hibernate.action.EntityInsertAction.execute(EntityInsertAction.java:79)
    at org.hibernate.engine.ActionQueue.execute(ActionQueue.java:273)
    at org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:265)
    at org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:184)
    at org.hibernate.event.def.AbstractFlushingEventListener.performExecutions(AbstractFlushingEventListener.java:321)
    at org.hibernate.event.def.DefaultFlushEventListener.onFlush(DefaultFlushEventListener.java:51)
    at org.hibernate.impl.SessionImpl.flush(SessionImpl.java:1216)
    at org.openbravo.dal.service.OBDal.flush(OBDal.java:262)
    at org.openbravo.dal.service.OBDal.getConnection(OBDal.java:187)
    at org.openbravo.dal.service.OBDal.getConnection(OBDal.java:171)
    at org.openbravo.dal.core.TriggerHandler.disable(TriggerHandler.java:64)
    at org.openbravo.retail.posterminal.OrderLoader.saveRecord(OrderLoader.java:288)
    at org.openbravo.mobile.core.process.DataSynchronizationProcess.saveRecord(DataSynchronizationProcess.java:200)
    at org.openbravo.mobile.core.process.DataSynchronizationProcess.exec(DataSynchronizationProcess.java:154)
    at org.openbravo.mobile.core.process.DataSynchronizationProcess.exec(DataSynchronizationProcess.java:86)
    at org.openbravo.mobile.core.process.MobileImportEntryProcessorRunnable.processEntry(MobileImportEntryProcessorRunnable.java:53)
    at org.openbravo.retail.posterminal.importprocess.OrderImportEntryProcessor$OrderLoaderRunnable.processEntry(OrderImportEntryProcessor.java:59)
    at org.openbravo.service.importprocess.ImportEntryProcessor$ImportEntryProcessRunnable.doRunCycle(ImportEntryProcessor.java:367)
    at org.openbravo.service.importprocess.ImportEntryProcessor$ImportEntryProcessRunnable.run(ImportEntryProcessor.java:288)
    at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
    at java.util.concurrent.FutureTask.run(FutureTask.java:266)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
    at java.lang.Thread.run(Thread.java:748)
The error should be clear. It should not be possible to create a bom production with raw materials that have attributes having negative stock even if "Auto BOM: Allow negative stock in raw materials" preference is enabled.
No tags attached.
related to defect 0038687 closed rqueralta Autobom not working wth products that have attributes and if there is not stock. 
Issue History
2018-05-18 14:20umartirenaNew Issue
2018-05-18 14:20umartirenaAssigned To => Retail
2018-05-18 14:20umartirenaTriggers an Emergency Pack => No
2018-05-18 14:39umartirenaResolution time => 1528408800
2018-05-29 22:30rqueraltaAssigned ToRetail => rqueralta
2018-05-29 22:30rqueraltaStatusnew => scheduled
2018-06-01 12:49martinsdanIssue Monitored: martinsdan
2018-06-01 13:39jorge-garciaReview Assigned To => jorge-garcia
2018-06-01 13:39jorge-garciaNote Added: 0104876
2018-06-01 13:39jorge-garciaStatusscheduled => closed
2018-06-01 13:39jorge-garciaResolutionopen => invalid
2018-06-01 14:12VictorVillarRelationship addedrelated to 0038687

Notes
(0104876)
jorge-garcia   
2018-06-01 13:39   
The proposed solution is not the requiered solution to be done