Anonymous | Login
Project:
RSS
  
News | My View | View Issues | Roadmap | Summary

View Issue DetailsJump to Notes ] Issue History ] Print ]
ID
0038861
TypeCategorySeverityReproducibilityDate SubmittedLast Update
defect[Openbravo ERP] 02. Master data managementmajoralways2018-06-29 08:492018-08-08 13:06
ReporterngarciaView Statuspublic 
Assigned Tomarkmm82 
PriorityurgentResolutionfixedFixed in Version3.0PR18Q4
StatusclosedFix in branchFixed in SCM revision1dbba4eb40f8
ProjectionnoneETAnoneTarget Version
OSAnyDatabaseAnyJava version
OS VersionDatabase versionAnt version
Product VersionSCM revision 
Review Assigned Todmiguelez
Web browser
ModulesCore
Regression level
Regression date
Regression introduced in release
Regression introduced by commit
Triggers an Emergency PackNo
Summary

0038861: Empty error message shown in Create Variants if the Product Characteristic has Subset but not values

DescriptionEmpty error message shown in Create Variants if the Product Characteristic has Subset but not values
Steps To ReproduceAs group admin role:
   Create a new Product Characteristic
   Set it as Variant
   Add a Subset to it
   Create a new Product
   Set it as Generic
   Set the previously created Characteristic
   Launch Create Variants Process and check an empty error message is shown
   The log shows

      ERROR org.openbravo.materialmgmt.VariantAutomaticGenerationProcess - Exception processing variant generation
java.util.NoSuchElementException
    at java.util.ArrayList$Itr.next(ArrayList.java:840)
    at org.openbravo.materialmgmt.VariantAutomaticGenerationProcess$ProductCharacteristicAux.getNextValue(VariantAutomaticGenerationProcess.java:342)
    at org.openbravo.materialmgmt.VariantAutomaticGenerationProcess.execute(VariantAutomaticGenerationProcess.java:124)
TagsNo tags attached.
Attached Files

- Relationships Relation Graph ] Dependency Graph ]

-  Notes
(0105815)
markmm82 (developer)
2018-07-20 01:24

Test Plan:
As group admin role:
   Create a new Product Characteristic. Set it as Variant
     Name = PC
     Variant = Yes
   Create a new Product. Set it as Generic
     Search Key = Name = P
     Is Generic = Y
   Launch Create Variants Process and check an error message is shown:
     Error:
     Variants can not be created because the Generic Product does not have any Characteristic defined as Variant.
   It is correct due we have not defined any characteristic yet to the product.
   Go to Characteristics tab and add the previously created Characteristic
     Characteristic = PC
     Variant = Yes
   Launch Create Variants Process and check the following message is shown:
     Process completed successfully
     0 variants created.
   It is correct because the product characteristic has any value defined.

   Go to the previously created Product Characteristic and add a Subset to it, DON'T DEFINE ANY VALUE TO IT.
   Move to the Product window and Launch Create Variants Process for the previously created product (P) and check the following message is shown:
     Process completed successfully
     0 variants created.
   It is correct because although the product characteristic has a subset defined it hasn't any value defined.

   Go to the previously created Product Characteristic but this time we going to add values to the existing Subset.
   First add two new values in the Value tab:
      1st record => Name = Code = V1
      2nd record => Name = Code = V2
   Add two new subset values from previosly created values V1 and V2

   Launch Create Variants Process and check the message is shown:
     Process completed successfully
     2 variants created
   Notice there are two new entries in Characteristic Configuration tab, each one for each characteristic value V1 and V2
(0105917)
hgbot (developer)
2018-07-24 15:49

Repository: erp/devel/pi
Changeset: 1dbba4eb40f8d6e0efac921637eeffb27a0e963c
Author: Mark <markmm82 <at> gmail.com>
Date: Wed Jul 18 17:56:03 2018 -0400
URL: http://code.openbravo.com/erp/devel/pi/rev/1dbba4eb40f8d6e0efac921637eeffb27a0e963c [^]

Fixes issue 38861: Fixed Create Variants if ProductCharacteristic hasn't values

An empty error message was shown in Create Variants if the Product Characteristic
hadd Subset but not values because it was trying to iterate hover an empty collection
in an incorrect way.

This solution includes:
- Save in a local variable the list with the Product Characteristics to be processed
  to avoid calling .list() method twice because it will repeat the same query and it is
  not needed.
- Avoid using a OBCriteria to get the list of ProductCharacteristicConf objects defined
  for the ProductCharacteristic is processing. This list is accessed directly from the
  object by calling the prCh.getProductCharacteristicConfList() method.
- If the processing ProductCharacteristic hasn't any configuration then it is not executed
  the section of code in charge of create the auxiliary information to be used to create
  the variants. In this way the exception throwed in the issue is not happening.
- Avoid to try to generate variants if there aren't any product characteristic configuration.
  The hasNext flag is initiallized with true if exists at least one variant to be created, and false
  in other case.
- Modified the do {} while block to use a while block and avoid create the first variant if any exists.

---
M src/org/openbravo/materialmgmt/VariantAutomaticGenerationProcess.java
---
(0105918)
dmiguelez (developer)
2018-07-24 15:49

Code Review + Testing Ok
(0106224)
hudsonbot (developer)
2018-08-08 13:06

A changeset related to this issue has been promoted main and to the
Central Repository, after passing a series of tests.

Promotion changeset: https://code.openbravo.com/erp/devel/main/rev/bfd7a414183a [^]
Maturity status: Test

- Issue History
Date Modified Username Field Change
2018-06-29 08:49 ngarcia New Issue
2018-06-29 08:49 ngarcia Assigned To => Triage Finance
2018-06-29 08:49 ngarcia Modules => Core
2018-06-29 08:49 ngarcia Resolution time => 1532037600
2018-06-29 08:49 ngarcia Triggers an Emergency Pack => No
2018-06-29 08:49 ngarcia Issue Monitored: networkb
2018-07-16 16:35 markmm82 Assigned To Triage Finance => markmm82
2018-07-16 16:35 markmm82 Status new => scheduled
2018-07-20 01:24 markmm82 Note Added: 0105815
2018-07-24 15:49 hgbot Checkin
2018-07-24 15:49 hgbot Note Added: 0105917
2018-07-24 15:49 hgbot Status scheduled => resolved
2018-07-24 15:49 hgbot Resolution open => fixed
2018-07-24 15:49 hgbot Fixed in SCM revision => http://code.openbravo.com/erp/devel/pi/rev/1dbba4eb40f8d6e0efac921637eeffb27a0e963c [^]
2018-07-24 15:49 dmiguelez Review Assigned To => dmiguelez
2018-07-24 15:49 dmiguelez Note Added: 0105918
2018-07-24 15:49 dmiguelez Status resolved => closed
2018-07-24 15:49 dmiguelez Fixed in Version => 3.0PR18Q4
2018-08-08 13:06 hudsonbot Checkin
2018-08-08 13:06 hudsonbot Note Added: 0106224


Copyright © 2000 - 2009 MantisBT Group
Powered by Mantis Bugtracker