Openbravo Issue Tracking System - Openbravo ERP | |||||
View Issue Details | |||||
ID | Project | Category | View Status | Date Submitted | Last Update |
0045341 | Openbravo ERP | A. Platform | public | 2020-10-30 09:54 | 2020-11-09 12:30 |
Reporter | gorkaion | ||||
Assigned To | cberner | ||||
Priority | high | Severity | major | Reproducibility | always |
Status | closed | Resolution | fixed | ||
Platform | OS | 5 | OS Version | ||
Product Version | |||||
Target Version | Fixed in Version | PR21Q1 | |||
Merge Request Status | approved | ||||
Review Assigned To | |||||
OBNetwork customer | Gold | ||||
Web browser | |||||
Modules | Core | ||||
Support ticket | 19408 | ||||
Regression level | |||||
Regression date | |||||
Regression introduced in release | |||||
Regression introduced by commit | |||||
Triggers an Emergency Pack | No | ||||
Summary | 0045341: OBInterceptors consider an udpate new records created manually setting the createdBy | ||||
Description | In a flow where it is required to force a different createdBy field than the current user. The OBInterceptor when it manages the audit fields it checkes the createdBy field to determine if it is a new record or an update[1]. As the createdBy field is manually set the interceptor executes the update method. Which only sets the updated and updatedby fields. But in case that the preventUpdateChange is enabled no field is set throwing a error of null updatedby. [1] https://gitlab.com/openbravo/product/openbravo/-/blob/master/src/org/openbravo/dal/core/OBInterceptor.java#L336 [^] [2] https://gitlab.com/openbravo/product/openbravo/-/blob/master/src/org/openbravo/dal/core/OBInterceptor.java#L414 [^] | ||||
Steps To Reproduce | 1. Create a process that creates a new record and sets the createdBy field. 2. Before saving the new object enable the preventUpdateChange flag OBInterceptor.setPreventUpdateInfoChange(true) 3. The database insert fails as the createdby column is null Please note that the preventUpdateChange is set globally, so it is not requried that the same flow that creates the new objects setting the created by is the one setting the flag. | ||||
Proposed Solution | OBInterceptor should also check other audit columns to determine if the record is new. When executing the onNew() to initialize the audit columns it should set only the ones that are empty at that time to allow forcing different values. | ||||
Additional Information | |||||
Tags | No tags attached. | ||||
Relationships | |||||
Attached Files | |||||
Issue History | |||||
Date Modified | Username | Field | Change | ||
2020-10-30 09:54 | gorkaion | New Issue | |||
2020-10-30 09:54 | gorkaion | Assigned To | => platform | ||
2020-10-30 09:54 | gorkaion | OBNetwork customer | => Gold | ||
2020-10-30 09:54 | gorkaion | Modules | => Core | ||
2020-10-30 09:54 | gorkaion | Support ticket | => 19408 | ||
2020-10-30 09:54 | gorkaion | Resolution time | => 1605826800 | ||
2020-10-30 09:54 | gorkaion | Triggers an Emergency Pack | => No | ||
2020-11-04 17:13 | cberner | Assigned To | platform => cberner | ||
2020-11-05 10:01 | hgbot | Merge Request Status | => open | ||
2020-11-05 10:01 | hgbot | Note Added: 0124181 | |||
2020-11-09 12:30 | hgbot | Merge Request Status | open => approved | ||
2020-11-09 12:30 | hgbot | Resolution | open => fixed | ||
2020-11-09 12:30 | hgbot | Status | new => closed | ||
2020-11-09 12:30 | hgbot | Fixed in Version | => PR21Q1 | ||
2020-11-09 12:30 | hgbot | Note Added: 0124239 | |||
2020-11-09 12:30 | hgbot | Note Added: 0124240 |
Notes | |||||
|
|||||
|
|
||||
|
|||||
|
|
||||
|
|||||
|
|