Openbravo Issue Tracking System - Openbravo ERP
View Issue Details
0042791Openbravo ERP02. Master data managementpublic2020-01-10 07:052020-01-21 13:19
AtulOpenbravo 
AtulOpenbravo 
normalminorhave not tried
closedfixed 
5
 
3.0PR20Q2 
dmiguelez
Core
No
0042791: Apply new HQL style in ServiceOrderLineRelate
1. Avoid use of StringBuilder use normal Strings.
2. HQL formatting is important for improving readability.
3. Avoid use of Property Constant for eg: OrderlineServiceRelation.PROPERTY_SALESORDERLINE
-
Follow new style available here http://wiki.openbravo.com/wiki/HQL_Coding_Conventions [^]
No tags attached.
Issue History
2020-01-10 07:05AtulOpenbravoNew Issue
2020-01-10 07:05AtulOpenbravoAssigned To => AtulOpenbravo
2020-01-10 07:05AtulOpenbravoModules => Core
2020-01-10 07:05AtulOpenbravoTriggers an Emergency Pack => No
2020-01-10 07:05AtulOpenbravoIssue generated from0042790
2020-01-14 11:23AtulOpenbravoStatusnew => scheduled
2020-01-14 11:23AtulOpenbravoNote Added: 0116841
2020-01-21 13:17hgbotCheckin
2020-01-21 13:17hgbotNote Added: 0117143
2020-01-21 13:17hgbotStatusscheduled => resolved
2020-01-21 13:17hgbotResolutionopen => fixed
2020-01-21 13:17hgbotFixed in SCM revision => http://code.openbravo.com/erp/devel/pi/rev/32c20ca1097d50f6a5e6c701d6a0129e41a546db [^]
2020-01-21 13:17hgbotCheckin
2020-01-21 13:17hgbotNote Added: 0117144
2020-01-21 13:17hgbotCheckin
2020-01-21 13:17hgbotNote Added: 0117145
2020-01-21 13:19dmiguelezReview Assigned To => dmiguelez
2020-01-21 13:19dmiguelezNote Added: 0117146
2020-01-21 13:19dmiguelezStatusresolved => closed
2020-01-21 13:19dmiguelezFixed in Version => 3.0PR20Q2

Notes
(0116841)
AtulOpenbravo   
2020-01-14 11:23   
Test Plan
- Define two products, Type: Item, purchase and sales price
- Define Service product, Type as:Service set Linked To Product = Yes, Include Product Categories: blank, Include Products : Only those Defined, Quantity Rule: As per Product
- Relate Products created in Step 1, Related Product Category of the Product created in step 1.
- Add Purchase and Sales Price.
- Create a Sales Order for any Business Partner
- Add all the three product created in the above steps
- Select the Service Product Line, realize that Select Order Line button is visible
- Click on it and realize that P&E window opens with other two products in the list
- Select the records, try to edit Relate Quantity
- Press Done button, realize that process is successful.
- Try to delete Service Product as well as Related Products in Order Line.
- It is successfully deleted.
(0117143)
hgbot   
2020-01-21 13:17   
Repository: erp/devel/pi
Changeset: 32c20ca1097d50f6a5e6c701d6a0129e41a546db
Author: Atul Gaware <atul.gaware <at> openbravo.com>
Date: Tue Jan 14 15:36:22 2020 +0530
URL: http://code.openbravo.com/erp/devel/pi/rev/32c20ca1097d50f6a5e6c701d6a0129e41a546db [^]

Fixes BUG-42791: Apply new HQL style in ServiceOrderLineRelate

**Avoid StringBuffer and use String for hql query string to
improve readability using formatter off on as required.
**Avoid use of Property Constant in query string.

---
M src/org/openbravo/common/actionhandler/ServiceOrderLineRelate.java
---
(0117144)
hgbot   
2020-01-21 13:17   
Repository: erp/devel/pi
Changeset: 13888fe66083d7e3b168d9c120d179950d4f8793
Author: Atul Gaware <atul.gaware <at> openbravo.com>
Date: Tue Jan 14 15:51:34 2020 +0530
URL: http://code.openbravo.com/erp/devel/pi/rev/13888fe66083d7e3b168d9c120d179950d4f8793 [^]

Related To ISSUE-42791: Apply new HQL style in ServiceOrderLineRelate,
apply SonarLint suggestion

**Use BigDecimal.valueOf() instead of new BigDecimal()
**Avoid if loop nesting by merging both if loop condn
**Avoid values true & false in return statement when using
ternary operator
**Avoid unnecessary assignment BigDecimal.ZERO to variable
listPrice

---
M src/org/openbravo/common/actionhandler/ServiceOrderLineRelate.java
---
(0117145)
hgbot   
2020-01-21 13:17   
Repository: erp/devel/pi
Changeset: fbb1a6a2b4cd2883e9ac549a53e849b36714fea0
Author: David Miguelez <david.miguelez <at> openbravo.com>
Date: Tue Jan 21 13:17:31 2020 +0100
URL: http://code.openbravo.com/erp/devel/pi/rev/fbb1a6a2b4cd2883e9ac549a53e849b36714fea0 [^]

Related to ISSUE-42791. Code Review changes:
* Simplify the call to the query object

---
M src/org/openbravo/common/actionhandler/ServiceOrderLineRelate.java
---
(0117146)
dmiguelez   
2020-01-21 13:19   
Code Review + Testing Ok