Openbravo Issue Tracking System - Openbravo ERP
View Issue Details
0016512Openbravo ERP07. Sales managementpublic2011-03-28 12:562011-05-12 13:25
AinhoaPagola 
AinhoaPagola 
urgentmajorhave not tried
closedfixed 
20Ubuntu 8.4
 
3.0RC7 
Core
No
0016512: Error when creating shipments with negative quantities for products with negative stock
A "null value in column "c_uom_id" violates not-null constraint" error is displayed when a POS sales order with two lines with a negative amount of a product without stock is completed.
- Create a product and check as stocked. Link it to a pricelist
- Make sure the client allows negative stock
- Create a POS sales order with one line and a positive amount of the product. The product will have a negative amount on stock. Complete the order. The shipment and invoice will be created.
- Create a POS sales order with two lines. Both of them with negative amounts of the product. Complete the order. The error will be thrown because the shipment can not be created.

This issue only reproduces when the stocked quantity of the product is negative. I does not reproduce if different products are used.
The problem may be related to the Cursor Cur_Storage in the function m_inout_create.
No tags attached.
depends on backport 0016645 closed AinhoaPagola Error when creating shipments with negative quantities for products with negative stock 
Issue History
2011-03-28 12:56AinhoaPagolaNew Issue
2011-03-28 12:56AinhoaPagolaAssigned To => adrianromero
2011-03-28 12:56AinhoaPagolaModules => Core
2011-03-28 12:57AinhoaPagolaPrioritynormal => high
2011-03-29 09:11jpcalventeNote Added: 0035293
2011-03-29 10:10AinhoaPagolaPriorityhigh => urgent
2011-03-29 10:10AinhoaPagolaSeverityminor => major
2011-04-05 10:20AinhoaPagolaAssigned Toadrianromero => AinhoaPagola
2011-04-05 13:11AinhoaPagolaStatusnew => scheduled
2011-04-05 13:11AinhoaPagolafix_in_branch => pi
2011-04-06 13:03AinhoaPagolafix_in_branchpi =>
2011-04-06 13:03AinhoaPagolaSteps to Reproduce Updatedbug_revision_view_page.php?rev_id=1784#r1784
2011-04-20 09:37hgbotCheckin
2011-04-20 09:37hgbotNote Added: 0036023
2011-04-20 09:37hgbotStatusscheduled => resolved
2011-04-20 09:37hgbotResolutionopen => fixed
2011-04-20 09:37hgbotFixed in SCM revision => http://code.openbravo.com/erp/devel/pi/rev/601527a7b71ae8834d82716055388b39b3319cfe [^]
2011-04-28 17:14maiteNote Added: 0036179
2011-04-28 17:14maiteStatusresolved => closed
2011-04-28 17:14maiteFixed in Version => 3.0RC7
2011-04-29 00:00anonymoussf_bug_id0 => 3294643
2011-05-12 13:25hudsonbotCheckin
2011-05-12 13:25hudsonbotNote Added: 0036733

Notes
(0035293)
jpcalvente   
2011-03-29 09:11   
(JCA):
The possible solution is to change
m_inout_create(IN p_pinstance_id character varying, OUT p_inout_id character varying, IN p_order_id character varying, IN p_invoice_id character varying, IN p_forcedelivery character, IN p_locator_id character varying)

line 416, put v_LocatorQty>0 instead of v_LocatorQty<>0.

This should be tested with all possibilites
(0036023)
hgbot   
2011-04-20 09:37   
Repository: erp/devel/pi
Changeset: 601527a7b71ae8834d82716055388b39b3319cfe
Author: Ainhoa Pagola <ainhoa.pagola <at> openbravo.com>
Date: Mon Apr 11 18:10:06 2011 +0200
URL: http://code.openbravo.com/erp/devel/pi/rev/601527a7b71ae8834d82716055388b39b3319cfe [^]

Fixes issue 16512. Error in shipments with negative quantities and negative stock

---
M src-db/database/model/functions/M_INOUT_CREATE.xml
---
(0036179)
maite   
2011-04-28 17:14   
verfied
(0036733)
hudsonbot   
2011-05-12 13:25   
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/c40e579fcd38 [^]

Maturity status: Test