Skip to content
Snippets Groups Projects
  1. Apr 16, 2018
    • Jérome Maes's avatar
      [FIX] uom: avoid context key, and rather use parameter · fb323d00
      Jérome Maes authored
      When converting UoM, the conversion can fail if the source and destination
      uoM are not in the same category. By default, and error is raised, but using
      a context key, we can receive the initial quantity.
      To avoid the context key (which is not used anymore), we prefer use a dedicated
      parameter to be more explicit.
      fb323d00
    • Vincent Schippefilt's avatar
      [FIX] web: allow alt-click behind dialog overlay · a8bf8f6e
      Vincent Schippefilt authored
      Issue: when displaying the shortcuts with ALT key, when a dialog is open
      the shortcuts are displayed in absolute position above the gray overlay
      of the dialog, so it is possible to click on the buttons of the
      shortcuts.
      This fix will remove this possibility.
      a8bf8f6e
    • Vincent Schippefilt's avatar
      [FIX] web: allow default behavior for unmanaged keyboard navigation · 263f81f6
      Vincent Schippefilt authored
      Reproduce the issue:
      - open the manual reconciliation (it is a client action)
      - add a reconciliation (using the + sign)
      - expand it (using the > sign)
      - put the focus on the first field and hit TAB
      --> you would expect that the focus moves to the second field
      --> what happens is: the focus stays on the first field
      
      Before this fix, when in a client action (or any place that contains
      fields) that contains fields, the keyboard navigation did not occur
      correctly because the default behavior of the TAB key was prevented.
      
      After this fix, if the navigation_move event was not stopped, we allow
      the default behavior of the TAB key.
      263f81f6
    • Vincent Schippefilt's avatar
  2. Apr 13, 2018
    • Géry Debongnie's avatar
      [FIX] web: properly display buttonbox for large screens · 9b2b5edd
      Géry Debongnie authored
      In the form view, a new problem appeared since we introduced the extra device
      size_class: the buttonbox was folded for large screens, even if there is
      only two buttons.
      
      The reason is that the form renderer code used a list to map size class
      numbers to the number of buttons allowed to be displayed.  With the
      extra size class, this number was undefined, which caused an issue.
      9b2b5edd
    • Géry Debongnie's avatar
      [FIX] mail: prevent race condition in discuss · dc35d740
      Géry Debongnie authored
      The discuss application starting process is strongly asynchronous.
      However, it relies implicitely on the fact that the widget is not
      destroyed in its starting process.  For example, if the widget is
      detroyed before the updateChannel method is called, then any call to the
      chat manager service will return undefined and the widget will crash.
      
      When discuss is destroyed exactly between the start and the end of the
      creation of its search view (which is asynchronous), then it is possible
      to have a crash, because the search view will be destroyed when the
      do_search method is called.
      
      Note that we had to fix discuss mobile as well:
      The _setChannel method is supposed to return a deferred, but the mobile
      override did not return it.  As a result, a test in the mobile suite
      failed because this.alive takes a deferred in argument.
      dc35d740
    • Aaron Bohy's avatar
      [FIX] board: stop the propagation of custom events · b096915d
      Aaron Bohy authored
      Recently, rev. 5b3cb812 added a new custom event ('update_filters')
      handler to the ActionManager, and rev. 69c9500e added an option
      ('keepSearchView') to doAction (which can be called by triggering
      up event 'do_action').
      
      Both events ('update_filters' and 'do_action') can be triggered by
      controllers, and when those controllers were in the dashboard, a
      crash occured when they triggered those events. In particular, they
      are triggered by the new 'web_dashboard' view, respectively when
      clicking on an aggregate and when clicking on the subview button to
      open it full screen.
      
      The crashes occurred because the events weren't intercepted by the
      dashboard, so they bubbled up to the ActionManager which couldn't
      handle the requests properly as it wasn't aware of those sub
      controllers.
      
      As there is no search view in the dashboard, the 'update_filters'
      event simply needs to be stopped (we can't handle such a request
      in the dashboard), and for the 'do_action' event, the
      'keepSearchView' option must be forced to false as there is no
      search view to keep (we thus force the ActionManager to create a
      new one).
      b096915d
    • Aaron Bohy's avatar
      [REF] board: don't patch FormView in place anymore · 1d92bb41
      Aaron Bohy authored
      Instead, create a new BoardView (in JS only) instead, referenced by
      specifying js_class="board" on the fly on the root node of the
      arch of the board view.
      
      This ensures that the dashboard addon doesn't impact the FormView,
      and this is necessary to ensure that the next commit doesn't break
      anything.
      1d92bb41
  3. Apr 12, 2018
    • Martin Geubelle's avatar
      [FIX] web: define XL size in config.device · 96f82f65
      Martin Geubelle authored
      In Less, the size_class XL is now defined and can be used in media-queries.
      It is also added in JS for the sake of consistency.
      
      This new size is needed for a fix in enterprise.
      96f82f65
    • Géry Debongnie's avatar
      [FIX] web: prevent destroyed widget from calling start · 1440c8be
      Géry Debongnie authored
      Whenever a widget is destroyed, it should be as inactive as possible.
      Before this commit, it could happen that a widget was destroyed after
      the willstart method, but before the start method. In that case, bad
      things could happen.
      
      For example, the discuss client action tries to look up some information
      into the session, with the getSession method. This causes a crash
      whenever the widget is destroyed.
      1440c8be
    • Géry Debongnie's avatar
      [IMP] web: add fail fast feature to qunit test suite · 5dbb2fc8
      Géry Debongnie authored
      With this commit, we introduce a new 'fail fast' feature to our qunit
      test suite: when it is activated, the qunit test suite will immediately
      stop after the first failed test.
      
      It is accessible as a flag in the url (failfast), or by clicking the
      checkbox in the UI. It is currently not activated by default.
      
      Note that this commit also change the url for the runbot phantomjs test
      in order to activate this feature.  This allows us to increase the global
      timeout for the js test suite without fear!
      5dbb2fc8
    • Géry Debongnie's avatar
      [FIX] web: prevent race condition with client actions · 52f0f21a
      Géry Debongnie authored
      Here is the issue that initiated this work: the bank reconciliation tour
      sometimes failed in community.  The reason was that the discuss client
      action seemed to be loaded after the tour started, and interfered with
      the second step of the tour.
      
      What happened exactly was the following:
      - web client is loaded
      - initial action is starting (but not complete) (this is discuss)
      - tour manager is loaded and starts the reconciliation tour
      - the reconciliation tour changes the url to trigger an hash change
      - the web client calls loadState on the action manager
      - the action manager perform a doAction with the tour url
      - the discuss client action is now ready, and replace the reconciliation
        action
      - the tour is broken.
      
      The underlying cause is really a generic problem: the action manager
      does not add the client action starting process in its 'dropprevious'
      concurrency primitive.  This is probably not really an issue for the
      act_window actions, since they have custom loading code that make sure
      the loading process is put in the drop previous, but it is definitely a
      problem for all client actions.
      
      The solution is quite simple, and should also protect the act window
      renderers: put the action controller in the drop previous
      52f0f21a
    • Vincent Schippefilt's avatar
      [FIX] web: keyboard navigation in kanban skips empty columns · d5f11572
      Vincent Schippefilt authored
      Before this fix, when navigating with LEFT and RIGHT keys on a grouped
      kanban view, if there were empty columns in the direction of the
      navigation, the focus did not change to the next column.
      After this fix, the navigation left and right ignore empty columns and
      jump to the first non-empty column.
      d5f11572
    • Vincent Schippefilt's avatar
      [FIX] web: fix scroll on list and kanban when using keyboard navigation · bf7dfa45
      Vincent Schippefilt authored
      Before this fix, list view and kanban views are scrolling every time
      the user uses the up and down keys.
      After this fix the list and kanban views will only scroll when the user
      arrives at the boder of the window
      bf7dfa45
  4. Apr 11, 2018
    • Jérome Maes's avatar
      [FIX] sale_timesheet: non billable task from plan project · c9098db4
      Jérome Maes authored
      We want to retrieve easily the non billable task from
      project plan. This commit makes the "Non billable" label
      clickable, in the "Hours" sections, and trigger the actions
      to display non billable tasks of projects matching the search
      of the overview.
      
      Task #1834454
      c9098db4
    • Jérome Maes's avatar
      [FIX] sale_timesheet: multi UoM on plan project · 99ce19c7
      Jérome Maes authored
      You can sell services in days, and your timesheet will
      be expressed in hours. But on project plan, UoM conversion
      is not supported and in some calculation, we are mixing
      appels and oranges.
      This commit fixes this issue.
      99ce19c7
    • Mathieu Duckerts-Antoine's avatar
      [DOC]: doc: amelioration of dashboard view documentation · 96867cb0
      Mathieu Duckerts-Antoine authored
      No mention of the group_operator attribute was made in the dashboard view documentation.
      This fixes remedies this situation and slightly ameliorates the previous documentation.
      96867cb0
    • Thibault Delavallée's avatar
      [IMP] test_mail: follow activities in performance tests · 79daa2e2
      Thibault Delavallée authored
      Commit 07ae0ccc set activities as not followed by default on records.
      However this has an impact on performance test that should not happen.
      Indeed performance tests should be based on technical decisions, not business
      decisions. We therefore set activities as followed by default in some advanced
      performance tests to always have results that can be compared.
      79daa2e2
    • Jérome Maes's avatar
      [FIX] hr_timesheet: analytic account generation · 3be7c239
      Jérome Maes authored
      'allow_timesheet' is true by default, but when installing hr_timesheet for already
      created project, populating the column does not use write method, and so, no
      analytic account is generated for existing project.
      It is required to use the same mecanism as in resource (calendar generation),
      and to do so, rewrite part of create/write method of project.project.
      
      This commit also add an onchange, to maintaint consistency about having
      no analytic account does not allow timesheet on project.
      3be7c239
    • Mathieu Duckerts-Antoine's avatar
      [FIX] web: fix bad types in parameters · 49662242
      Mathieu Duckerts-Antoine authored
      This fix allows the documentation to be built again.
      49662242
    • Géry Debongnie's avatar
      [REF] web: remove updateModifiersValue from widget · 86897ca1
      Géry Debongnie authored
      The keyboard shortcut branch recently added a method
      updateModifiersValue on the widget class, which is used to make a widget
      aware of its modifier status (in particular, if it is required).  This
      is necessary for the proper navigation behaviour on field widgets, but
      should not be on the widget class.
      
      The proper fix is, in my opinion, to introduce a AbstractViewWidget
      class which would be used for AbstractField and all custom widgets in
      views.
      
      Meanwhile, this commit simply protects the call to that method. This is a
      refactoring, but can be merged in saas-11.3.
      86897ca1
  5. Apr 10, 2018
    • stefanorigano's avatar
      f39b1bb4
    • stefanorigano's avatar
      8d2d774e
    • Christophe Monniez's avatar
      [REL] saas-11.3 · b696fa1b
      Christophe Monniez authored
      b696fa1b
    • Alexandre Kühn's avatar
      [IMP] base: generic Edit View menu item text in debug mode · 4f6f562c
      Alexandre Kühn authored
      With this commit, the menu item for editing a view in debug mode has been
      changed.
      
      Instead of "Edit List View", it is now "Edit View: List".
      
      That way, the code is shorter, generic, and translatable.
      
      Exception to above changes: search view, which is unchanged
      (it remains "Edit Searchview")
      4f6f562c
    • Géry Debongnie's avatar
      [DOC] doc: add dashboard view documentation · 270dd268
      Géry Debongnie authored
      This commit add the reference documentation for the new dashboard view.
      In an ideal world, this should be done in the enterprise repository, but
      our documentation system is not extensible that way.
      270dd268
    • Alexandre Kühn's avatar
      [IMP] web: many2one as measure in graph & pivot only when desirable · 8dbc1d95
      Alexandre Kühn authored
      With this commit, the fields many2one are not always measures in pivot
      and graph views. By default, they are *not* measures.
      
      In order to have them as measures, we should pass `additionalMeasures`
      as a param to any of the views, which contains a list of fields to consider
      as measures.
      
      example:
      
          Suppose a model with the following fields:
      
              - `product_id` (many2one)
              - `categ_id` (many2one)
              - `sold` (float)
      
          By default, only the field `sold` is a measure
          in a graph or pivot view.
      
          In order to pass `product_id` as a measure of
          a graph view, you should instantiate this view
          as follow:
      
      ``
          var viewInfo = /* ... */;
          var params = {
              additionalMeasures = ['product_id'],
          };
          var graph = new GraphView(viewInfo, params);
      ``
      
      An exception to the rule above is when the many2one field is of type `measure`
      in the arch: this field is set as the default measure of the view, therefore
      it is implicitly added as an additional measure.
      8dbc1d95
    • Géry Debongnie's avatar
      [FIX] web: prevent crash in graph when grouping/aggregating on m2o · 36b4468d
      Géry Debongnie authored
      We recently added the possibility of aggregating the graph view on a
      many2one field (with count distinct operator).  This is useful, but then
      a rare situation could happen: the view could be grouped by the same
      field.
      
      In that case, there is a name clash in the read_group, and the result
      will be that the [id, nameget] of a m2o field will be used as an
      aggregate.
      
      The readgroup method should be improved (its API is a mess), but
      meanwhile, we have a solution for this issue: if we group by a m2o, then
      it is guaranteed that each group has an aggregate value of 1 for the
      same field.
      36b4468d
    • Mathieu Duckerts-Antoine's avatar
      [IMP] web: allow using many2one as measure in pivot view · 47395c6e
      Mathieu Duckerts-Antoine authored
      With this commit, we add the possibility of using many2ones as measure.
      The way a many2one is aggregated is by using the count distinct
      operator.
      
      Some care had to be done to gracefully support the situation when a
      pivot view is grouped by a m2o field F, and the same field F is used as
      a measure.
      47395c6e
    • Thibault Delavallée's avatar
      [IMP] hr_expense: auto subscribe only employee and its (expense) manager on reports · 742476fb
      Thibault Delavallée authored
      Currently a lot of people are automatically added as followers of expense
      reports. However most of them (managers notably) can choose what to follow
      using subtypes on the department. We should avoid adding too much people
      as following records should stay an active choice made by users.
      
      From now on auto subscription works on
       * employee of the expense report, if he has an user;
       * responsible of the expense report, that is the expense manager or the
         manager of the employee;
      
      Expense report creator is not follower of the expense report by default
      anymore, as previous values should be sufficient to ensure people having
      to work on the expense report are already followers.
      
      This commit is related to task ID 1819541.
      742476fb
    • Thibault Delavallée's avatar
      [IMP] mail: display white background for user notifications in chatter · 3f7c75ef
      Thibault Delavallée authored
      User notifications are defined as
       * notes;
       * pushed to user Inbox or email through classic notification process;
       * not linked to any document, meaning model and res_id are void;
      
      When pushed in user's Inbox they are currently displayed with a gray
      background like all notes. However UX experts think it should use a white
      background to be easier to spot in chatter. This commit makes it work.
      From now on discussion and user's notifications are displayed using a white
      background. This commit is related to task ID 1829872.
      3f7c75ef
    • Thibault Delavallée's avatar
      [IMP] mail: do not follow activities by default · 07ae0ccc
      Thibault Delavallée authored
      Activities are quite personal and linked to daily jobs of people using it.
      Being notified of all activities is therefore not considered as default
      behavior and should be a choice done by users. Subtype linked to logged
      activities is now not followed by default anymore. It is still configurable
      through subscription widget or parent subscription (project/task for example).
      
      This commit is linked to task ID 1824141.
      07ae0ccc
    • Thibault Delavallée's avatar
      [FIX] mail: raise a missing email error instead of crash when logging without email · 95d5020f
      Thibault Delavallée authored
      Currently when posting a message if the author has no email address an user
      error is raised. Indeed as posting a message goes through the process of
      creating notifications and sending emails an email address is required on
      the user.
      
      In saas 11.2 a _message_log shortcut has been added to log notes and in saas
      11.3 a message_notify has been added to notify peopel of a custom content.
      Those methods should have the same behavior when author has no email.
      Currently there is a crash when trying to encode its email. After this commit
      an exceptions is raised like classic post.
      
      This commit is a manual forward-port of 3a978cc64e6b1d8aca7cfd5d4e319bcb302dd262 as well as an improvement
      to fix the newly-introduced message_notify method.
      95d5020f
    • Thibault Delavallée's avatar
      [FIX] test_mail: add forgotten margin on activity test · 4859b642
      Thibault Delavallée authored
      Those are notoriously prone to have a one query more-or-less behavior.
      4859b642
    • Thibault Delavallée's avatar
      [MERGE][IMP] mail: limit cache invalidation · 55c6f9ee
      Thibault Delavallée authored
      This merge goes through various cache invalidation done in mail application
      in order to effectively limit it to records and/or fields to invalidate.
      Purpose is to avoid having too much cache invalidation that causes to
      fetch data again, therefore adding computation and queries to various mail
      features. See sub commits for more details about the changes.
      
      All performance tests are improved of a few queries as there is less data
      to fetch again from database. On overall community runbot this leads to a
      gain of about 16K queries when installing all 205 modules. This merge is
      related to task ID 1834147. Closes #24061 .
      55c6f9ee
    • Thibault Delavallée's avatar
      [IMP] mail: limit cache invalidation when managing messages · 9f3889eb
      Thibault Delavallée authored
      This commit proposes to limit cache invalidation at some cases that will
      trigger some behavior change when dealing with mail messages :
      
       * creating messages linked to a document;
       * update model or res_id of a message;
       * updating notifications, as notified people could change some computed
         fields on the record;
      
      This commit also invalidates only mail-related fields as updating messages
      should not invalidate other things than some computed fields linked to
      mail.
      9f3889eb
    • Thibault Delavallée's avatar
      [IMP] mail: limit cache invalidation when subscribing followers · bcc68847
      Thibault Delavallée authored
      Cache invalidation when subscribing people has been added at e6f038a8.
      Indeed subscribing partners to a record may lead to an access right update
      as some of them are based on followers. This is why a cache invalidation
      is necessary to avoid access rights issues.
      
      However subscribing people to a record should change their rights only on
      the records involved in the subscription mechanism. We can therefore give
      ids to the cache invalidation to limit to updated records.
      
      Cache invalidation is also limited when writing on followers if writing
      on model, res_id or partner_id fields. Indeed changing subtypes or
      channel of a subscription should have no impact on cache and access rights.
      
      Cache invalidation done manually in _message_subscribe is not necessary
      as subscription create or update mail.followers records since f9c21092.
      Create and write of mail.followers records already ask for cache invalidation.
      It is therefore not necessary to invalidate cache twice.
      
      This commit allows to save a few queries on some tests, notably about
      activities that deal with subscription and messages. As cache is now kept
      it is not necessary to refetch some data, leading to a few query gain. We
      gain about 1K queries on com runbot.
      
      A side effect of limiting cache invalidation is that some unit tests require
      a manual cache invalidation to have up to date results. Indeed record not
      being up to date in cache was hidden by the invalidation we just removed.
      bcc68847
    • Thibault Delavallée's avatar
      [IMP] mail: remove cache invalidation when notifying a message with a parent · 26d110c4
      Thibault Delavallée authored
      When notifying partners or channels of a message, a cache invalidation is
      currently done if the message has a parent. This invalidation has been done
      when migrating the mail module at the new API at 4b122ad4.
      
      In that time notifying people of a message lead to the creation of
      notifications of the parent message, if any. It was due to the chatter
      being threaded and therefore displaying message with their header message.
      Adding notifications for the parent was necessary to avoid access rights
      issues  when fetching parent message data. Indeed as being notified is one
      of the rule to see a message record adding notifications was done. A cache
      invalidation has therefore been added to clean the message cache and ensure
      everything was fine.
      
      Commit 88b8cd05 changed the way notifications are modeled in Odoo.
      Notification on parent message was removed and access rights changed. Threaded
      mode for Chatter has also been removed. However cache invalidation has been
      kept probably by fear of removing it.
      
      It does not seem to have any viable reason to invalidate cache when a message
      has a parent. Posting a message does not push other messages in users's Inbox
      meaning there should not be any issue with the cache preventing to see
      messages.
      
      Removing this cache invalidation allow to gain queries in performance tests.
      It has an impact on each process involving message creation which is quite
      common in Odoo.
      26d110c4
    • Vincent Schippefilt's avatar
      [FIX] web_editor: fix crash when hitting SHIFT+TAB on an empty editor · fba356c0
      Vincent Schippefilt authored
      repro : open any editor (like tasks), empty its content and hit SHIFT+TAB
      before this fix: you get a traceback
      after this fix: you don't get a traceback
      fba356c0
    • Vincent Schippefilt's avatar
      [IMP] web: keyboard navigation in kanban view · bc1bba44
      Vincent Schippefilt authored
          1. Added the ability to navigate within the kanban view using UP,
              DOWN, LEFT and RIGHT keys.
          2. By defaults, the focus should be set on the search input field.
          3. From the search input field, using the DOWN key, the focus goes
              to the first card of the kanban
          4. From the search input field, using TAB key, the focus goes to the
              create button
          5. From the create/import buttons, using TAB or DOWN key goes to the
              first card of the kanban, then UP and DOWN keys moves the focus
              from card to card in the same column or if it is not a grouped
              view from left to right.
          6. In grouped view, LEFT and RIGHT keys moves the focus to the next
              column
          7. When on a card, hitting ENTER opens the view of that card.
      
      Not included in this commit
          1. Memorize the position on the kanban when opening an card, than restoring
              when going back to that kanban
      bc1bba44
Loading