Openbravo Issue Tracking System - Openbravo ERP
View Issue Details
0041422Openbravo ERPZ. Otherspublic2019-07-22 20:452020-01-30 14:41
AtulOpenbravo 
AtulOpenbravo 
normalminorhave not tried
closedfixed 
5
 
3.0PR20Q1 
aferraz
Core
No
0041422: API Change: Old Costing Cleanup
Following are the candidates that could be removed as they belong to old costing feature

-Sales Invoice Dimensional Report Legacy
-Generate Average Costs
-Valued Stock Report Legacy
-Create Production Costs
-Pareto Product Report Legacy
-Costing Migration Process
-Costing Status
-M_UPDATE_PARETO_PRODUCT_LEGACY

**Remove related DB functions, Menu's, Model Object and their Mapping, unused html files, xml files, xsql, java classes & methods, ad_elements, text interfaces, messages etc.
*Missing class
-org.openbravo.costing.CostingMigrationProcess
-org.openbravo.costing.CostingStatus
-org.openbravo.erpCommon.ad_reports.ReportInvoiceCustomerDimensionalAnalysesJR_legacy
-org.openbravo.erpCommon.ad_reports.ReportParetoProductLegacy
-org.openbravo.erpCommon.ad_reports.ReportValuationStock_legacy
*Missing methods
-org.openbravo.erpCommon.reference.ActionButtonData.process1000500001(org.openbravo.database.ConnectionProvider, java.lang.String)
-org.openbravo.erpCommon.reference.ActionButtonData.process182(org.openbravo.database.ConnectionProvider, java.lang.String)
-org.openbravo.erpCommon.reference.ActionButtonData.process800085(org.openbravo.database.ConnectionProvider, java.lang.String)
-org.openbravo.erpCommon.reference.ActionButtonData.process800151(org.openbravo.database.ConnectionProvider, java.lang.String)
-org.openbravo.model.materialmgmt.cost.Costing.getGoodsShipmentLine()
-org.openbravo.model.materialmgmt.cost.Costing.getProductionLine()
-org.openbravo.model.materialmgmt.cost.Costing.setGoodsShipmentLine(org.openbravo.model.materialmgmt.transaction.ShipmentInOutLine)
-org.openbravo.model.materialmgmt.cost.Costing.setProductionLine(org.openbravo.model.materialmgmt.transaction.ProductionLine)
-org.openbravo.model.common.plm.Product.getCostType()
-org.openbravo.model.common.plm.Product.getStandardCost()
-org.openbravo.model.common.plm.Product.setCostType(java.lang.String)
-org.openbravo.model.common.plm.Product.setStandardCost(java.math.BigDecimal)
*Missing Fields
-org.openbravo.model.common.plm.Product.PROPERTY_COSTTYPE
-org.openbravo.model.common.plm.Product.PROPERTY_STANDARDCOST
-org.openbravo.model.materialmgmt.cost.Costing.PROPERTY_GOODSSHIPMENTLINE
-org.openbravo.model.materialmgmt.cost.Costing.PROPERTY_PRODUCTIONLINE

**Below references in external modules found
A. CostingStatus

allMods-SUP/org.openbravo.warehouse.reportvaluedstockenhanced, ReportValuedStockEnhanced.java class line no 34
allMods-NI/br.com.disoft.brazil.ce.core, InvoiceCustomerDimensionalAnalysesJR.java class line no 299
Need to remove if loop which has CostingStatus.IsMigrated == false check, it wont be never executed. It is safe to remove.

B. Product : CostType (setCostType() method)
i. allMods-SUP/org.openbravo.module.idljava SampleProductsProcess.java class, line no204.
ii. allMods-SUP/org.openbravo.service.integration.sap.ecc.mappings, ProductOBObjectInitializer.java class, line no 29
iii. allMods-NI/com.tds.openbravo.magento, ProductSynchronization.java class, line no 19
Only set method is use and get method is not, hence safe to remove.
iv. allMods-NI/fr.phidias.openbravo.retail: m_product.costtype is used in view PHPOS_PRODUCT_V, PHPOS_PRODUCTPRICE_V
v. allMods-NI/org.wirabumi.gen.oez: m_product.costtype is used in function OEZ_IMPORTPRODUCTCOST as below:
--get costtype
  select costtype into v_costtype from m_product where m_product_id=cur_productcost.m_product_id;
  if v_costtype is null then
    v_costtype='AV'; --default costtype is Average
    update m_product
      set costtype='AV'
      where m_product_id=cur_productcost.m_product_id; --updating costtype
  end if;

C. Product: CostStd (setStandardCost() method)

i. allMods-SUP/org.openbravo.module.idljava, SampleProductsProcess.java class, line no 224
ii. allMods-NI/com.tds.openbravo.magento, ProductSynchronization.java class, line no 69 & 71
Only set method is use and get method is not, hence safe to remove.
iii. allMods-NI/fr.phidias.openbravo.retail: m_product.coststd is used in view PHPOS_PRODUCT_V, PHPOS_PRODUCTPRICE_V

D. DB Function: M_GENERATE_AVERAGE_COSTS
i. allMods-NI/com.sidesoft.localization.ecuador.withholdings, SSWH_GENERATE_STATUS, line no 122
ii. allMods-NI/com.sidesoft.localization.ecuador.withholdings, SSWH_GENERATE_CHECK, line no 161
The above two functions uses M_GENERATE_AVERAGE_COSTS but the piece of code is commented. Hence
removal is safe.

- Sample data changes related to removed column's, process access can be managed in Core, Retail Sample Data & AWP Sample Data modules, hence removing of the above deletion candidate has low risk.
-
Approved
blocks feature request 00414213.0PR20Q1 closed AtulOpenbravo Unsupport legacy cost engine 
Issue History
2019-07-22 20:45AtulOpenbravoNew Issue
2019-07-22 20:45AtulOpenbravoAssigned To => Triage Finance
2019-07-22 20:45AtulOpenbravoModules => Core
2019-07-22 20:45AtulOpenbravoTriggers an Emergency Pack => No
2019-07-22 20:46AtulOpenbravoRelationship addedblocks 0041421
2019-07-22 22:29AtulOpenbravoDescription Updatedbug_revision_view_page.php?rev_id=19167#r19167
2019-07-22 22:31AtulOpenbravoDescription Updatedbug_revision_view_page.php?rev_id=19170#r19170
2019-09-24 10:38AtulOpenbravoReview Assigned To => dmitry_mezentsev
2019-09-24 10:38AtulOpenbravoDescription Updatedbug_revision_view_page.php?rev_id=19400#r19400
2019-09-24 17:07dmitry_mezentsevTag Attached: Approved
2019-10-04 14:09aferrazAssigned ToTriage Finance => AtulOpenbravo
2019-10-14 14:11hgbotCheckin
2019-10-14 14:11hgbotNote Added: 0115065
2019-10-14 14:11hgbotStatusnew => resolved
2019-10-14 14:11hgbotResolutionopen => fixed
2019-10-14 14:11hgbotFixed in SCM revision => http://code.openbravo.com/erp/devel/api-checks/rev/02db515fff90896e2bb7b3da14b20bdabcad9280 [^]
2019-10-14 15:25hgbotCheckin
2019-10-14 15:25hgbotNote Added: 0115071
2019-10-17 08:30aferrazReview Assigned Todmitry_mezentsev => aferraz
2019-10-17 08:30aferrazNote Added: 0115132
2019-10-17 08:30aferrazStatusresolved => closed
2019-10-17 08:30aferrazFixed in Version => 3.0PR20Q1
2020-01-30 14:41AtulOpenbravoIssue cloned0043070

Notes
(0115065)
hgbot   
2019-10-14 14:11   
Repository: erp/devel/api-checks
Changeset: 02db515fff90896e2bb7b3da14b20bdabcad9280
Author: Atul Gaware <atul.gaware <at> openbravo.com>
Date: Mon Oct 14 17:38:12 2019 +0530
URL: http://code.openbravo.com/erp/devel/api-checks/rev/02db515fff90896e2bb7b3da14b20bdabcad9280 [^]

Fixes issue 0041422: API Change for Old Costing Cleanup

** Remove column M_Costing.M_INOUTLINE_ID, M_COSTING.M_PRODUCTIONLINE_ID
and its related foreign keys, its references from DB candidates,
its related AD_COLUMN, AD_FIELD, AD Element, etc
** Remove column M_Product.Coststd, M_Product.Costtype and its references
from DB candidates, its related AD_COLUMN, AD_FIELD, AD Element.
** Removed references of Cost_Eng_Ins_Migrated preference from DB functions,
AD_AUXILIARINPUT, DISPLAYLOGIC, VALIDATION RULES.
** Removed reference of CostingMigrationFirstPhaseCompleted preference
** Removed DB functions MA_PRODUCTION_COST_GENERATE, M_GENERATE_AVERAGE_COSTS
M_GENERATE_STANDARD_COSTS, M_GET_PARETO_ABC_LEGACY, M_GET_TRANSACTION_COST,
M_GET_TRX_AND_PRODUCT_COST, M_UPDATE_PARETO_PRODUCT0LEGACY,
M_UPDATE_PARETO_PRODUCT_LEGACY, its related AD_PROCESS, AD_PROCESS_PARA,
AD_MENU, AD_MESSAGE, AD_TREENODE, AD_MODEL_OBJECT, AD_MODEL_OBJECT_MAPPING
** Remove java classes CostingMigrationProcess, CostingStatus,
ReportInvoiceCustomerDimensionalAnalysesJR_legacy, ReportParetoProductLegacy,
ReportValuationStock_legacy
** Remove java methods ProductInfo.getProductCosts,
ProductInfo.getProductItemCost, ActionButtonData.process1000500001,
ActionButtonData.process182, ActionButtonData.process800085,
ActionButtonData.process800151
** Remove fields Product.PROPERTY_COSTTYPE, Product.PROPERTY_STANDARDCOST,
Costing.PROPERTY_GOODSSHIPMENTLINE, Costing.PROPERTY_PRODUCTIONLINE and their
respective getter and setter methods

---
M java/reference/java.japi.gz
M model/src-db/database/model/functions/MA_PRODUCTION_COST.xml
M model/src-db/database/model/functions/MA_WORKEFFORT_VALIDATE.xml
M model/src-db/database/model/functions/M_PRICELIST_CREATE.xml
M model/src-db/database/model/tables/M_COSTING.xml
M model/src-db/database/model/tables/M_PRODUCT.xml
M model/src-db/database/model/triggers/M_COSTING_RULE_TRG.xml
M model/src-db/database/model/triggers/M_COSTING_TRG.xml
M model/src-db/database/sourcedata/AD_AUXILIARINPUT.xml
M model/src-db/database/sourcedata/AD_COLUMN.xml
M model/src-db/database/sourcedata/AD_ELEMENT.xml
M model/src-db/database/sourcedata/AD_FIELD.xml
M model/src-db/database/sourcedata/AD_MENU.xml
M model/src-db/database/sourcedata/AD_MESSAGE.xml
M model/src-db/database/sourcedata/AD_MODEL_OBJECT.xml
M model/src-db/database/sourcedata/AD_MODEL_OBJECT_MAPPING.xml
M model/src-db/database/sourcedata/AD_PROCESS.xml
M model/src-db/database/sourcedata/AD_PROCESS_PARA.xml
M model/src-db/database/sourcedata/AD_REF_LIST.xml
M model/src-db/database/sourcedata/AD_TEXTINTERFACES.xml
M model/src-db/database/sourcedata/AD_TREENODE.xml
M model/src-db/database/sourcedata/AD_VAL_RULE.xml
R model/src-db/database/model/functions/MA_PRODUCTION_COST_GENERATE.xml
R model/src-db/database/model/functions/M_GENERATE_AVERAGE_COSTS.xml
R model/src-db/database/model/functions/M_GENERATE_STANDARD_COSTS.xml
R model/src-db/database/model/functions/M_GET_PARETO_ABC_LEGACY.xml
R model/src-db/database/model/functions/M_GET_TRANSACTION_COST.xml
R model/src-db/database/model/functions/M_GET_TRX_AND_PRODUCT_COST.xml
R model/src-db/database/model/functions/M_UPDATE_PARETO_PRODUCT0LEGACY.xml
R model/src-db/database/model/functions/M_UPDATE_PARETO_PRODUCT_LEGACY.xml
---
(0115071)
hgbot   
2019-10-14 15:25   
Repository: erp/devel/api-checks
Changeset: b2cdf8787eea728426806cc0b5ec24349d1b7b83
Author: Atul Gaware <atul.gaware <at> openbravo.com>
Date: Mon Oct 14 18:54:24 2019 +0530
URL: http://code.openbravo.com/erp/devel/api-checks/rev/b2cdf8787eea728426806cc0b5ec24349d1b7b83 [^]

Related TO Issue 41422: Remove AD_Message registers related to legacy
cost engine

** Removed messages with value NoMoreMessages, CannotCalcPrevCost
CannotCalcCosts, NoNewCostingGenerationNeeded,

---
M model/src-db/database/sourcedata/AD_MESSAGE.xml
---
(0115132)
aferraz   
2019-10-17 08:30   
Code review OK