Openbravo Issue Tracking System - Openbravo ERP
View Issue Details
0020921Openbravo ERP04. Warehouse managementpublic2012-07-03 18:352012-07-10 10:35
gorkaion 
naiaramartinez 
immediatemajorhave not tried
closedfixed 
5
 
3.0MP13 
Core
No
0020921: New instances shouldn't use legacy cost engine
When a new Openbravo instance is created without any client it shouldn't be possible to start using the legacy engine.
Delete F&B and QA Testing clients.
Create a new client.
Try to create a new costing entry for a product using the Standard Legacy cost type.
The instance should be considered as migrated when there are validated costing rules or when not exists any entry in the m_costing table.

Needed changes:
1. Create a module script that creates a "Cost Migrated" preference.
2. Modify Costing Status singleton class:
* To determine the status based on the existence of the preference.
* Modify the setMigrated method to create the preference.
3. Remove existing isMigrated auxiliar inputs and modify related display logics and validations to use the preference.
4. Modify M_Generate_Average_Cost, MA_WorkEffort_validate and MA_Production_Cost_Generate to change the migration check to the existence of the new preference.
5. Modify the trigger on the M_Costing table to void the insertions of records using cost type 'AV', 'ST' and 'AVO' when the instance is migrated.
No tags attached.
Issue History
2012-07-03 18:35gorkaionNew Issue
2012-07-03 18:35gorkaionAssigned To => naiaramartinez
2012-07-03 18:35gorkaionModules => Core
2012-07-03 21:21dmitry_mezentsevNote Added: 0050345
2012-07-05 13:03naiaramartinezNote Added: 0050371
2012-07-05 13:10naiaramartinezNote Edited: 0050371bug_revision_view_page.php?bugnote_id=0050371#r3594
2012-07-05 13:30naiaramartinezNote Edited: 0050371bug_revision_view_page.php?bugnote_id=0050371#r3595
2012-07-05 13:38naiaramartinezNote Edited: 0050371bug_revision_view_page.php?bugnote_id=0050371#r3596
2012-07-05 13:45naiaramartinezNote Edited: 0050371bug_revision_view_page.php?bugnote_id=0050371#r3597
2012-07-05 13:47naiaramartinezNote Edited: 0050371bug_revision_view_page.php?bugnote_id=0050371#r3598
2012-07-05 18:27SandrahuguetNote Added: 0050378
2012-07-05 18:32hgbotCheckin
2012-07-05 18:32hgbotNote Added: 0050379
2012-07-05 18:32hgbotStatusnew => resolved
2012-07-05 18:32hgbotResolutionopen => fixed
2012-07-05 18:32hgbotFixed in SCM revision => http://code.openbravo.com/erp/devel/pi/rev/4b990d5f82bc44560200aec6ab76a1bbb876f121 [^]
2012-07-05 18:46SandrahuguetNote Added: 0050380
2012-07-05 18:46SandrahuguetStatusresolved => closed
2012-07-10 10:35hudsonbotCheckin
2012-07-10 10:35hudsonbotNote Added: 0050427

Notes
(0050345)
dmitry_mezentsev   
2012-07-03 21:21   
Gorka,

Not absolutely clear from the description so just to confirm that the following scenario is covered.

I take vanilla MP13. It has F&B and F&B does not have any signs of old costing and I cannot use them. I do not delete F&B and I create a new client. I must not be able to use old costing and see any entries that belong to it.
(0050371)
naiaramartinez   
2012-07-05 13:03   
(edited on: 2012-07-05 13:47)
Test Plan1:
 Having MP12 instance:
   -Execute install.source without F&B and QAAdmin
   -Update the instance to MP13
   -Check that the preference 'Cost_Eng_Ins_Migrated' has been created (Client 0 and Organization 0).

Test Plan2:
 Having MP12 instance:
   -Execute install.source with F&B and QAAdmin
   -Update the instance to MP13
   -Check that the preference 'Cost_Eng_Ins_Migrated' does not exist.

Test Plan3:
 Having MP13 instance(https://issues.openbravo.com/view.php?id=20898 [^] fix must be applied):
   -Execute install.source
   -Check that the preference 'Cost_Eng_Ins_Migrated' exists

Test Plan4:
  Having MP13 instance:
   -Execute install.source without F&B and QAAdmin
   -Check that the preference 'Cost_Eng_Ins_Migrated' exists

Test Plan5:
  Having the preference 'Cost_Eng_Ins_Migrated' created:
   - Go to product window and check that 'cost type' and 'Standard cost' fields are not shown.
   - Go to costing tab. Check that in 'Cost type' combo, you can only see Standard and Average options.

Test Plan6:
  Not Having the preference 'Cost_Eng_Ins_Migrated' created:
   - Go to product window and check that 'cost type' and 'Standard cost' fields are shown.
   - Go to costing tab. Check that in 'Cost type' combo, you can only see Legacy Standard and Legacy Average options.

Test Plan7:
   Having the preference 'Cost_Eng_Ins_Migrated' created:
    - Go to Generate Average Cost. You cannot execute that process.

Test Plan8:
   Not Having the preference 'Cost_Eng_Ins_Migrated' created:
    - Go to Generate Average Cost. You can execute that process.

Test Plan9:
   Having the preference 'Cost_Eng_Ins_Migrated' created:
    - Activate the professional instance
    - Go to work Effort window and fill all the setting for being able to execute it. Finally, you won't be able to execute it because you have the preference created.

Test Plan10:
   Not Having the preference 'Cost_Eng_Ins_Migrated' created:
    - Activate the professional instance
    - Go to work Effort window and fill all the setting for being able to execute it. Finally, you will be able to execute it.

Test Plan11:
   Having the preference 'Cost_Eng_Ins_Migrated' created:
     -Go to Create Production Costs. check that you can't execute that process.

Test Plan12:
   Not Having the preference 'Cost_Eng_Ins_Migrated' created:
     -Go to Create Production Costs. check that you can execute that process.

(0050378)
Sandrahuguet   
2012-07-05 18:27   
testing OK
(0050379)
hgbot   
2012-07-05 18:32   
Repository: erp/devel/pi
Changeset: 4b990d5f82bc44560200aec6ab76a1bbb876f121
Author: Naiara Martinez <naiara.martinez <at> openbravo.com>
Date: Thu Jul 05 18:06:26 2012 +0200
URL: http://code.openbravo.com/erp/devel/pi/rev/4b990d5f82bc44560200aec6ab76a1bbb876f121 [^]

fixed bug 20921 New instances shouldn't use legacy cost engine

---
M src-db/database/model/functions/MA_PRODUCTION_COST_GENERATE.xml
M src-db/database/model/functions/MA_WORKEFFORT_VALIDATE.xml
M src-db/database/model/functions/M_GENERATE_AVERAGE_COSTS.xml
M src-db/database/model/triggers/M_COSTING_TRG.xml
M src-db/database/sourcedata/AD_AUXILIARINPUT.xml
M src-db/database/sourcedata/AD_FIELD.xml
M src-db/database/sourcedata/AD_MESSAGE.xml
M src-db/database/sourcedata/AD_VAL_RULE.xml
M src/org/openbravo/costing/CostingMigrationProcess.java
M src/org/openbravo/costing/CostingStatus.java
A src-util/modulescript/build/classes/org/openbravo/modulescript/InitializeCostingMigrationPreference.class
A src-util/modulescript/build/classes/org/openbravo/modulescript/InitializeCostingMigrationPreferenceData.class
A src-util/modulescript/src/org/openbravo/modulescript/InitializeCostingMigrationPreference.java
A src-util/modulescript/src/org/openbravo/modulescript/InitializeCostingMigrationPreference_data.xsql
---
(0050380)
Sandrahuguet   
2012-07-05 18:46   
code review OK by Eduardo
(0050427)
hudsonbot   
2012-07-10 10:35   
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/9f5eedec4e1a [^]

Maturity status: Test