Openbravo Issue Tracking System - Openbravo ERP
View Issue Details
0046501Openbravo ERP03. Procurement managementpublic2021-05-05 06:562021-05-17 16:20
lbressan 
vmromanos 
normalmajoralways
closedfixed 
5
 
PR21Q3 
dmiguelez
Core
No
0046501: The lines of requisition do not allow to put quantity less than 1.
The lines of requisition do not allow to put quantity less than 1.
Create requisition.
Create requisition line. Put quantity less than 1.
No tags attached.
Issue History
2021-05-05 06:56lbressanNew Issue
2021-05-05 06:56lbressanAssigned To => Triage Finance
2021-05-05 06:56lbressanModules => Core
2021-05-05 06:56lbressanResolution time => 1621893600
2021-05-05 06:56lbressanTriggers an Emergency Pack => No
2021-05-05 08:34PracticsIssue Monitored: Practics
2021-05-05 11:22dmiguelezReview Assigned To => dmiguelez
2021-05-05 11:22dmiguelezNote Added: 0127819
2021-05-05 11:22dmiguelezStatusnew => closed
2021-05-05 11:22dmiguelezResolutionopen => invalid
2021-05-05 14:43PracticsNote Added: 0127831
2021-05-05 15:44dmiguelezNote Added: 0127833
2021-05-05 15:44dmiguelezStatusclosed => new
2021-05-05 15:44dmiguelezResolutioninvalid => open
2021-05-11 14:15vmromanosStatusnew => scheduled
2021-05-11 14:15vmromanosAssigned ToTriage Finance => vmromanos
2021-05-11 17:51vmromanosNote Added: 0128007
2021-05-12 11:16hgbotNote Added: 0128033
2021-05-17 16:20hgbotResolutionopen => fixed
2021-05-17 16:20hgbotStatusscheduled => closed
2021-05-17 16:20hgbotFixed in Version => PR21Q3
2021-05-17 16:20hgbotNote Added: 0128261
2021-05-17 16:20hgbotNote Added: 0128262

Notes
(0127819)
dmiguelez   
2021-05-05 11:22   
This is not an issue, it is the expected behavior.

From a functional point of view, within the Openbravo context, it does not make sense to create negative lines within a Requisition.

However, if the client is working with a different scenario, this can be easily customized through Application Dictionary.
It is possible to change the Min. Value of the Quantity column of the ProcurementRequisitionLine Table through a custom template
(0127831)
Practics   
2021-05-05 14:43   
David, no es poder meter líneas negativas. Sino que no permite poner 0,5 y esto debe ser posible.
(0127833)
dmiguelez   
2021-05-05 15:44   
Thanks to the updated explanation of this issue we can consider this problem something to be fixed.

The solution should have 2 steps:

1. Update the definition of the Min. Value in Application Dictionary to 0

2. Ensure that only values greater than 0 are introduced by (0 should not be allowed):
- Option 1: Create a constraint in the DB (this implies to create a functional API change as the DB will be more restricted than before)
- Option 2: Create an Event Observer to implement this restriction
(0128007)
vmromanos   
2021-05-11 17:51   
Test plan:

Login as Openbravo admin
Go to Requisition window
Enter a new header and save it.
Create a new line. Fill the mandatory fields.
In quantity field enter 0 and save the record. Verify an error is raised.
In quantity field enter -1 and save the record. Verify an error is raised.
In quantity field enter -0.1 and save the record. Verify an error is raised
In quantity field enter 1 and save the record. Verify it's successfully saved.
In quantity field enter 0.01 and save the record. Verify it's successfully saved.
(0128033)
hgbot   
2021-05-12 11:16   
Merge Request created: https://gitlab.com/openbravo/product/openbravo/-/merge_requests/360 [^]
(0128261)
hgbot   
2021-05-17 16:20   
Directly closing issue as related merge request is already approved.

Repository: https://gitlab.com/openbravo/product/openbravo [^]
Changeset: 47d18499ac317c49f8608ee0a77e87d7cdedcb1e
Author: Víctor Martínez Romanos <victor.martinez@openbravo.com>
Date: 2021-05-17T14:19:32+00:00
URL: https://gitlab.com/openbravo/product/openbravo/-/commit/47d18499ac317c49f8608ee0a77e87d7cdedcb1e [^]

Fixed ISSUE-46501: Requisition line qty min value allows > 0

The min value of any quantity column has been changed from 1 to 1E-20, which
easily allows to save a value greater than 0 with enough precission.

Note that the NumericPropertyValidator.validate() is in charge of validating the number.
It uses the BigDecimal(String) constructor, where the param is "1E-20", which is a valid
string for this constructor.

---
M src-db/database/sourcedata/AD_COLUMN.xml
---
(0128262)
hgbot   
2021-05-17 16:20   
Merge request merged: https://gitlab.com/openbravo/product/openbravo/-/merge_requests/360 [^]