Openbravo Issue Tracking System - Openbravo ERP
View Issue Details
0013031Openbravo ERP07. Sales managementpublic2010-04-19 12:552010-05-18 21:43
networkb 
sivaraman 
urgentmajoralways
closedfixed 
5
2.40MP12 
2.40MP13 
Core
No
0013031: The shipment and invoice created after complete a POS Order have wrong data in the createdby and updatedby fields
The shipment and invoice created after complete a POS Order have wrong data in the createdby and updatedby fields
-Login as Openbravo admin
-Enable on the session preferences the option to see the audit
-Create a sales order selecting the document type POS Order
-Add a line
-Complete the order.
-See that the new shipment and invoice created automatically
have the updatedby and createdby feles filled with "System Admin"
No tags attached.
related to defect 00130232.40MP13 closed harikrishnan When completing or processing documents the updatedby column is not updated properly 
depends on backport 00130532.40MP13 closed sivaraman The shipment and invoice created after complete a POS Order have wrong data in the createdby and updatedby fields 
related to defect 00130332.40MP13 closed adrianromero The create shipment from order process does not fill well the audit fields. 
Issue History
2010-04-19 12:55networkbNew Issue
2010-04-19 12:55networkbAssigned To => adrianromero
2010-04-19 12:55networkbRelationship addedrelated to 0013024
2010-04-19 12:57networkbRelationship addedrelated to 0013033
2010-04-19 13:11networkbversion => 2.40MP12
2010-04-19 13:11networkbTarget Version => 2.40MP13
2010-04-19 13:18networkbNote Added: 0026342
2010-04-20 09:57adrianromeroRelationship deletedrelated to 0013024
2010-04-20 09:57adrianromeroRelationship addedrelated to 0013023
2010-04-20 12:56adrianromeroSticky IssueNo => Yes
2010-04-20 12:57adrianromeroSticky IssueYes => No
2010-04-20 12:57adrianromeroStatusnew => scheduled
2010-04-20 12:57adrianromerofix_in_branch => pi
2010-04-20 12:57adrianromeroIssue cloned0013053
2010-04-20 12:57adrianromeroRelationship addeddepends on 0013053
2010-05-04 17:51sivaramanAssigned Toadrianromero => sivaraman
2010-05-04 17:54hgbotCheckin
2010-05-04 17:54hgbotNote Added: 0026935
2010-05-04 17:54hgbotStatusscheduled => resolved
2010-05-04 17:54hgbotResolutionopen => fixed
2010-05-04 17:54hgbotFixed in SCM revision => http://code.openbravo.com/erp/stable/2.40/rev/66ae42fbee99404bf43db5b22a0ded8f610fce73 [^]
2010-05-04 18:03hgbotCheckin
2010-05-04 18:03hgbotNote Added: 0026938
2010-05-04 18:03hgbotFixed in SCM revisionhttp://code.openbravo.com/erp/stable/2.40/rev/66ae42fbee99404bf43db5b22a0ded8f610fce73 [^] => http://code.openbravo.com/erp/devel/pi/rev/8d31064fd72c402ed356d772ab12d82fcaa7d86a [^]
2010-05-04 18:28sivaramanNote Added: 0026940
2010-05-06 11:10arunkumarNote Added: 0026977
2010-05-06 11:10arunkumarStatusresolved => closed
2010-05-07 00:00anonymoussf_bug_id0 => 2997915
2010-05-18 21:43hudsonbotCheckin
2010-05-18 21:43hudsonbotNote Added: 0027480

Notes
(0026342)
networkb   
2010-04-19 13:18   
it happens also in 2.50
(0026935)
hgbot   
2010-05-04 17:54   
Repository: erp/stable/2.40
Changeset: 66ae42fbee99404bf43db5b22a0ded8f610fce73
Author: Sivaraman Rajagopal <sivaraman.rajagopal <at> openbravo>
Date: Tue May 04 21:22:53 2010 +0530
URL: http://code.openbravo.com/erp/stable/2.40/rev/66ae42fbee99404bf43db5b22a0ded8f610fce73 [^]

Fixes issue 13031: The shipment and invoice created after complete a POS Order have wrong data in the createdby and updatedby fields

---
M src-db/database/model/functions/C_INVOICE_CREATE.xml
M src-db/database/model/functions/C_ORDER_POST1.xml
---
(0026938)
hgbot   
2010-05-04 18:03   
Repository: erp/devel/pi
Changeset: 8d31064fd72c402ed356d772ab12d82fcaa7d86a
Author: Sivaraman Rajagopal <sivaraman.rajagopal <at> openbravo.com>
Date: Tue May 04 21:32:01 2010 +0530
URL: http://code.openbravo.com/erp/devel/pi/rev/8d31064fd72c402ed356d772ab12d82fcaa7d86a [^]

Fixes issue 13031: The shipment and invoice created after complete a POS Order have wrong data in the createdby and updatedby fields

---
M src-db/database/model/functions/C_INVOICE_CREATE.xml
---
(0026940)
sivaraman   
2010-05-04 18:28   
Steps to test:
1. Log on to Openbravo
2. Change user role to Openbravo Admin
3. Go to General Setup || Application || Session Preferences || Session Preferences
4. Enable Show audit and Save
5. Go to Sales Management || Transactions || Sales Order || Header
6. Create new sales order selecting the document type POS Order
7. Add a line with any product
8. Save and complete the order by clicking 'Complete' button

Root cause:
While completing the sales order, 'p_PInstance_ID' is validated in C_INVOICE_CREATE procedure. As sales order completion is not processed through 'p_PInstance_ID', it gets NULL value and therefore default user ID (0) is assigned while creating sales invoice. User ID of AD_PINSTANCE will be assigned only if 'p_PInstance_ID' is not null. To avoid setting default value for always, we have added a SELECT clause to fetch proper user ID value from C_ORDER table. In 2.40 version, additionally we have modified C_ORDER_POST1.xml in order to update 'UPDATEDBY' column.

Impact:
It has been verified that the fix resolves the issue without any other impact.
(0026977)
arunkumar   
2010-05-06 11:10   
Tested working fine
(0027480)
hudsonbot   
2010-05-18 21:43   
A changeset related to this issue has been promoted to main after passing a series of tests and an OBX has been generated:

Changeset: http://code.openbravo.com/erp/devel/main/rev/8d31064fd72c [^]
Merge Changeset: http://code.openbravo.com/erp/devel/main/rev/aa11838d5f80 [^]
Tests: http://builds.openbravo.com/view/devel-int/ [^]
OBX: http://builds.openbravo.com/erp/core/obx/OpenbravoERP-2.50CI.17380.obx [^]