Skip to content
Snippets Groups Projects
  1. May 24, 2023
    • David (dafr)'s avatar
      [FIX] purchase: recompute qty_received_method · fcc1e8e3
      David (dafr) authored
      
      qty_received_method is not recomputed if the product type change, and can lead to issues on existing purchases when trying to generate a Vendor Bill.
      
      # HOW TO REPRODUCE:
      - Create product P, type: Service, Control Policy: 'On Received Qty'
      - Create PO for 1 unit of P (do not confirm)
      - Update type of P to Storable
      - Confirm PO, Receive Products
      => Qty Received is 0, not able to generate Bill
      
      closes odoo/odoo#122199
      
      X-original-commit: 193f1d8c
      Signed-off-by: default avatarWilliam Henrotin (whe) <whe@odoo.com>
      fcc1e8e3
    • Mohit Beniwal's avatar
      [FIX] uom: prevent set value of ratio as zero in uom · afbd59e5
      Mohit Beniwal authored
      
      ZeroDivsionError: float division to Zero is generated because for assigning
      value to 'factor' of uom in method '_set_ratio', it tries to divide value by
      Zero for uom_type 'Bigger'.
      
      Steps to reproduce:
      1) Install 'Inventory' module.
      2) Click on 'Configuration' > 'Settings'.
      3) Activate 'Units of Measure' > click on 'Units of Measure' button under it.
      4) Click on 'Create' button to create new uom category.
      5) Give any name > in 'Units of Measure' page, click on 'Add a line'.
      6) Enter name and select type as 'Reference unit of measure for this category'.
      7) Now, add another line and select type as 'Bigger than the the Reference unit
         of measure' and set the 'ratio' value to Zero, Error will be generated.
      
      By applying this,it will check for the value of 'ratio' to prevent division by 0
      
      sentry - 4174584503
      
      closes odoo/odoo#121409
      
      Signed-off-by: default avatarWilliam Henrotin (whe) <whe@odoo.com>
      afbd59e5
    • Saran440's avatar
      [FIX] purchase_requisition: default representative from Agreement tto RFQ · 479a3354
      Saran440 authored
      
      closes odoo/odoo#120219
      
      Signed-off-by: default avatarWilliam Henrotin (whe) <whe@odoo.com>
      479a3354
    • Louis (loco)'s avatar
      [FIX] web_editor, *: reorder invisible elements panel at snippet move · 75c1a001
      Louis (loco) authored
      
      *website
      
      Steps to reproduce the bug:
      - Add a Cover and a Picture snippet on the website.
      - Change their visibility to "Conditionally".
      - Change the order of the two snippets on the page either with the drag
      and drop tool or with the "move up" or "move down" option.
      => Their order on the "Invisible Elements" panel has not been updated.
      
      The problem is fixed by calling `_updateInvisibleDOM()` at the end of
      `moveSnippet()` and `_onSnippetDragAndDropStop()`. Note that before this
      commit, all the snippets with a conditional visibility were hidden at
      the call of `_onSnippetDragAndDropStop()`. This is due to the call of
      `cleanForSave()` from `_destroyEditors()`. `_onSnippetDragAndDropStop()`
      has been adapted in order to, as for the "move" option, do not change
      the visibility of those elements.
      
      task-3203914
      
      closes odoo/odoo#113549
      
      Signed-off-by: default avatarDieleman Guillaume (gdi) <gdi@odoo.com>
      75c1a001
    • Louis (loco)'s avatar
      [FIX] *: display the correct eye icon of the invisible elements · a3ce4cd2
      Louis (loco) authored
      *web_editor, website
      
      Steps to reproduce the bug:
      - Add a Text-Image snippet.
      - Change its visibility to "Conditionally".
      - Save.
      - Edit again.
      => The eye icon indicates that the snippet is not visible but the
      snippet is displayed.
      
      Note that [1] introduced a mechanism to solve this problem (the
      `cleanForSave()` of the `ConditionalVisibility` option) but the code was
      not working correctly since [2].
      
      Let's first remember that when calling `toggleTargetVisibility()`, two
      main actions are performed:
      - The addition or suppression of the `data-invisible` attribute from the
      dataset of an invisible element. This attribute is responsible for the
      crossed or not of the eye icon in the "Invisible Elements" panel.
      - The call to `onTargetHide()` or `onTargetShow()` that performs among
      other things the addition or the suppression of the
      `o_conditional_hidden` class on an invisible element. This class is
      responsible for the visibility of the element on the page in edit mode.
      
      This being said, here is what happened at the "Save" before this commit:
      - `cleanForSave()` of `snippetEditor` is called. If the related element
      has the `o_snippet_invisible` class, `toggleTargetVisibility(false)` is
      called (meaning that the `o_conditional_hidden` class and the
      `data-invisible` attribute are added to the element).
      
      - `cleanForSave()` of the `ConditionalVisibility` option is called and
      before [2], the `data-invisible` attribute was removed from the
      corresponding element.
      
      - At the `DOMContentLoaded`, the `o_conditional_hidden` class is removed
      from all the elements that have a conditional visibility. The visibility
      of those elements on the page now depends on the rule set by the user.
      
      The goal of this commit is to restore the mechansim of the remove of the
      `data-invisible` attribute from the conditionnal elements at the
      `cleanForSave()`.
      
      [1]: https://github.com/odoo/odoo/commit/1c442782f887a8c16bae05a43fae13a310ac05df
      [2]: https://github.com/odoo/odoo/commit/de3c29fab2bc5349da8a9418f9d0086d76e6f7de
      
      task-3203914
      
      Part-of: odoo/odoo#113549
      a3ce4cd2
    • Louis (loco)'s avatar
      [FIX] web_editor: reorder the elements of the invisible elements panel · 922d3e63
      Louis (loco) authored
      Steps to reproduce the bug:
      - Add a form snippet on the footer of the website page.
      - Change the visibility of the form snippet to "conditionally".
      - On the footer settings, deactivate the "Page Visibility".
      => The form snippet is still present on the "Invisible Elements" panel
      but clicking on it has no effects. Indeed, it is inside the footer which
      is hidden.
      
      The goal of this commit is to reorganize the "Invisible Elements" panel
      in order to better visualize the hierarchy between the different
      invisible elements. To do so, the list of the invisible snippet elements
      (`[...$invisibleSnippets]`) is scanned. Each invisible snippet that is
      the descendant of another is discarded of the list (to only keep the
      "root" ones) and a map is created with its `keys` set to invisible
      snippets that have invisible descendants. The `value` corresponding to
      an invisible snippet element is a list filled with all its descendant
      invisible snippets except those that have a closer invisible snippet
      ancestor. The list of the root snippets is then scanned. Each root
      snippet is inserted in the DOM as well as their descendant snippets
      found thanks to the newly created map.
      
      Note that thanks to this commit, another problem is solved:
      - Add a cookie bar on the website.
      - Add a Text-Image snippet and change its visibility to "conditionally".
      - Save and edit again. Note that the "Cookies Bar" is above the "Text-
      Image" on the "Invisible Elements" panel.
      - Click to display the cookie bar.
      => The order of the "Cookies Bar" and the "Text-Image" is switched on
      the "Invisible Elements" panel.
      Indeed, before this commit, the order of the snippets was influenced by
      the order of their snippet editor creation. Because this order was not
      always the same from one call to `_updateInvisibleDOM()` to another, a
      glitch could happen when toggling a snippet visibility.
      This is now fixed as the order of the invisible snippets in the
      "Invisible Elements" panel is determined either by their order in the
      list `rootInvisibleSnippetEls` or their order in the lists contained as
      value in the map `descendantPerSnippet`.
      
      task-3203914
      
      Part-of: odoo/odoo#113549
      922d3e63
    • pedrambiria's avatar
      [FIX] point_of_sale: correctly add Global Discount with fiscal position · a54bf481
      pedrambiria authored
      
      Previously, it was not possible to apply the Global Discount in cases
      where there was a fiscal position with tax included in the price. This
      was because of using in the `get_taxes` function, which do not return
      taxes after fiscal position.
      
      opw-3267243
      
      closes odoo/odoo#118837
      
      Signed-off-by: default avatarJoseph Caburnay (jcb) <jcb@odoo.com>
      a54bf481
    • Aurelien van Delft (avd)'s avatar
      [FIX] purchase_stock: _compute_on_time_rate optimizations · a859ed80
      Aurelien van Delft (avd) authored
      
      Turn the call to filtered after the search on purchase.order.line
      into a call to _search. This allows to remove filtered by adding
      an additional leaf in the search domain.
      
      Add read calls to fetch fields from db and store them in cache
      on recordset batches.
      
      Example speedup: partner with 136555 POL 6.33s -> 3.42s
      
      opw-3277299
      
      closes odoo/odoo#122204
      
      X-original-commit: b3e81b09
      Signed-off-by: default avatarWilliam Henrotin (whe) <whe@odoo.com>
      Signed-off-by: default avatarVan Delft Aurélien (avd) <avd@odoo.com>
      a859ed80
    • aliya's avatar
      [FIX] account_edi_ubl_cii: fix partner creation during import · 757ea532
      aliya authored
      
      If a partner in the imported invoice does not exist, we create one on the fly. However, the partner is created without a country and `_run_vat_test` doesn't check it properly in 15.0, and fails in later versions, where we try to get the country code from the country we pass from `_import_retrieve_and_fill_partner`, which is `False`.
      
      This commit retrieves the country from the imported invoice to create the partner and passes the object instead of the `country_code` string to `_run_vat_test`
      
      closes odoo/odoo#122077
      
      Signed-off-by: default avatarLaurent Smet <las@odoo.com>
      757ea532
    • Romain Derie's avatar
      [FIX] website: correctly target footer on popup options · c3f94113
      Romain Derie authored
      
      The code was assuming there would be only one `<footer/>` element in the
      dom but it's not always true.
      Our `Blockquote` snippet also contains a `<footer/>` element.
      
      While this has no impact on Odoo 14 and Odoo 15, it will crash in Odoo
      16 when trying to select "On all pages" on a popup option when there is
      a blockquote snippet on a page.
      The reason it breaks in 16 is because it uses javascript instead of
      jquery, finding only one element (the footer of the blockquote) and not
      all. The jQuery usage was then filtering out to only keep the correct
      footer due to some extra selector looked for in the elements
      (`.oe_structure:o_editable`).
      
      Still, the fix is made in Odoo 14 because it's likely that we will have
      another fix later in the snippet options, and it's also likely that
      someone will replace the jQuery usage by javascript while doing so,
      which would reveal the bug.
      
      opw-3283140
      
      closes odoo/odoo#122082
      
      X-original-commit: ca3d6e09
      Signed-off-by: default avatarQuentin Smetz (qsm) <qsm@odoo.com>
      c3f94113
  2. May 23, 2023
  3. May 22, 2023
    • Victor Feyens's avatar
      [FIX] sale: correct ordering of onchange updates · 37cd2a19
      Victor Feyens authored
      
      Since e9ad3442, on product change,
      the uom & qty were only reset to defaults after the price & tax
      recomputation.
      
      This commit brings back the previous (and correct) behavior, by updating
      the uom & qty alongside the description, before the taxes & price updates.
      
      closes odoo/odoo#121883
      
      Signed-off-by: default avatarVictor Feyens (vfe) <vfe@odoo.com>
      Co-authored-by: default avatarDuong Kim <81897633+kimduong986@users.noreply.github.com>
      37cd2a19
    • Lucas Perais's avatar
      [FIX] web: test document layout should be post_install · 48b83351
      Lucas Perais authored
      
      Initialize a DB. Install website when it is initialized.
      Launch tests of the class TestBaseDocumentLayout
      
      Before this commit, there was a crash because those tests render the report_layout and its
      assets.
      
      The full explanation is that, the module website adds an ir.asset `website.s_badge_000_variables_scss`
      that the report wants to fetch. But, the class of tests is executed at_install. Given the topological order
      and the order of the modules installation, website is not in the registry at that point, but the ir.asset is retrieved
      from the database.
      The ir.asset algorithm determines at that point that `/website/` is not an admissible path and raise an exception.
      
      This commit solves the problem by tagging this class of test "post_install" and not "at_install".
      
      runbot-error-21203
      runbot-error-21204
      runbot-error-21205
      runbot-error-21206
      runbot-error-21207
      runbot-error-21208
      runbot-error-21352
      runbot-error-21353
      runbot-error-21354
      runbot-error-21355
      runbot-error-21356
      runbot-error-21357
      
      closes odoo/odoo#121918
      
      Signed-off-by: default avatarAaron Bohy (aab) <aab@odoo.com>
      48b83351
    • pedrambiria's avatar
      [REV] point_of_sale: allow multiple cash payment methods in PoS · e61ceb54
      pedrambiria authored
      
      We are reverting this commit (f9da3590) because
      it is not compliant to the stable policy and is blocking users that had more than one cash
      payment methods in configuring their pos.
      
      opw-3331677
      
      closes odoo/odoo#121879
      
      Signed-off-by: default avatarJoseph Caburnay (jcb) <jcb@odoo.com>
      e61ceb54
    • Dylan Kiss (dyki)'s avatar
      [FIX] account: reset draft move name in nonempty period · 7ea521a2
      Dylan Kiss (dyki) authored
      
      Currently, when we create a draft move in an empty period, a sequence
      number (name) gets generated and set on the move. This is fine.
      
      When subsequently we change the date of that move to a period that
      already has entries in it, the sequence number (name) for our draft move
      is recalculated according to the new period.
      
      When we post a new move in this same period afterwards, and then
      delete our previous draft move, we are left with a gap in the sequence.
      
      Example: We already have a move on 2023-01-01 with name `2023/01/0001`.
      We add two new moves `A` and `B` as follows.
      
      | Step | Move | Action      | Date       | Name           |
      | ---- | ---- | ----------- | ---------- | -------------- |
      | 1    | `A`  | Add         | 2023-02-01 | `2023/02/0001` |
      | 2    | `A`  | Change date | 2023-01-10 | `2023/01/0002` |
      | 3    | `B`  | Add         | 2023-01-15 | `/`            |
      | 4    | `B`  | Post        | 2023-01-15 | `2023/01/0003` |
      | 5    | `A`  | Delete      |            |                |
      
      A gap is now created, since we have `2023/01/0001` and `2023/01/0003`,
      but `2023/01/0002` was deleted (possible since it was in draft).
      
      To solve this issue, we now make sure that when a draft entry is moved
      to a period that already has entries in it, we reset the name to `/`,
      to not consume a sequence number and prevent possible gaps in the
      sequence later on.
      
      task-3326834
      
      closes odoo/odoo#121832
      
      X-original-commit: 9bf54f09
      Signed-off-by: default avatarWilliam André (wan) <wan@odoo.com>
      7ea521a2
    • Stanislas Gueniffey's avatar
      [IMP] web_editor: re-run tests with mobile version · a7fefded
      Stanislas Gueniffey authored
      
      Some tests use methods that have two different implementations (one for
      desktop and one for mobile). So far, the only example is deleteBackward
      and its mobile counterpart deleteBackwardMobile.
      
      This commit introduces a mechanism in the web_editor tests to avoid
      duplicating such tests. When a test calls a method that has two
      implementations, it uses the desktop one by default and a flag is set
      that indicates the test should be re-run with its mobile implementation
      next.
      
      When errors are raised while the mobile version is in use, we prefix
      their message with '[MOBILE VERSION]' to ease debugging.
      
      Note that this mechanism relies on proper flag management by the
      aforementioned methods.
      
      Task-3054808
      
      closes odoo/odoo#121628
      
      Signed-off-by: default avatarDavid Monjoie (dmo) <dmo@odoo.com>
      a7fefded
    • Odoo's avatar
      [FIX] web_editor: non-uniform behaviour in · d06e043c
      Odoo authored
      
      Before this commit:
      
      When a new list is created and any list item is applied a style
      like h1, bold ,itallic etc.. and when when toggle that list, the list
      style breaks
      
      After this commit:
      
      Toggling through the list does not break the style.
      
      closes odoo/odoo#119012
      
      Task-id: 3269908
      Signed-off-by: default avatarDavid Monjoie (dmo) <dmo@odoo.com>
      d06e043c
    • Pieter Claeys (clpi)'s avatar
      [FIX] mrp: Update analytic lines when changing account on MO · cdf28628
      Pieter Claeys (clpi) authored
      Upon changing/removing/adding the analytic account on a manufacturing order, only the analytic lines due to the raw material moves are updated, but not the ones for workcenter costs.
      
      To reproduce:
      - Create an MO with a workorder on a workcenter which has an operating cost set
      - Complete time on this workorder to generate the [WC] AALs on this MO
      - Change the analytic account on the MO (or delete it)
        Bug: The [WC] AALs never get correctly updated.
      
      This fix builds on https://github.com/odoo/odoo/pull/79614 to correct this behaviour and also take into account changes for the workcenter cost AALs when the analytic_account of a manufacturing order is changed.
      
      Community PR: https://github.com/odoo/odoo/pull/117308
      
      
      
      closes odoo/odoo#117308
      
      Task: 3252742
      Signed-off-by: default avatarArnold Moyaux (arm) <arm@odoo.com>
      cdf28628
  4. May 02, 2023
    • Arnaud Baes's avatar
      [FIX] base_import_module: extract only used files and thread-safe · db926d61
      Arnaud Baes authored
      
      For performance reasons, instead of extracting the whole
      zip, extract only the files which are actually used
      during in the `_import_module`, in case people
      put additional crap in the archive which are ignored
      during the import. That way, we avoid useless I/O.
      
      Also, adding the temporary directory in the addons
      path wasn't thread-safe.
      This revision changes this to make the module
      import feature thread-safe.
      
      closes odoo/odoo#80120
      
      Signed-off-by: default avatarPierre Masereel <pim@odoo.com>
      db926d61
  5. May 22, 2023
    • adda-odoo's avatar
      [FIX] crm: add minimum of return value to _get_assignment_quota · 15e2a1eb
      adda-odoo authored
      
      The method _assign_and_convert_leads() gets called when the CRM: Assign Leads cron is called.
      The values in the list `weights` gets caluclated in a way that memebers with a lower
      `lead_month`count` value gets a higher weight when randomizing assignement of a new lead. Assuming that the
      max assignment per member is consistent (or default = 30).
      Assume that each sale member belonging to any team has around 500 leads assigned to them the previous
      month(`lead_month_count`) and `work_days` is set to `0.2`. The return value of the method
      `_get_assignement_quota()` in this case would be 0 for every member, which causes the list `weights`
      to get populated with just zeros. This raises a `ValueError: Total of weights must be greater than zero`.
      
      Fix:
      
      Make sure the minimum weight for each member is at least 1 and not 0.
      
      opw-3171085
      
      closes odoo/odoo#118156
      
      Signed-off-by: default avatarThibault Delavallee (tde) <tde@openerp.com>
      15e2a1eb
  6. May 21, 2023
  7. May 20, 2023
    • jorv's avatar
      [FIX] microsoft_outlook,google_gmail: require username for OAuth2 · 45e4be17
      jorv authored
      
      Current behavior:
      
      Connections for outgoing email servers using Outlook/Office365 or
      Gmail accounts will establish an OAuth2 authentication for the smtp server.
      Through the `ir_mail_server` form view, one can fetch the necessary
      tokens by logging in into their Microsoft/Gmail account.
      Not specifying an username (`smtp_user`) on the `ir_mail_server` record
      will not produce an error while fetching those tokens.
      But when trying to test the connection or use that server to send an email,
      even if the FROM header is correctly set (i.e. the account email address
      authorized to sent emails), the smtp connection will fail. This is due
      to the fact that when `smtp_user == False`, the respective method
      `_generate_outlook_oauth2_string` or respectively `_generate_oauth2_string`
      will not be called and send the necessary OAuth2 string when sending
      an email through the smtp connection.
      This will lead to a `5.7.57 Client not authenticated to send mail.` error.
      
      After this change:
      
      Add specific UserErrors that get called if `smpt_user == False` before
      the actions in `open_google_gmail_uri` and `open_microsoft_outlook_uri`
      get called. This forces the user to input a `smpt_user` (field Username)
      before the login page for OAuth2 gets called to fetch the tokens.
      Note: there is no check if the user inputs the right username, only
      that the field is not empty. So it is still possible to input an
      invalid username.
      
      opw-3268246
      
      closes odoo/odoo#121526
      
      X-original-commit: 0f6602c7
      Signed-off-by: default avatarStéphane Debauche (std) <std@odoo.com>
      Signed-off-by: default avatarjorv-odoo <jorv@odoo.com>
      45e4be17
  8. May 19, 2023
    • xO-Tx's avatar
      [FIX] website: correctly mark translatable attributes · 9276afdc
      xO-Tx authored
      
      Steps to reproduce:
      
      - Go to a website page > Add a 'Form' block > Set an input "Placeholder"
      value.
      - Go to the page (in 'edit_translations' mode) > The translation of the
      input "Placeholder" attribute doesn't mark the input as translated and
      even after saving the translation, the input is still marked as
      "to_translate".
      
      The goal of this commit is to fix this issue by extending the same
      behaviour on the translated `<select/>` options (using `.oe_translated`
      class) and setting the right translation state on the input from the
      linked attribute translation `<span/>`.
      
      task-3323245
      
      closes odoo/odoo#121440
      
      X-original-commit: 8b522e5c
      Signed-off-by: default avatarBenoit Socias (bso) <bso@odoo.com>
      9276afdc
    • Stanislas Gueniffey's avatar
      [IMP] web_editor: remove dead '_onInput' code · c63cd2f0
      Stanislas Gueniffey authored
      
      The 'insertLineBreak' case in `onInput` is dead code because any event
      that might cause it (pressing Shift+Enter) first triggers `onKeydown`,
      which calls `ev.preventDefault()` and thus prevents it from reaching
      `onInput`.
      
      Task-3301232
      
      closes odoo/odoo#120854
      
      Signed-off-by: default avatarDavid Monjoie (dmo) <dmo@odoo.com>
      c63cd2f0
    • Carlos Dauden's avatar
      [FIX] stock: _log_less_quantities_than_expected call... · b92c0670
      Carlos Dauden authored
      [FIX] stock: _log_less_quantities_than_expected call _log_activity_get_documents with empty dict and raises error
      
      closes odoo/odoo#121641
      
      X-original-commit: c62bd8b3
      Signed-off-by: default avatarTiffany Chang <tic@odoo.com>
      b92c0670
    • Michele's avatar
      [IMP] stock: unreserve only quantity required if available quantity is less... · ddad0ed5
      Michele authored
      [IMP] stock: unreserve only quantity required if available quantity is less than quantity required when action_done on stock move.
      
      Example:
      Now there is this behaviour
      Inventory quantity 4
      Reserved quantity 3
      Available quantity 1
      If i do a stock move of 2 pieces, it will unreserve ALL the stock move of the product.
      
      With this PR it will unreserve only the pieces that are required minus the available quantity not reserved , in this case 2 (new stock move) - 1 (available quantity) = 1
      
      closes odoo/odoo#121650
      
      X-original-commit: 999c2045
      Signed-off-by: default avatarWilliam Henrotin (whe) <whe@odoo.com>
      ddad0ed5
  9. May 17, 2023
    • joda-odoo's avatar
      [FIX] tools: avoid crashes if expression is too large · 0e4f3ac4
      joda-odoo authored
      
      When passing a very large expression to `literal_eval`, the odoo server crashes.
      To avoid this behavior, a limit needs to be set by using the env varaible `ODOO_LIMIT_LITEVAL_BUFFER`.
      If the variable is not set, it defaults to 100Kib.
      
      closes odoo/odoo#121547
      
      X-original-commit: 1b44748c
      Signed-off-by: default avatarVranckx Florian (flvr) <flvr@odoo.com>
      0e4f3ac4
    • Guillaume (gdi)'s avatar
      [FIX] website: compute company id for new users · 7735e70a
      Guillaume (gdi) authored
      When a new user is created from the website, the company id was always
      set to the first company of the database even if the website was the one
      of another company. This flow has been already fixed if there is the
      "Specific User Account" setting activated (see [this other commit]).
      This commit fixes the same issue but for every case.
      
      Steps to reproduce the issue:
      - Create 2 companies A & B
      - For each company, create a website linked to a different URL
      - Activate 'Free sign up' for company B
      - As a public user, go to website of company B
      - Go to 'Sign in > Don't have an account?' and create an account
      
      => If as an admin you check the company of the created user, it is
      company A instead of company B.
      
      [this other commit]: https://github.com/odoo/odoo/commit/77c708c516beb322df37220634e178ba82e894c9
      
      
      
      task-3277317
      
      closes odoo/odoo#121539
      
      X-original-commit: eda9ad14
      Signed-off-by: default avatarBenoit Socias (bso) <bso@odoo.com>
      7735e70a
    • David Monjoie's avatar
      [FIX] web_editor: fix select all in empty paragraph · 4bcba1d7
      David Monjoie authored
      
      The previous code with `parentsUntil` would not return any result
      in an empty paragraph because the only valid element would be the
      anchorNode itself but `parentsUntil` would only return parents and
      never the base node itself. It makes sense, but is not suitable for
      the case at hand.
      
      Before this commit:
      CTRL+A does nothing from inside an empty paragraph.
      
      After this commit:
      CTRL+A correctly triggers a select all from inside an empty paragraph.
      
      Task-3150956
      
      closes odoo/odoo#116150
      
      Signed-off-by: default avatarDavid Monjoie (dmo) <dmo@odoo.com>
      Co-authored-by: default avatardhba-odoo <dhba@odoo.com>
      Co-authored-by: default avatarDavid Monjoie <dmo@odoo.com>
      4bcba1d7
    • roen-odoo's avatar
      [FIX] pos_sale: fix test and traceback when pos_loyalty is not installed · ed0e6e9c
      roen-odoo authored
      Current behavior:
      When pos_loyalty is not installed,the
      `test_settle_order_with_promotions` was failing. Also if the user tries
      to settle an order he would get a traceback.
      
      The issue was introduced here: https://github.com/odoo/odoo/pull/119673
      
      
      
      opw-3247545
      
      closes odoo/odoo#121603
      
      Signed-off-by: default avatarJoseph Caburnay (jcb) <jcb@odoo.com>
      ed0e6e9c
    • Thomas Lefebvre (thle)'s avatar
      [FIX] google_calendar: edit schedule of recurring event · 3f145af0
      Thomas Lefebvre (thle) authored
      
      Steps to reproduce:
      -------------------
      We google calendar, create a recurring event with
      three occurrences.
      We obtain 3 events in chronological order:
      - A
      - B
      - C
      Change the title of the event B and apply the changes
      to the following events.
      We get:
      - A: First title
      - B: Second title
      - C: Second title
      Modify the schedule of event C and apply the changes
      only to this event.
      We get:
      - A: First title + First schedule
      - B: Second title + First schedule
      - C: Second title + Second schedule
      Synchronize Google calendar with Odoo.
      
      Issue:
      ------
      Event C is "duplicated".
      Event C will exist with the first schedule
      and the second schedule.
      
      Cause:
      ------
      A recurrent event with `google_id` is equal to
      `ID_RANGE_TIMESTAMP` can be rescheduled.
      If this is the case, its `google_id`
      will be equal to `ID_TIMESTAMP`.
      
      We do not manage the deletion of the event
      that belongs to the old `google id`.
      
      Solution:
      ---------
      When we detect a recurring event with
      a modified schedule, we have to delete the event
      from the old `google_id`
      (which is the event with the old schedule).
      
      For this, it is necessary to find
      the old `google_id` based on the elements contained
      in the `id` and the `recurringEventId` of the event.
      
      opw-3143680
      
      closes odoo/odoo#120798
      
      Signed-off-by: default avatarArnaud Joset <arj@odoo.com>
      3f145af0
    • Sanket Brahmbhatt's avatar
      [FIX] base,tools: raise usererror instead of a valueerror · 7b121e75
      Sanket Brahmbhatt authored
      
      This issue is generated when the user uploads an image of more than
      50.0 million pixels, so error would be generated. But, currently it raises a
      `ValueError` which results in traceback. So, we replace it with
      `UserError` so the user has an idea about Image size or pixel being excessive.
      
      closes odoo/odoo#120900
      
      Sentry: - 4075426049
      X-original-commit: 59a3f75b
      Signed-off-by: default avatarRémy Voet <ryv@odoo.com>
      7b121e75
    • Carlos Carral's avatar
      [IMP] core: support dropping materialized views · 9a7ce074
      Carlos Carral authored
      The function `drop_view_if_exists` only works when the view in question is a regular view, [materialized views](https://www.postgresql.org/docs/current/rules-materializedviews.html
      
      ) need a special syntax to be dropped (with an additional `MATERIALIZED` flag).
      
      This is an issue when e.g. needing to replace standard views with materialized views for performance reasons, as dropping the views now fails.
      
      Check the table kind beforehand and dispatch to the correct query.
      
      closes odoo/odoo#117424
      
      Signed-off-by: default avatarXavier Morel (xmo) <xmo@odoo.com>
      9a7ce074
  10. May 16, 2023
    • ノウラ's avatar
      [FIX] project: Fix traceback when date_format is false · 28a8cc9b
      ノウラ authored
      
      Current behaviour:
      When the language is not set on the user date_format value
      is False so when opening project tasks we get the following traceback
      
      Error:
      Odoo Server Error
      
      Traceback (most recent call last):
        File '/Users/nea/src/odoo/odoo/addons/base/models/ir_http.py', line 237, in _dispatch
          result = request.dispatch()
              ....
        File '/Users/nea/src/odoo/addons/project/models/project.py', line 798, in _compute_recurrence_message
          task.recurrence_message += '<li>%s</li>' % date.strftime(date_format)
      Exception
      
      The above exception was the direct cause of the following exception:
      
      Traceback (most recent call last):
        File '/Users/nea/src/odoo/odoo/http.py', line 650, in _handle_exception
          return super(JsonRequest, self)._handle_exception(exception)
        File '/Users/nea/src/odoo/odoo/http.py', line 317, in _handle_exception
          raise exception.with_traceback(None) from new_cause
      TypeError: strftime() argument 1 must be str, not bool
      
      Expected behaviour:
      - Open projects tasks with no problem
      
      Fix:
      - to fix the problem we use get_lang() to retrieve the language object for the current use
      
      Affected versions:
      - 14.0
      - 15.0
      - 16.0
      - master
      
      opw-3301081
      
      closes odoo/odoo#121576
      
      X-original-commit: cbbaa9df
      Signed-off-by: default avatarXavier Bol (xbo) <xbo@odoo.com>
      28a8cc9b
    • Gauthier Wala (gawa)'s avatar
      [FIX] sale: Some followers of moves should not be added · c3df8fc0
      Gauthier Wala (gawa) authored
      
      - Create a Deferred Revenue Model on a Current Liability account
      - Create a Sale Order yourself (User 1), with Salesperson User 2
      - Create the invoice from it
      - Remove the salesperson from the invoice and add User 3 instead
      - Change the account to the Revenue Model's one
      - Post the invoice
      - Post the deferred revenue created
      => User 2 is follower of the entries generated
      
      The problem is that the context comes from the sales order, and
      contains a `default_user_id` in the context.
      The solution provided is to remove it from the context given, as
      it serves no purpose (the invoices are already created).
      
      opw-3141495
      
      closes odoo/odoo#121514
      
      X-original-commit: 31046332
      Signed-off-by: default avatarVictor Feyens (vfe) <vfe@odoo.com>
      Signed-off-by: default avatarWala Gauthier (gawa) <gawa@odoo.com>
      c3df8fc0
Loading