Openbravo Issue Tracking System - Openbravo ERP
View Issue Details
0039426Openbravo ERPA. Platformpublic2018-10-09 18:122018-12-11 20:22
aaroncalero 
caristu 
highmajoralways
closedfixed 
5
 
3.0PR19Q1 
alostale
Core
No
0039426: [Resources and Reservations] Duplicated call to the reservations datasource when refreshing the Resources Reservation widget
When the Resource Reservation widget is loaded, two different requests are done to the Resources Calendar Data Source, both of them returning apparently the same data.
In an environment with Resources and Reservations module installed (https://code.openbravo.com/erp/pmods/org.openbravo.module.resources [^]) and configured:
Login in backend as F&B International Group Admin
In the Openbravo workspace, add the Resources and Reservations calendar widget.
Create several reservations.
Open the browser console and go to the Network tab
Refresh the widget.
Verify on the Network tab that two requests have been done to <server>/org.openbravo.service.datasource/4591756D1AFA4A85BDA9B85341E3CD24
Performance
diff 39426.diff (1,599) 2018-10-17 16:19
https://issues.openbravo.com/file_download.php?file_id=12279&type=bug
Issue History
2018-10-09 18:12aaroncaleroNew Issue
2018-10-09 18:12aaroncaleroAssigned To => Triage Finance
2018-10-09 18:12aaroncaleroResolution time => 1540245600
2018-10-10 07:13guillermogilTag Attached: Performance
2018-10-10 10:50SandrahuguetResolution time1540245600 => 1540854000
2018-10-11 09:04SandrahuguetAssigned ToTriage Finance => markmm82
2018-10-13 22:56markmm82Statusnew => scheduled
2018-10-17 04:39markmm82Note Added: 0107348
2018-10-17 16:17SandrahuguetAssigned Tomarkmm82 => platform
2018-10-17 16:18SandrahuguetStatusscheduled => acknowledged
2018-10-17 16:18SandrahuguetStatusacknowledged => scheduled
2018-10-17 16:19SandrahuguetFile Added: 39426.diff
2018-10-17 16:19SandrahuguetAssigned Toplatform => AugustoMauch
2018-10-17 16:35SandrahuguetSteps to Reproduce Updatedbug_revision_view_page.php?rev_id=17777#r17777
2018-10-17 18:00SandrahuguetAssigned ToAugustoMauch => platform
2018-10-17 18:00SandrahuguetStatusscheduled => feedback
2018-10-17 18:00SandrahuguetStatusfeedback => new
2018-10-19 08:28caristuAssigned Toplatform => caristu
2018-10-19 08:28caristuStatusnew => scheduled
2018-10-30 17:07hgbotCheckin
2018-10-30 17:07hgbotNote Added: 0107662
2018-10-30 17:07hgbotStatusscheduled => resolved
2018-10-30 17:07hgbotResolutionopen => fixed
2018-10-30 17:07hgbotFixed in SCM revision => http://code.openbravo.com/erp/devel/pi/rev/442d564cc84540cdeb3e0771d09bb940977c7445 [^]
2018-10-30 17:08caristuReview Assigned To => alostale
2018-11-08 09:58alostaleProjectModules => Openbravo ERP
2018-11-08 09:58alostaleModules => Core
2018-11-08 09:58alostaleTriggers an Emergency Pack => No
2018-11-08 09:58alostaleCategoryResource and Reservation Management => A. Platform
2018-11-08 10:00alostaleNote Added: 0107794
2018-11-08 10:00alostaleStatusresolved => closed
2018-11-08 10:00alostaleFixed in Version => 3.0PR19Q1
2018-12-11 20:22hudsonbotCheckin
2018-12-11 20:22hudsonbotNote Added: 0108449

Notes
(0107348)
markmm82   
2018-10-17 04:39   
Test Plan:
As Openbravo / F&B International Group Admin
    Create a new Preference
        Client: F&B International Group
        Organization: F&B España, S.A
        Property List: Yes
        Property: Local Timezone ID
        Value: Europe/Madrid
 
    Create a new Reservation Calendar
        Organization: F&B España, S.A
        Name: 2018 Calendar
        Time Reservation Unit: Hourly
        Show Weekend: YES
 
    Create a new Resource Group
        Organization: F&B España, S.A
        Name: Offices
 
    Create a new Resource Category
        Organization: F&B España, S.A
        Name: Space
 
    Create a new Resource
        Organization: F&B España, S.A
        Search Key: CR1
        Name: Conference Room 1
        Resource Type: Generic
        Resource Category: Space
        Reservation Calendar: 2018 Calendar - Hourly
        Product Category: Others
        Capacity: checked
        UOM: Unit
        Default Capacity: 20
        Maximum Capacity: 30
        In Online Section
            Bookable Online: checked
            Product: Alquiler de oficina
            Reservation Controller: Basic Reservation Controller
            Resource Group: Offices
            Bookable by All Users: checked
  
    Add a Resource Reservation widget in Workspace
    Log out / Log in

    Go to Workspace.
        Verify on the Network tab that just one request has been done to <server>/org.openbravo.service.datasource/4591756D1AFA4A85BDA9B85341E3CD24

    In Resource Reservation Widget fill the following information:
        Organization: F&B España, S.A
        Verify the resource group "Offices" is shown
        Expand Offices and verify the resource "Conference Room 1" is shown
        
        Refresh the calendar and verify on the Network tab that just one request has been done to <server>/org.openbravo.service.datasource/4591756D1AFA4A85BDA9B85341E3CD24

        Create a new Resource
        Organization: F&B España, S.A
        Search Key: CR2
        Name: Conference Room 2
        Resource Type: Generic
        Resource Category: Space
        Reservation Calendar: 2018 Calendar - Hourly
        Product Category: Others
        Capacity: checked
        UOM: Unit
        Default Capacity: 20
        Maximum Capacity: 30
        In Online Section
            Bookable Online: checked
            Product: Alquiler de oficina
            Reservation Controller: Basic Reservation Controller
            Resource Group: Offices
            Bookable by All Users: checked
  
      Go back to Resource Reservation Widget and refresh the widget:
      Verify the resource group "Offices" is shown
      Expand Offices and verify the resource "Conference Room 1" is shown and also the last created resource "Conference Room 2".
      Verify on the Network tab that just one request has been done to <server>/org.openbravo.service.datasource/4591756D1AFA4A85BDA9B85341E3CD24
(0107662)
hgbot   
2018-10-30 17:07   
Repository: erp/devel/pi
Changeset: 442d564cc84540cdeb3e0771d09bb940977c7445
Author: Carlos Aristu <carlos.aristu <at> openbravo.com>
Date: Tue Oct 30 13:58:35 2018 +0100
URL: http://code.openbravo.com/erp/devel/pi/rev/442d564cc84540cdeb3e0771d09bb940977c7445 [^]

fixes issue 39426: Duplicated DS call after drawing an OBMultiCalendar

  By default OBCalendar has the autoFetchData parameter set to true. This means that when an OBCalendar is first drawn, this.fetchData() is automatically called.

  In the case of the OBCalendar used by the OBMultiCalendar, the data is being manually fetched on its initialization by invoking this.refreshCalendar(). This call together with the call performed with the autoFetchData caused the double DS call.

  In general it is recommended to turn off autoFetchData if we are going to manually call fetchData() at any time. For this reason, we are disabling the autoFetchData in the OBCalendar used by the OBMultiCalendar.

---
M modules/org.openbravo.client.application/web/org.openbravo.client.application/js/calendar/ob-multicalendar.js
---
(0107794)
alostale   
2018-11-08 10:00   
reviewed + tested
(0108449)
hudsonbot   
2018-12-11 20:22   
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/470e3cd384c5 [^]
Maturity status: Test