Openbravo Issue Tracking System - Openbravo ERP
View Issue Details
0037939Openbravo ERP07. Sales managementpublic2018-02-15 17:312018-03-05 16:55
ngarcia 
markmm82 
urgentmajoralways
closedfixed 
5
 
3.0PR18Q2 
dmiguelez
Core
No
0037939: Cannot confirm Cancel and Replace if a Service Product related to a product was included on the Sales Order
Cannot confirm Cancel and Replace if a Service Product related to a product was included on the Sales Order
As group admin role:
   Set 'Enable Cancel and Replace' preference to Y
   Log out and log in

   Create a new product:
      Product Type: Service
      Linked to Product: Y
      Included Products: Only those defined
      Quantity Rule: As per product
   Add a sales price to it
   Launch Relate Products process and select a product

   Create a new sales order
   Add both service product and related product to it
   Select service product line and launch Select Order Line process
   Select the other line and Done
   Book it
   Click in Cancel and Replace
   Try to Confirme Cancel and Replace and check the following error message is shown:
      org.postgresql.util.PSQLException: ERROR: Missing Service Relation. At least one order line contains a service linked to product but relation to the product is missing Where: SQL statement "SELECT C_ORDER_POST1($1, $2, 'Y')" PL/pgSQL function c_order_post1(character varying,character varying) line 3 at PERFORM
No tags attached.
related to defect 0037938 new Triage Omni OMS Documentation about Linked To Product checkbox in Product window is missing 
Issue History
2018-02-15 17:31ngarciaNew Issue
2018-02-15 17:31ngarciaAssigned To => Triage Finance
2018-02-15 17:31ngarciaModules => Core
2018-02-15 17:31ngarciaResolution time => 1520463600
2018-02-15 17:31ngarciaTriggers an Emergency Pack => No
2018-02-15 17:32ngarciaRelationship addedrelated to 0037938
2018-02-15 17:32ngarciaIssue Monitored: networkb
2018-02-27 00:09markmm82Assigned ToTriage Finance => markmm82
2018-02-27 00:09markmm82Statusnew => acknowledged
2018-02-27 23:06markmm82Statusacknowledged => scheduled
2018-02-28 20:38markmm82Note Added: 0102881
2018-03-02 11:38dmiguelezNote Added: 0102913
2018-03-05 09:35hgbotCheckin
2018-03-05 09:35hgbotNote Added: 0102970
2018-03-05 09:35hgbotStatusscheduled => resolved
2018-03-05 09:35hgbotResolutionopen => fixed
2018-03-05 09:35hgbotFixed in SCM revision => http://code.openbravo.com/erp/devel/pi/rev/77bc835034ea0198c5bf02f0247900ce3b802152 [^]
2018-03-05 09:35hgbotCheckin
2018-03-05 09:35hgbotNote Added: 0102971
2018-03-05 09:38dmiguelezReview Assigned To => dmiguelez
2018-03-05 09:38dmiguelezNote Added: 0102972
2018-03-05 09:38dmiguelezStatusresolved => closed
2018-03-05 09:38dmiguelezFixed in Version => 3.0PR18Q2
2018-03-05 16:55hudsonbotCheckin
2018-03-05 16:55hudsonbotNote Added: 0102984
2018-03-05 16:55hudsonbotCheckin
2018-03-05 16:55hudsonbotNote Added: 0102985

Notes
(0102881)
markmm82   
2018-02-28 20:38   
Test Plan:
As group admin role:
   Set 'Enable Cancel and Replace' preference to Y
   Log out and log in

   Create a new product:
      Name: Service Product
      Product Type: Service
      Linked to Product: Y
      Included Products: Only those defined
      Quantity Rule: As per product
   Add a sales price to it
   Launch Relate Products process and select a product, for instance Cerveza Ale 0,5L.

   Create a new sales order
   Add both service product (Service Product) and related product(Cerveza Ale 0,5L) to it
   Select service product line and launch Select Order Line process
   Select the other line and Done
   Book it
   Select service product line and go to Related Products tab, notice there is a relationship with the other line (with Cerveza Ale 0,5L product)
   Select the other line with Cerveza product and go to Related Services tab, notice there is a relationship with the other line (with Service product)

   Click in Cancel and Replace
   Notice that lines and their relationships are copied too.
   Try to Confirm Cancel and Replace and check it is completed successfully.
(0102913)
dmiguelez   
2018-03-02 11:38   
Test Plan:
As group admin role:
   Set 'Enable Cancel and Replace' preference to Y
   Log out and log in

   Create a new product:
      Name: Service Product
      Product Type: Service
      Linked to Product: Y
      Included Products: Only those defined
      Quantity Rule: As per product
   Add a sales price to it
   Launch Relate Products process and select 3 different products, for instance Cerveza Ale 0,5L and two more.

   Create a new sales order
   Add both service product (Service Product) and one line per each related product( like Cerveza Ale 0,5L) to it
   Select service product line and launch Select Order Line process
   Select the other lines (all three of them) and Done
   Book it
   Select service product line and go to Related Products tab, notice there is a relationship with the other lines (like with Cerveza Ale 0,5L product)
   Select the one of the other lines, like the one with Cerveza product and go to Related Services tab, notice there is a relationship with the other line (with Service product)

   Click in Cancel and Replace
   Notice that lines and their relationships are copied too.
   Try to Confirm Cancel and Replace and check it is completed successfully.
(0102970)
hgbot   
2018-03-05 09:35   
Repository: erp/devel/pi
Changeset: 77bc835034ea0198c5bf02f0247900ce3b802152
Author: Mark <markmm82 <at> gmail.com>
Date: Wed Feb 28 14:26:52 2018 -0500
URL: http://code.openbravo.com/erp/devel/pi/rev/77bc835034ea0198c5bf02f0247900ce3b802152 [^]

Fixes issue 37939:Cannot confirm Cancel and Replace if a Service Product related
to a product was included on the Sales Order

After the new lines were created in the Cancel and Replace process the relations
between services and products were not copied from the replaced order, due that
the Confirm and Cancel process was failing.

To fix that, if exists relationships between the lines of the creplaced order they
are copied taking as reference the new order lines.

---
M src/org/openbravo/erpCommon/businessUtility/CancelAndReplaceUtils.java
---
(0102971)
hgbot   
2018-03-05 09:35   
Repository: erp/devel/pi
Changeset: 22d1f25dbdeb6a554b4a918d06bfaf0f6051a925
Author: David Miguelez <david.miguelez <at> openbravo.com>
Date: Fri Mar 02 11:10:17 2018 +0100
URL: http://code.openbravo.com/erp/devel/pi/rev/22d1f25dbdeb6a554b4a918d06bfaf0f6051a925 [^]

Related to Issue 37939. Code Review changes:

* Added method to retrieve orderLines with related replaced orderline
  that has services associated to it
* Moved flush and added comment
* Changed method and variable names
* Reordered methods

---
M src/org/openbravo/erpCommon/businessUtility/CancelAndReplaceUtils.java
---
(0102972)
dmiguelez   
2018-03-05 09:38   
Code Review + Testing Ok
(0102984)
hudsonbot   
2018-03-05 16:55   
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/67b9804050d3 [^]
Maturity status: Test
(0102985)
hudsonbot   
2018-03-05 16:55   
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/67b9804050d3 [^]
Maturity status: Test