Openbravo Issue Tracking System - Openbravo ERP
View Issue Details
0015667Openbravo ERP07. Sales managementpublic2011-01-16 00:472011-02-18 11:53
malsasua 
adrianromero 
urgentmajoralways
closedsuspended 
20Community Appliance
2.50MP25 
2.50MP27 
Core
No
0015667: A sales order with discount cannot be reactivated
if there is a sales order with discount, and it is invoiced, but after that, the invoice is voided, if you try reactivate the sales order, error is returned
. business partner with discount with check "apply in order" selected
. create a new sales order "warehouse order"
. process the order
. create and process a new invoice from sales order
. the invoice is voided
. if you try reactivate the sales order, error is returned: "update o delete en «c_orderline» viola la llave foránea «c_invoiceline_c_orderline» en la tabla «c_invoiceline»"
No tags attached.
related to backport 0016056 closed mirurita A sales order with discount cannot be reactivated nor closed 
blocks defect 0015929 closed adrianromero A sales order with discount cannot be reactivated 
Issue History
2011-01-16 00:47malsasuaNew Issue
2011-01-16 00:47malsasuaAssigned To => adrianromero
2011-01-16 00:47malsasuaModules => Core
2011-01-16 00:49malsasuaIssue Monitored: networkb
2011-02-04 11:05adrianromeroNote Added: 0034053
2011-02-09 13:27adrianromeroTarget Version2.50MP26 => 2.50MP27
2011-02-10 16:16adrianromeroStatusnew => scheduled
2011-02-10 16:16adrianromerofix_in_branch => pi
2011-02-10 16:16adrianromeroTypedefect => backport
2011-02-10 16:16adrianromerofix_in_branchpi =>
2011-02-10 16:16adrianromeroIssue cloned0015929
2011-02-10 16:16adrianromeroRelationship addedblocks 0015929
2011-02-18 11:52adrianromeroNote Added: 0034259
2011-02-18 11:53adrianromeroStatusscheduled => closed
2011-02-18 11:53adrianromeroResolutionopen => suspended
2011-02-25 12:24adrianromeroRelationship addedblocks 0016056
2011-02-25 12:25adrianromeroRelationship deletedblocks 0016056
2011-02-25 12:25adrianromeroRelationship addedrelated to 0016056

Notes
(0034053)
adrianromero   
2011-02-04 11:05   
It seems that the problem is because when reactivating the order, the process is trying to delete the discount lines generated when it was completed that is ok. The problem is that these discount lines are referenced by the invoice voided and a reference error is raised.

The solution seems simple. When voiding an invoice the reference to order lines in the discount lines of the invoices must be removed. This way the order will be reactivated without any problem.

The only risk here is that there can be problems when removing this reference to order lines when voiding an invoice but it seems that no.
(0034259)
adrianromero   
2011-02-18 11:52   
Currently it is not implemented the functionality of reactivating orders with discounts and with a related shipment or invoice voided.

This functionality must be analyzed and implemented.