Openbravo Issue Tracking System - Openbravo ERP
View Issue Details
0038547Openbravo ERP07. Sales managementpublic2018-05-14 15:292018-06-05 17:29
ngarcia 
AtulOpenbravo 
urgentmajoralways
closedfixed 
5
 
3.0PR18Q3 
dmiguelez
Core
No
0038547: When cloning a sales order, exploded non stocked BOM product is related with the original order line
When cloning a sales order, exploded non stocked BOM product is related with the original order line

bom_parent_id field of the new order line is copied directly and it points to a line of other order
As group admin role:
   Create a product
      Stocked: N
      Bill Of Materials: Y
   Add a product in Bill Of Materials tab
   Verify BOM
   Add a sales price to it
   
   Create a sales order
   Include the previously created product
   Explode it
   Clone it (Copy Record toolbar button)

   Delete the line with the component product in the original sales order
   Try to delete the line with the BOM product and check the following error is shown:
      "This record cannot be deleted because it is associated with other existing elements. Please see Linked Items"
No tags attached.
related to defect 00265593.0PR14Q3 closed AtulOpenbravo Copy From Order process does not fill bom_parent_id information for non stocked BOM products list 
related to feature request 0038648 new Triage Finance Remove not used API 
Issue History
2018-05-14 15:29ngarciaNew Issue
2018-05-14 15:29ngarciaAssigned To => Triage Finance
2018-05-14 15:29ngarciaModules => Core
2018-05-14 15:29ngarciaTriggers an Emergency Pack => No
2018-05-14 15:29ngarciaIssue Monitored: networkb
2018-05-14 15:30PracticsIssue Monitored: Practics
2018-05-14 16:15ngarciaRelationship addedrelated to 0026559
2018-05-15 09:34aferrazAssigned ToTriage Finance => AtulOpenbravo
2018-05-17 22:04AtulOpenbravoStatusnew => scheduled
2018-05-22 00:11AtulOpenbravoNote Added: 0104626
2018-05-22 00:12AtulOpenbravoNote Edited: 0104626bug_revision_view_page.php?bugnote_id=0104626#r17167
2018-05-22 00:42AtulOpenbravoNote Edited: 0104626bug_revision_view_page.php?bugnote_id=0104626#r17168
2018-05-22 00:43AtulOpenbravoNote Edited: 0104626bug_revision_view_page.php?bugnote_id=0104626#r17169
2018-05-29 12:19dmiguelezNote Added: 0104765
2018-05-29 12:31dmiguelezRelationship addedrelated to 0038648
2018-05-31 15:46hgbotCheckin
2018-05-31 15:46hgbotNote Added: 0104843
2018-05-31 15:46hgbotStatusscheduled => resolved
2018-05-31 15:46hgbotResolutionopen => fixed
2018-05-31 15:46hgbotFixed in SCM revision => http://code.openbravo.com/erp/devel/pi/rev/85397f1d9ed3e5e475e1962e8519851dc2e489f3 [^]
2018-05-31 15:46hgbotCheckin
2018-05-31 15:46hgbotNote Added: 0104844
2018-05-31 15:47dmiguelezReview Assigned To => dmiguelez
2018-05-31 15:47dmiguelezNote Added: 0104845
2018-05-31 15:47dmiguelezStatusresolved => closed
2018-05-31 15:47dmiguelezFixed in Version => 3.0PR18Q3
2018-06-05 17:29hudsonbotCheckin
2018-06-05 17:29hudsonbotNote Added: 0104953
2018-06-05 17:29hudsonbotCheckin
2018-06-05 17:29hudsonbotNote Added: 0104954

Notes
(0104626)
AtulOpenbravo   
2018-05-22 00:11   
(edited on: 2018-05-22 00:43)
Test Plan

- Login as F&B International Group Admin role:
- Create a product with name "Test BOM A", Stocked: Y,
  Add a sales price to it.
- Create a product with name "Test BOM B", Stocked: Y,
  Add a sales price to it.
- Create a product with name "Test BOM", Stocked: N, Bill Of Materials: Y
  Add a sales price to it.
- Add products Test BOM A and Test BOM B in Bill Of Materials tab
- Verify BOM
- Create a sales order for any business partner.
- Include the previously created product "Test BOM".
   Explode it
- Refresh Order and realize that Test BOM A and Test BOM B products are added in Lines.
- Make a clone of order using Copy Record toolbar button.
- Realize that new order with similar product line for Test BOM is created as in the original order along with Test BOM A and Test BOM B products.
- Now try to delete Test BOM product line from original order. Line cannot be deleted as it is linked as BOM Parent only in the original order lines with product Test BOM A and Test BOM B. This is correct.
- Now delete Test BOM A and Test BOM B lines from original order (As Test BOM is linked to this two product lines as BOM Parent) and then delete Test BOM order line from original order. It is possible to delete and is correct.

(0104765)
dmiguelez   
2018-05-29 12:19   
Test Plan II:

1. Create a new BOM Product:
Go to Product Window and create a new record with:
  - Organization: *
  - SearchKey: TestBOM
  - Name: TestBOM
  - Stocked: N
  - Bill Of Materials: Y
Move to Bill of Materials Tab and create a new record with:
  - BOM Product: Ale Beer
  - BOM Quantity: 1
Click on Verify BOM Button
Move to Price Tab and create two new records with:
  - Price List Version: Be Soft Drinker Price List
  - Unit Price: 10
  - List Price: 10
  - Price List Version: General Sales
  - Unit Price: 10
  - List Price: 10

2. Create a new Service Product:
Go to Product Window and create a new record with:
  - Organization: *
  - SearchKey: TestService
  - Name: TestService
  - Product Type: Service
  - Linked to Product: Y
  - Included Products: All excluding defined
  - Quantity Rule: As per product
Move to Price Tab and create two new records with:
  - Price List Version: Be Soft Drinker Price List
  - Unit Price: 10
  - List Price: 10
  - Price List Version: General Sales
  - Unit Price: 10
  - List Price: 10

3. Create a new Sales Order:
Go to Sales Order Window and create a new record with:
  - Organization: F&B US
  - Business Partner: Healthy Food Supermarkets
Move to Lines and create a new record with:
  - Product: TestBOM
  - Ordered Quantity: 1
Click on Explode Button
Create another record with:
  - Product: TestService
  - Ordered Quantity: 1
Click on Select Order Line Button
Select the line with Product: Ale Beer
Check that in the Related Products Tab for TestService product there is a record for Ale Beer
Select in Ale Beer Order Line and check that in the Tab related services there is a record for TestService

4. Clone the Order and test:
Click on the Copy Order button
A new Order is created
Go back to the original Order and remove the lines in this order:
  - First the TestService line
  - Second the Ale Beer line
  - Finally the TestBOM line
Everything is deleted
Go back to the cloned Order and check that all the lines remain
Check that in the Related Products Tab for TestService product there is a record for Ale Beer
Select in Ale Beer Order Line and check that in the Tab related services there is a record for TestService
(0104843)
hgbot   
2018-05-31 15:46   
Repository: erp/devel/pi
Changeset: 85397f1d9ed3e5e475e1962e8519851dc2e489f3
Author: David Miguelez <david.miguelez <at> openbravo.com>
Date: Tue May 29 11:49:24 2018 +0200
URL: http://code.openbravo.com/erp/devel/pi/rev/85397f1d9ed3e5e475e1962e8519851dc2e489f3 [^]

Fixes Issue 38547. When cloning a sales order, exploded non
stocked BOM product is related with the original order line

* When an order line that has been created from an exploded
  BOM is created, it is added to a list to fix the relationship
  after cloning all order lines
* When all order lines are cloned, this relationship is fixed
  by pointing to the cloned order line of the parent bom product
* Moved logic for fixing services relationship into it's own method

---
M modules/org.openbravo.client.application/src/org/openbravo/client/application/businesslogic/CloneOrderActionHandler.java
---
(0104844)
hgbot   
2018-05-31 15:46   
Repository: erp/devel/pi
Changeset: 4e724a6b981c2d47eb64ea47ce1546f6c3e2ecf9
Author: David Miguelez <david.miguelez <at> openbravo.com>
Date: Tue May 29 12:30:08 2018 +0200
URL: http://code.openbravo.com/erp/devel/pi/rev/4e724a6b981c2d47eb64ea47ce1546f6c3e2ecf9 [^]

Related to Issue 38547. Code Refactor:

* Moved logic to clone order into it's own method
* Moved logic to clone order lines into it's own method
* Remove unnecessary save
* Reorder methods
* Add final modifiers to method parameters

---
M modules/org.openbravo.client.application/src/org/openbravo/client/application/businesslogic/CloneOrderActionHandler.java
---
(0104845)
dmiguelez   
2018-05-31 15:47   
Code Review + Testing Ok
(0104953)
hudsonbot   
2018-06-05 17:29   
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/8317f2f73d00 [^]
Maturity status: Test
(0104954)
hudsonbot   
2018-06-05 17:29   
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/8317f2f73d00 [^]
Maturity status: Test