Openbravo Issue Tracking System - Openbravo ERP
View Issue Details
0032759Openbravo ERPA. Platformpublic2016-04-21 18:022016-06-17 19:37
aferraz 
alostale 
normalcriticalalways
closedfixed 
30Professional Appliance
 
3.0PR16Q33.0PR16Q3 
caristu
No
Google Chrome
Core
No
0032759: Wrong on change function called in process definition
Wrong on change function is called when opening a process definition from another process definition and both have a parameter with the same name
As F&B Admin:

- Create a Payment In for "España Norte" organization and process it.
- Create a Payment In for "España Sur" organization and process it.

- Go to Financial Account window and select "Cuenta de Banco" account.

- Create a record in Imported Bank Statements tab with any name.
- Create a record in Bank Statement Lines tab with any reference no and amount in.
- Move back to Imported Bank Statements tab and click on Process button.

- Click on Match Statement button.
- Click on Cancel on Confirm popup.
- Click on + button on any record of Match Statement process definition.

- Change value of Organization parameter in Add new transaction process definition to "España Norte" organization and realize OB.APRM.AddTransaction.organizationOnChangeFunction javascript function is called (ad_org_id on change function of Add Transaction process definition).
- Click on Payment selector drop down and realize you see created payment for "España Norte" organization.

- Click on + button of Payment selector.
- Click on Cancel button on Add Payment process definition.

- Change value of Organization parameter in Add new transaction process definition to "España Sur" organization and realize OB.APRM.AddPayment.organizationOnChange javascript function is called (ad_org_id on change function of Add Payment process definition) which is wrong.
- Click on Payment selector drop down and realize you still see created payment for "España Norte" organization instead of created payment for "España Sur" organization.

- Click on Payment selector drop down and select created payment for "España Norte" organization and click on Done button.
Realize in Financial Account Transaction tab, you have just created a transaction for "España Sur" organization with a payment for "España Norte" organization, which is wrong.
No tags attached.
related to defect 00326543.0PR16Q3 closed markmm82 Unhomogeneus behavior in Transaction's organization accounting dimension depending of process used to add transaction 
Issue History
2016-04-21 18:02aferrazNew Issue
2016-04-21 18:02aferrazAssigned To => platform
2016-04-21 18:02aferrazOBNetwork customer => No
2016-04-21 18:02aferrazWeb browser => Google Chrome
2016-04-21 18:02aferrazModules => Core
2016-04-21 18:02aferrazTriggers an Emergency Pack => No
2016-04-21 18:02aferrazRelationship addedrelated to 0032654
2016-04-21 18:20aferrazWeb browserGoogle Chrome => Google Chrome
2016-04-21 18:20aferrazSeveritymajor => critical
2016-04-21 18:44aferrazWeb browserGoogle Chrome => Google Chrome
2016-04-21 18:44aferrazNote Added: 0085845
2016-04-21 18:44aferrazSteps to Reproduce Updatedbug_revision_view_page.php?rev_id=11829#r11829
2016-05-03 11:02alostaleAssigned Toplatform => alostale
2016-05-03 11:02alostaleStatusnew => scheduled
2016-05-03 14:02hgbotCheckin
2016-05-03 14:02hgbotNote Added: 0086156
2016-05-03 14:02hgbotStatusscheduled => resolved
2016-05-03 14:02hgbotResolutionopen => fixed
2016-05-03 14:02hgbotFixed in SCM revision => http://code.openbravo.com/erp/devel/pi/rev/67de26cb388462a20ff74f1a2320e09802f86bda [^]
2016-05-03 14:02alostaleReview Assigned To => caristu
2016-05-03 14:02alostaleWeb browserGoogle Chrome => Google Chrome
2016-05-05 13:03caristuNote Added: 0086211
2016-05-05 13:03caristuStatusresolved => closed
2016-05-05 13:03caristuFixed in Version => 3.0PR16Q3
2016-06-17 19:37hudsonbotCheckin
2016-06-17 19:37hudsonbotNote Added: 0087512

Notes
(0085845)
aferraz   
2016-04-21 18:44   
Set as critical as it can create inconsistent data.
(0086156)
hgbot   
2016-05-03 14:02   
Repository: erp/devel/pi
Changeset: 67de26cb388462a20ff74f1a2320e09802f86bda
Author: Asier Lostalé <asier.lostale <at> openbravo.com>
Date: Tue May 03 11:08:48 2016 +0200
URL: http://code.openbravo.com/erp/devel/pi/rev/67de26cb388462a20ff74f1a2320e09802f86bda [^]

fixed bug 32759: Wrong on change function called in process definition

  When opening a Process Definition from another one, in case both of them have
  parameters with the same name having them on change function, when closing 2nd
  processes and changing value from one of these fields, function on 2nd process
  was invoked instead of the one in 1st one.

  On change functions are registered as pair of [viewId, fieldName] in order to
  be unique. In the case of process definition viewId was undefined, so when opening
  2nd process, first registered function was overwritten.

  The problem is now fixed by using processId to register in case viewId is not
  defined.

---
M modules/org.openbravo.client.application/web/org.openbravo.client.application/js/process/ob-base-parameter-window-view.js
M modules/org.openbravo.client.application/web/org.openbravo.client.application/js/process/ob-parameter-window-form.js
---
(0086211)
caristu   
2016-05-05 13:03   
Code review + testing OK:

Following steps to reproduce, the OB.APRM.AddTransaction.organizationOnChangeFunction function is called also the second time (after closing the add payment process)
(0087512)
hudsonbot   
2016-06-17 19:37   
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/0dc7be081b1c [^]
Maturity status: Test