Skip to content
Snippets Groups Projects
  1. Feb 07, 2023
  2. Feb 06, 2023
    • Arthur Detroux (ard)'s avatar
      [FIX] website: fix entering edit mode after canceling a beforeunload · e47a9900
      Arthur Detroux (ard) authored
      The website now being displayed in the backend of Odoo (since [1])
      within an iframe. To be able to send events inside this iframe, the
      `PublicRoot` widget from within the iframe is "captured" (using the
      `OdooFrameContentLoaded` event). This is used to send events to Public
      Widgets such as notifying them that the edition is about to start, so
      they need to reload in edit mode.
      
      Prior to this commit, the WebsiteRootInstance would be set to
      `undefined` when the page was about to be unloaded (`beforeunload`
      event). This is useful as this prevents the editor to start in an
      inconsistent state if a user clicks on a link or changes page and clicks
      edit too soon.
      
      Unfortunately, the beforeunload event can be canceled.
      
      Two ways this can be noticed:
      
      - On firefox, enter edit mode and edit the page
      - Try to close the tab
      - A browser dialog is displayed asking the user to confirm if they want
      to leave the page
      - This is done using the beforeunload event
      - It is triggered in both the iframe and the top window on firefox when
      trying to close a tab
      - Clicking on cancel won't allow you to resume the edition as the
      `websiteRootInstance` was set to `undefined`
      
      - On any browser, enter edit mode
      - Upload a document using the media dialog
      - Save
      - Click to download the document
      - Try to enter edit mode
      
      Clicking on the link triggers a `beforeunload` as the browser is about
      to leave the page. The browser somehow detects a download and cancels
      the beforeunload. But the `websiteRootInstance` was already set to
      undefined.
      
      This commit fixes that by only setting the websiteRootInstance to
      undefined in some context:
      
      - When clicking on a link that will result in navigating inside the
      iframe
      - When changing website
      - When the `WebsitePreview` component is asked to reload the iframe
      - Doing it again when a `pagehide` event is triggered.
      
      This last one is only for safety (e.g. if a widget within the iframe
      triggers navigation which leads to a pagehide). Though using this event
      is often too late, as the editor has time to start but often not fully,
      and destroying it so early can lead to tracebacks.
      
      [1]: https://github.com/odoo/odoo/commit/31cc10b91dc7762e23b4bde9b945be0c4ce3fe3b
      
      
      
      task-3046473
      
      closes odoo/odoo#105884
      
      Signed-off-by: default avatarOutagant Mehdi (mou) <mou@odoo.com>
      e47a9900
    • william-andre's avatar
      [FIX] account: handle writing just tax_ids on an aml · b3d60185
      william-andre authored
      
      The `_disable_recursion` wasn't working properly because it didn't
      disable recursive calls if they used the context of a recordset that is
      not in the container. It is really easy to do if we use `self` for
      instance.
      In order to avoid this, we just temporarily change the context of all
      environments while inside of the context manager.
      
      opw-3016530
      
      closes odoo/odoo#103286
      
      Signed-off-by: default avatarQuentin De Paoli <qdp@odoo.com>
      b3d60185
    • Antoine Guenet's avatar
      [FIX] web_editor: prevent merging table with other element on paste · 07604f25
      Antoine Guenet authored
      
      When we paste content in the editor, we merge the first and/or the last
      element(s) from the clipboard with the element(s) before/after the
      selection (eg, pasting `<p>b</p>` at `<p>a[]c</p>` (where `[]` is the
      selection) should result in `<p>ab[]c</p>` rather than
      `<p>a</p><p>b</p><p>c</p>`). If the element we try to merge is a table
      though, we may end up pasting a `<tbody>` without its parent table,
      which leads to unexpected results. In any case we don't ever want to
      merge a table with another element, so we prevent that.
      
      Steps to reproduce the issue (in the `note` module):
      * Type "a" then hit the ENTER key.
      * Add a table (using the /table command) and write in each of its cells.
      * Make a selection that starts before "a", and ends after the last
        character of the last cell of the table.
      * Copy the selection.
      * Paste the selection in the paragraph after the table.
      What you see before this commit is the text you copied, without the
      table.
      
      Everything above is also true of lists (just replace the table with a
      list in the text above) and these cases are fixed here in the same way.
      
      task-3165836
      
      closes odoo/odoo#111983
      
      Signed-off-by: default avatarDavid Monjoie (dmo) <dmo@odoo.com>
      07604f25
    • niyasraphy's avatar
      [FIX] account: translatable action name · 0f92f4ca
      niyasraphy authored
      
      before this commit, the action name was not translatable into user language and always displayed in english.
      
      after this commit, the action name will be translatable and will be showing the value based on user language preference.
      
      closes odoo/odoo#111974
      
      X-original-commit: 6aa80ca6
      Signed-off-by: default avatarJohn Laterre (jol) <jol@odoo.com>
      0f92f4ca
    • niyasraphy's avatar
      [FIX] account: traceback on accrued revenue entry when no order line · c94efd8a
      niyasraphy authored
      
      before this commit, traceback is raised when trying to create accrued revenue entry without entering the order lines.
      
      open a sale order, enter customer and save it, from the action button, click Accrued Revenue Entry and enter an amount in the amount field, exception will be raised.
      
      after this commit, no exception will be raised.
      
      closes odoo/odoo#111961
      
      X-original-commit: d68eafd5
      Signed-off-by: default avatarJohn Laterre (jol) <jol@odoo.com>
      c94efd8a
    • Sergey Shebanin's avatar
      [IMP] mail: define title for full composer · f3abd7c3
      Sergey Shebanin authored
      
      before this commit title for full composer dialog window is "Odoo". it increases probability of mistake for user because it doesn't clear that user do: sending email or logging note
      
      after this commit title matches dialog purpose
      
      closes odoo/odoo#111945
      
      Signed-off-by: default avatarSébastien Theys (seb) <seb@odoo.com>
      f3abd7c3
    • william-andre's avatar
      [FIX] account: update balance when changing amount in currency · 21cb20a2
      william-andre authored
      
      Before it wasn't done for simplicity, but turns out it is actually quite
      simple to do.
      
      task-3167055
      
      closes odoo/odoo#111680
      
      Signed-off-by: default avatarQuentin De Paoli <qdp@odoo.com>
      21cb20a2
    • David Monjoie's avatar
      [FIX] web_editor: remove double click popup from links · 35cc6049
      David Monjoie authored
      
      It is wrong in 15.0 since double clicking on the link does nothing
      anymore, as edition of the link is done via the popover. Having both
      tooltips at the same time created a race condition that ended up
      inserting the second tooltip in the DOM, where it obviously couldn't
      function properly anymore.
      
      opw-3147108
      
      closes odoo/odoo#111614
      
      Signed-off-by: default avatarDavid Monjoie (dmo) <dmo@odoo.com>
      35cc6049
    • Jordan D. (Joda)'s avatar
      [FIX] point_of_sale: long floor name doesn't display properly · 298b3578
      Jordan D. (Joda) authored
      
      How to reproduce
      =================
      
      When entering a very long table name and / or a very long table name on
      the point of sale application, the text displayed on the "go back" button of the interface will overflow,
      making the name unreadable and not very pleasing to see.
      
      How the fix works
      =================
      
      The fix just cut and hide the part of the text that is overflowing
      
      opw-3102914
      
      closes odoo/odoo#110970
      
      X-original-commit: 5fce82e6
      Signed-off-by: default avatarTrinh Jacky (trj) <trj@odoo.com>
      298b3578
    • Ivan Yelizariev's avatar
      [FIX] web: fix overlapping of Add, Expand buttons in export wizard · f10a4886
      Ivan Yelizariev authored
      
      Some html structures are not well mirrored in RTL directions.
      Fix it by changing it to rtl frienldy structure.
      
      STEPS:
      * switch to any RTL language
      * open list view for any model
      * click Action -> Export
      
      opw-3063763
      
      closes odoo/odoo#110867
      
      Signed-off-by: default avatarLuca Vitali <luvi@odoo.com>
      f10a4886
    • Shawcker's avatar
      [FIX] account: restrict display of 'reconciled entries' button on moves · 85a0ca21
      Shawcker authored
      
      When resetting a payment/move to draft, the related entries are unreconciled. The 'reconciled entries' button raises an error since there isn't any.
      
      This is due to the field `has_reconciled_entries` being wrongly computed since the `_reconciled_lines()` method doesn't actually filter on lines that are reconciled.
      
      Fixing this removes the button when there is no reconciled lines, and avoids the errors raised.
      
      task id=3120327
      
      closes odoo/odoo#109276
      
      Signed-off-by: default avatarLaurent Smet <las@odoo.com>
      85a0ca21
    • Antoine Vandevenne (anv)'s avatar
      [FIX] paypal_paypal: log processing errors in the chatter · c45e6c67
      Antoine Vandevenne (anv) authored
      
      opw-3097856
      
      closes odoo/odoo#111917
      
      X-original-commit: 485e9dc6f2225da00d28f9487867e563519f7f48
      Signed-off-by: default avatarAntoine Vandevenne (anv) <anv@odoo.com>
      c45e6c67
    • pedrambiria's avatar
      [FIX] pos_stripe: capture payment with non-admin user · de096c08
      pedrambiria authored
      
      Before this commit: if a non-admin user captured a payment with
      PoS Stripe, an error occurred in UI. The problem is that only the
      "Administration / Settings" group can have access to the payment
      provider.
      
      The solution is to use super user mode.
      
      opw-3120441
      
      closes odoo/odoo#111747
      
      Signed-off-by: default avatarTrinh Jacky (trj) <trj@odoo.com>
      de096c08
    • Tommy (tong)'s avatar
      [FIX] hr_holidays: end of year accrual calculation issue for yearly accrual plan · ea53b57a
      Tommy (tong) authored
      
      Steps to reproduce:
      
      - Setup an accrual plan with yealy first of Jan granting 15 leaves and it will pospone maximum 7
      leaves to the next year.
      - Setup an allocation with date started 2 years ago on first of Jan.
      - Run scheduled action "Accrual Time: Updates the number of time off" after current year first of
      Jan.
      
      Current behaviour:
      Only granted 7 days leaves.
      
      Expected behaviour:
      It should grant 22 days leaves as it should combined the postpone 7 days leaves and the leaves
      granted on first of Jan of the current year.
      
      Explanation:
      With this modifiation there are two changes:
      
      1) The lastcall and nextcall in the _end_of_year_accrual method should not skipped the
      _process_accrual_plans methods in the _update_accrual method for all the allocations that using
      pospone action_with_unused_accruals. It should keep the lastcall as previous date of current
      level or the lastcall of the allocation depending with one is latest. Also the nextcall should be
      the upcoming nextcall. Therefore after the postpone_max_days caluclated. The _update_accrual
      method can compute the leaves again for yearly first of Jan accrual plan.
      
      2) The prorata amount accrual plan calculation should be date_to first_date_this_year. Otherwise
      one day is missing in the prorata calculation and the leaves count will be incorrect.
      
      closes odoo/odoo#111434
      
      X-original-commit: 11713bfb
      Signed-off-by: default avatarKevin Baptiste <kba@odoo.com>
      ea53b57a
    • Pierre Rousseau's avatar
      [FIX] spreadsheet: update o_spreadsheet to latest version · 14eddf9f
      Pierre Rousseau authored
      ### Contains the following commits:
      
      https://github.com/odoo/o-spreadsheet/commit/66ca47d10 [FIX] Cell/clipboard: Fix last cell deletion
      https://github.com/odoo/o-spreadsheet/commit/29fbbdd97 [REF/IMP] figure: refactor figure container and handle scroll
      https://github.com/odoo/o-spreadsheet/commit/7e4c5cd9b [REF] sheetview: split getter "getActiveSheetScrollInfo"
      https://github.com/odoo/o-spreadsheet/commit/bbcd4a62e [FIX] menu: use capture for events
      https://github.com/odoo/o-spreadsheet/commit/f44a32e82 [FIX] Renderer: Speed up rendering
      https://github.com/odoo/o-spreadsheet/commit/cd1f96ae7 [FIX] components: Fix static colors for spreadsheet
      https://github.com/odoo/o-spreadsheet/commit/c5363ee81
      
       [FIX] drag & drop: mouse outside the grid & freeze panes
      
      closes odoo/odoo#111951
      
      Signed-off-by: default avatarRémi Rahir (rar) <rar@odoo.com>
      14eddf9f
  3. Feb 05, 2023
  4. Feb 04, 2023
    • Raphael Collet's avatar
      [FIX] core: field recomputed on more records than expected · bb3a6e37
      Raphael Collet authored
      
      The issue occurs when a computed field depends on a many2many field with
      a corresponding inverse field on its comodel.  Consider two models like
      
      class User(models.Model):
          _name = _description = 'test_new_api.user'
      
          group_ids = fields.Many2many('test_new_api.group')
          group_count = fields.Integer(compute='_compute_group_count', store=True)
      
          @api.depends('group_ids')
          def _compute_group_count(self):
              for user in self:
                  user.group_count = len(user.group_ids)
      
      class Group(models.Model):
          _name = _description = 'test_new_api.group'
      
          user_ids = fields.Many2many('test_new_api.user')
      
      When a user is added to a group with
      
          group.write({'user_ids': [Command.link(user.id)]})
      
      we expect the field `group_count` to be recomputed on `user` only, but
      it is actually triggered on *all* the records in `group.user_ids`.  This
      is a real performance issue when there are many records in the relation.
      
      The explanation comes from the fact that
       - the framework considers the field `user_ids` is modified on `group`;
       - the field `group_count` implicitly depends on `group_ids.user_ids`,
         which makes it triggered on the users `u` such that `u.group_ids`
         intersects `group`.
      
      The solution consists in handling the dependencies on inverse many2many
      field in the field itself.  The field no longer adds the implicit
      dependency on its inverse field in the trigger tree, but instead
      determines which records in the comodel are actually impacted by the
      relation change in the method field.write().
      
      closes odoo/odoo#111653
      
      Signed-off-by: default avatarRaphael Collet <rco@odoo.com>
      bb3a6e37
    • Raphael Collet's avatar
      [IMP] core: add a class for trigger trees · 1116fae2
      Raphael Collet authored
      
      The class is a simple extension of dict, and adds an explicit attribute
      for the content of the root node of a tree.  It makes the code much more
      readable with very small performance overhead.
      
      closes odoo/odoo#111651
      
      Signed-off-by: default avatarRaphael Collet <rco@odoo.com>
      1116fae2
    • Raphael Collet's avatar
      [FIX] core: make trigger trees faster · 6b38a727
      Raphael Collet authored
      This patch optimizes the way field trigger trees are computed.  Overall,
      the resulting trigger trees are mostly identical, but they can now be
      determined one by one, which enables an on-demand approach and partial
      cache.
      
      Before this patch, getting the first trigger tree proceeded as follows:
       - resolve the dependencies of all fields;
       - compute the transitive closure of the dependencies of all fields;
       - store the transitive closure above as field triggers for all fields
         in a cache.
      
      After this patch, getting the first trigger tree proceeded as follows:
       - resolve the dependencies of all fields;
       - cache them as direct triggers for all fields;
       - compute one trigger tree as the transitive closure of the field's
         triggers, and cache it.
      
      This optimization is quite effective during the installation of modules,
      and is even more effective when the number of fields is large.  For
      instance, a complete installation with all community modules is now 25%
      faster.  For a complete installation with all enterprise modules, the
      installation time is even 30% less!  A medium installation is about 16%
      less time.
      
      The optimization also speeds up the first request on a new Odoo worker,
      since the minimum time for computing a handful of trigger trees is much
      smaller than before.  We have measured times for a first request going
      from 1.6 seconds to 1 second for posting a message.
      
      We have observed slight differences in trigger trees, but they occur in
      places where the tree has redundant branches, in particular with fields
      having recursive dependencies.  It therefore makes no difference in what
      is being triggered or invalidated.
      
      Part-of: odoo/odoo#111651
      6b38a727
    • Raphael Collet's avatar
      [REF] core: make APIs on registry for computation triggers · be5f1b1f
      Raphael Collet authored
      Those APIs are aimed at hiding the implementation of trigger trees,
      dependent fields and fields modifying relations.  Explicit APIs simplify
      the profiling of executions and comparison of implementations for
      building trigger trees.
      
      Part-of: odoo/odoo#111651
      be5f1b1f
    • Raphael Collet's avatar
      [FIX] base: remove circular dependency between fields · 030d3c1d
      Raphael Collet authored
      The field ir.rule.global depends on ir.rule.groups, and its inverse
      field res.group.rule_groups depends on ir.rule.global because of a
      domain on the field.  As the domain is only useful client-side, turn the
      domain into a string, so that it is only valid client-side.
      
      Part-of: odoo/odoo#111651
      030d3c1d
    • Thomas Lefebvre (thle)'s avatar
      [FIX] website_sale_delivery: add the modification of a relay point · 3b42123e
      Thomas Lefebvre (thle) authored
      
      Steps to reproduce:
      Realize the process checkout flow on ecommerce.
      Taking care to have only one shipping method (example Mondial relay).
      
      Issue:
      When confirming the order,
      it is not possible to choose another parcel point.
      
      Solution:
      Make it possible to click on the shipping method
      to change the parcel point.
      
      Remark:
      It is only possible to confirm the relay point once.
      We must reload the page if we want to modify it.
      
      opw-3149294
      
      closes odoo/odoo#111893
      
      X-original-commit: cce78ebc
      Signed-off-by: default avatarXavier Bol (xbo) <xbo@odoo.com>
      3b42123e
  5. Feb 03, 2023
Loading