Openbravo Issue Tracking System - Openbravo ERP
View Issue Details
0015594Openbravo ERP07. Sales managementpublic2011-01-10 12:142011-04-05 13:28
maite 
adrianromero 
highminoralways
closedfixed 
5
2.50MP25 
2.50MP27 
Core
No
0015594: Not possible to modify available fields of Discount line when order is processed
When creating an order you can add a Discount in Discount tab. Then you process the order and new line with this discount is added in the order. If you try to modify available field in this line you obtain error message as Business Partner and Partner Address fields are not filled when creating Discount line.
1. Sales Management || Transactions || Sales Order || Header : Create Sales Order Header
2. Sales Management || Transactions || Sales Order || Header >> Lines : Add one Order line with Line Amount <> 0
3. Sales Management || Transactions || Sales Order || Header >> Discounts: Add one line in Discount Tab with a discount with discount percent <> 0
4. Complete the Sales Order
5. Go to the new created line corresponding to the discount
6. Update Description field
7. Try to save
No tags attached.
depends on defect 0016321 closed adrianromero Not possible to modify available fields of Discount line when order is processed 
has duplicate defect 0016070 closed adrianromero Wrong behaviour in discount sales order lines 
related to backport 00168322.50MP29 closed dalsasua A trigger condition in c_orderline has been added and can cause problems in special conditions 
Issue History
2011-01-10 12:14maiteNew Issue
2011-01-10 12:14maiteAssigned To => adrianromero
2011-01-10 12:14maiteModules => Core
2011-03-16 12:29adrianromeroStatusnew => scheduled
2011-03-16 12:29adrianromeroTypedefect => backport
2011-03-16 12:29adrianromeroIssue cloned0016321
2011-03-16 12:29adrianromeroRelationship addeddepends on 0016321
2011-03-16 12:34hgbotCheckin
2011-03-16 12:34hgbotNote Added: 0034933
2011-03-16 12:34hgbotStatusscheduled => resolved
2011-03-16 12:34hgbotResolutionopen => fixed
2011-03-16 12:34hgbotFixed in SCM revision => http://code.openbravo.com/erp/stable/2.50/rev/03df43a71e8c65e07ecbf46d8d99ade28df1d3a5 [^]
2011-03-17 09:39hgbotCheckin
2011-03-17 09:39hgbotNote Added: 0034971
2011-03-17 11:13adrianromeroRelationship addedduplicate of 0016070
2011-03-17 11:14hgbotCheckin
2011-03-17 11:14hgbotNote Added: 0034983
2011-03-17 11:14hgbotFixed in SCM revisionhttp://code.openbravo.com/erp/stable/2.50/rev/03df43a71e8c65e07ecbf46d8d99ade28df1d3a5 [^] => http://code.openbravo.com/erp/stable/2.50/rev/3d47b2a6d255b3b8a4d41961b437bba23a2c0890 [^]
2011-03-17 11:15adrianromeroRelationship replacedhas duplicate 0016070
2011-03-22 11:07maiteNote Added: 0035132
2011-03-22 11:07maiteStatusresolved => new
2011-03-22 11:07maiteResolutionfixed => open
2011-03-22 13:24adrianromeroNote Added: 0035144
2011-03-22 13:27adrianromeroNote Edited: 0035144bug_revision_view_page.php?bugnote_id=0035144#r1673
2011-03-28 16:27jonalegriaesarteStatusnew => scheduled
2011-03-28 16:27jonalegriaesartefix_in_branch => pi
2011-03-28 16:28jonalegriaesarteStatusscheduled => resolved
2011-03-28 16:28jonalegriaesarteFixed in Version => 2.50MP28
2011-03-28 16:28jonalegriaesarteResolutionopen => fixed
2011-03-28 16:28jonalegriaesarteNote Added: 0035276
2011-03-28 16:28jonalegriaesarteStatusresolved => closed
2011-04-01 12:32hgbotCheckin
2011-04-01 12:32hgbotNote Added: 0035452
2011-04-01 12:32hgbotStatusclosed => resolved
2011-04-01 12:32hgbotFixed in SCM revisionhttp://code.openbravo.com/erp/stable/2.50/rev/3d47b2a6d255b3b8a4d41961b437bba23a2c0890 [^] => http://code.openbravo.com/erp/stable/2.50/rev/db632ec7ce27da15965b5df28b26fc8fcd9f0d41 [^]
2011-04-05 13:28maiteNote Added: 0035602
2011-04-05 13:28maiteStatusresolved => closed
2011-04-05 13:28maiteFixed in Version2.50MP28 =>
2011-04-15 15:15jonalegriaesarteRelationship addedblocks 0016831
2011-04-15 15:41dalsasuaRelationship addedrelated to 0016832
2011-04-15 15:42dalsasuaRelationship deletedblocks 0016831

Notes
(0034933)
hgbot   
2011-03-16 12:34   
Repository: erp/stable/2.50
Changeset: 03df43a71e8c65e07ecbf46d8d99ade28df1d3a5
Author: Adrián Romero <adrianromero <at> openbravo.com>
Date: Wed Mar 16 12:32:39 2011 +0100
URL: http://code.openbravo.com/erp/stable/2.50/rev/03df43a71e8c65e07ecbf46d8d99ade28df1d3a5 [^]

Fixes issue 0015594: Not possible to modify available fields of Discount line when order is processed
It has been hidden the fields Business Partner and Partner Address for lines that are discounts. It has been removed the mandatory flag for Partner address and it has been added this removed logic to the trigger. Now Partner Address is mandatory only for lines that are not discounts.

---
M src-db/database/model/triggers/C_ORDLINE_CHK_RESTRICTIONS_TRG.xml
M src-db/database/sourcedata/AD_COLUMN.xml
M src-db/database/sourcedata/AD_FIELD.xml
M src-db/database/sourcedata/AD_MESSAGE.xml
---
(0034971)
hgbot   
2011-03-17 09:39   
Repository: erp/stable/2.50
Changeset: edf90f26beeda45eb7d784e8615fa71fdfd3895d
Author: Adrián Romero <adrianromero <at> openbravo.com>
Date: Thu Mar 17 09:37:28 2011 +0100
URL: http://code.openbravo.com/erp/stable/2.50/rev/edf90f26beeda45eb7d784e8615fa71fdfd3895d [^]

Backed out changeset 03df43a71e8c
Issue 15594

---
M src-db/database/model/triggers/C_ORDLINE_CHK_RESTRICTIONS_TRG.xml
M src-db/database/sourcedata/AD_COLUMN.xml
M src-db/database/sourcedata/AD_FIELD.xml
M src-db/database/sourcedata/AD_MESSAGE.xml
---
(0034983)
hgbot   
2011-03-17 11:14   
Repository: erp/stable/2.50
Changeset: 3d47b2a6d255b3b8a4d41961b437bba23a2c0890
Author: Adrián Romero <adrianromero <at> openbravo.com>
Date: Thu Mar 17 11:04:56 2011 +0100
URL: http://code.openbravo.com/erp/stable/2.50/rev/3d47b2a6d255b3b8a4d41961b437bba23a2c0890 [^]

Fixes issue 0015594: Not possible to modify available fields of Discount line when order is processed
It has been hidden the fields Business Partner and Partner Address for lines that are discounts. It has been removed the mandatory flag for Partner address and it has been added this removed logic to the trigger. Now Partner Address is mandatory only for lines that are not discounts.

---
M src-db/database/model/triggers/C_ORDLINE_CHK_RESTRICTIONS_TRG.xml
M src-db/database/sourcedata/AD_COLUMN.xml
M src-db/database/sourcedata/AD_FIELD.xml
M src-db/database/sourcedata/AD_MESSAGE.xml
---
(0035132)
maite   
2011-03-22 11:07   
Reported error is not obtained any more, but when trying to modify 'description' field in discount line I obtain error "Document posted/processed". I should be able to modify description discount line as I am able to modify description in rest of lines
(0035144)
adrianromero   
2011-03-22 13:24   
(edited on: 2011-03-22 13:27)
The issue now is because in this specific configuration currency prices in the database have a precision of 4 decimals and in the Format.xml configuration file prices have a precision of 2 decimals.

With this configuration, discount line ammounts have a precision of 4 decimals when generated in the complete order process.

But whe trying to save the new description once the order has been completed, the precision used to format prices in the windows is 2 decimals then when saving the new description ammounts are diferent because of the different precisions and an exception is raised because it detects different amounts in a complete order.

A way to workaround this is to set the same precision for prices in the currency records and in the "priceEdition" entry in the Format.xml configuration file.

(0035276)
jonalegriaesarte   
2011-03-28 16:28   
Verified
(0035452)
hgbot   
2011-04-01 12:32   
Repository: erp/stable/2.50
Changeset: db632ec7ce27da15965b5df28b26fc8fcd9f0d41
Author: Adrián Romero <adrianromero <at> openbravo.com>
Date: Thu Mar 24 18:29:27 2011 +0100
URL: http://code.openbravo.com/erp/stable/2.50/rev/db632ec7ce27da15965b5df28b26fc8fcd9f0d41 [^]

Fixes issue 0015594: Not possible to modify available fields of Discount line when order is processed
It has been modified the precision of prices to 2 to be consistent with the precision used for prices in the configuration file Formats.xml

---
M src-db/database/sourcedata/referencedData/C_CURRENCY.xml
---
(0035602)
maite   
2011-04-05 13:28   
verified