Openbravo Issue Tracking System - Openbravo ERP
View Issue Details
0043760Openbravo ERP07. Sales managementpublic2020-04-17 00:332020-05-07 15:47
matias-bernal 
inigo_lerga 
normalmajorhave not tried
closedfixed 
5
 
PR20Q3 
dmiguelez
Core
No
0043760: Error when trying to delete orphan lines orphan lines on Return from Customer window
After reactivating a Return from Customer record (with a line invoiced and received), we added an orphan line but we need to delete it now, the record is still on draft but we are getting an error when trying to delete the orphan line
RM Allow Orphan Line preference must be active
1- Create a sales order with a product, process it, invoice it and create the goods shipment
2- Create a Return from Customer, pick the sales order line, process it, invoice it and create the goods shipment
3- Reactivate the Return from Customer, insert an orphan line, then try to delete it

It gives the error: "You cannot delete the line because it has Delivered Quantity -4" but the return wasn't processed yet and the orphan line wasn't delivered yet either

https://www.youtube.com/watch?v=VFZmZvqnSCQ&feature=youtu.be [^]
See attached patch
No tags attached.
diff ad_table.diff (1,284) 2020-04-22 18:21
https://issues.openbravo.com/file_download.php?file_id=14364&type=bug
Issue History
2020-04-17 00:33matias-bernalNew Issue
2020-04-17 00:33matias-bernalAssigned To => Triage Finance
2020-04-17 00:33matias-bernalModules => Core
2020-04-17 00:33matias-bernalTriggers an Emergency Pack => No
2020-04-17 08:30PracticsIssue Monitored: Practics
2020-04-22 18:19matias-bernalProposed Solution updated
2020-04-22 18:21matias-bernalFile Added: ad_table.diff
2020-04-23 08:22dmiguelezResolution time => 1589320800
2020-04-29 08:47inigo_lergaStatusnew => scheduled
2020-04-29 08:47inigo_lergaAssigned ToTriage Finance => inigo_lerga
2020-04-30 14:00inigo_lergaNote Added: 0119504
2020-05-07 15:45hgbotCheckin
2020-05-07 15:45hgbotNote Added: 0119662
2020-05-07 15:45hgbotStatusscheduled => resolved
2020-05-07 15:45hgbotResolutionopen => fixed
2020-05-07 15:45hgbotFixed in SCM revision => http://code.openbravo.com/erp/devel/pi/rev/47e4ca0c5c1a59445d70fad5fffb90f42f03f80b [^]
2020-05-07 15:47dmiguelezNote Added: 0119663
2020-05-07 15:47dmiguelezReview Assigned To => dmiguelez
2020-05-07 15:47dmiguelezNote Added: 0119664
2020-05-07 15:47dmiguelezStatusresolved => closed
2020-05-07 15:47dmiguelezFixed in Version => 3.0PR20Q3

Notes
(0119504)
inigo_lerga   
2020-04-30 14:00   
--Test Plan Mantis--
Beforehand, the environment needs to have enabled the following preference:
- RM Allow Orphan Line

IN THE BACKEND - As the F&B International Group Admin role:
- Go to the Sales Order window and create a new record with
  "Alimentos y Supermercados, S.A" as Business Partner, leaving
  the rest of the fields as default.
  Go to the Lines tab and create a new line with "Cerveza Ale 0,5L"
  as product and 5 units as Ordered Quantity.
  Save the record and book it.
- Go to the Create Shipments from Orders window, select the previously
  created record and process it.
- Go to the Create Invoices from Orders window and select the previously
  created record and process it.
- Go to the Return from Customer window and create a new record with
  "Alimentos y Supermercados, S.A" as Business Partner, leaving
  the rest of the fields as default.
  Press the Pick/Edit Lines button and select the 5 units of Cerveza Ale of
  the previously created Sales Order. Set 5 as Returned Quantity.
  Book the record.
- Go to the Return Material Receipt window and create a new record with
  "Alimentos y Supermercados, S.A" as Business Partner, leaving
  the rest of the fields as default.
  Press the Pick/Edit Lines button and select the 5 units of Cerveza Ale of
  the previously created Sales Order.
  Complete the record.
- Go to the Sales Invoice window and create a new record with
  "Alimentos y Supermercados, S.A" as Business Partner, leaving
  the rest of the fields as default.
  Press the Create Lines From Shipment and select the 5 units of Cerveza Ale of
  the previously created Sales Order.
  Complete the record.
- Go back to the Return from Customer window and press the Close button. Select
  the Reactivate option.
- Press the Insert Orphan Line button and select "Bebida Energética 0,5L" as product
  and 2 units as Returned.
- Press the Pick/Edit Line button and deselect the Orphan Line just created.

#In this moment the modified code is executed (properly working) and no error is thrown#
(0119662)
hgbot   
2020-05-07 15:45   
Repository: erp/devel/pi
Changeset: 47e4ca0c5c1a59445d70fad5fffb90f42f03f80b
Author: Iñigo Lerga <inigo.lerga <at> openbravo.com>
Date: Thu Apr 30 09:20:08 2020 +0200
URL: http://code.openbravo.com/erp/devel/pi/rev/47e4ca0c5c1a59445d70fad5fffb90f42f03f80b [^]

fixes BUG-43760:Added salesOrderLine field to hql table

---
M src-db/database/sourcedata/AD_TABLE.xml
---
(0119663)
dmiguelez   
2020-05-07 15:47   
The fix reintroduces a column that was lost in some refactors into the query.
This column is used to manage which columns need to be deleted from the pick and edit, without it, all the columns were deleted and created as new ones.
(0119664)
dmiguelez   
2020-05-07 15:47   
Code Review + Testing Ok