Skip to content
Snippets Groups Projects
  1. May 23, 2023
    • Yolann Sabaux's avatar
      [FIX] purchase: prevent traceback onchange partner · d0109dc5
      Yolann Sabaux authored
      Steps to reproduce:
      In an account move, if the partner_id is changed to one that does not have a value assigned in the property_purchase_currency_id field and with a value in the context for default_currency_id,
      when passing through the _onchange_partner_id function of the purchase module,
      
      Cause:
      the variable currency_id will take the value in the context as second option causing an error when trying to get the value in currency_id.id because currency_id will be an integer and not a record.
      
      issue-121232
      
      note fw 16:
      The record must be saved in order to trigger the compute in
      https://github.com/odoo/odoo/blob/5a256af35e5d612efed9ed8af1cf23fd62bd83f4/addons/account/models/account_move_line.py#L449-L457
      
      
      in order to recompute the currency of the lines
      
      closes odoo/odoo#121957
      
      X-original-commit: e04d4a0b
      Signed-off-by: default avatarYolann Sabaux (yosa) <yosa@odoo.com>
      d0109dc5
    • Lucas Perais's avatar
      [FIX] web: test document layout should be post_install · e542c4a0
      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#121970
      
      X-original-commit: 48b83351
      Signed-off-by: default avatarAaron Bohy (aab) <aab@odoo.com>
      Signed-off-by: default avatarLucas Perais (lpe) <lpe@odoo.com>
      e542c4a0
  2. May 22, 2023
    • xO-Tx's avatar
      [FIX] website: correctly mark translatable attributes · 946de52e
      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#121843
      
      X-original-commit: 9276afdc
      Signed-off-by: default avatarBenoit Socias (bso) <bso@odoo.com>
      Signed-off-by: default avatarOutagant Mehdi (mou) <mou@odoo.com>
      946de52e
    • Chong Wang (cwg)'s avatar
      [FIX] core: write terms to en_US if not activated · e7fd2361
      Chong Wang (cwg) authored
      
      Before this commit:
      when en_US is not activated and the user changes terms slightly for
      ir.ui.view.arch, the new term will be treated as a typo fix or style change, and
      won't be populated to other languages. As a result, in the form view, arch_base
      field which displays the en_US translation of the arch_db will still be the
      content before the change(wrong and strange).
      
      After this commit:
      when write a model_terms field when en_US is not activated, its en_US value will
      always be overwritten.
      
      opw-3265418
      
      closes odoo/odoo#121253
      
      Signed-off-by: default avatarRaphael Collet <rco@odoo.com>
      e7fd2361
    • Chong Wang (cwg)'s avatar
      [IMP] core: allow update empty translations · ae643ab4
      Chong Wang (cwg) authored
      
      before this commit
      When users open the translation dialog for an empty field, and directly update
      and save all translations in the translation dialog, nothing will be saved for
      backend
      
      after this commit:
      these translations will be saved.
      
      opw-3297748
      
      closes odoo/odoo#121139
      
      Signed-off-by: default avatarRaphael Collet <rco@odoo.com>
      ae643ab4
    • Arnold Moyaux's avatar
      [FIX] stock: performance with 2000 serial numbers · 9b5a8e58
      Arnold Moyaux authored
      
      It takes 70s to generate a receipt with 2000 serial numbers.
      
      It happens because during the first part of the loop
      (model `stock.move.line` in the `create` method).
      It will update the initial demand of the move based on the new
      stock.move.line and their qty_done.
      Writing the initial demand of the `stock.move` will try to reassign
      it (useless in our case) and rewrite the same value on its state's field.
      The consequence is the invalidatation of the field on
      the `stock.move.line` because it's a related to the `stock.move`.
      In the second part of the loop, it check the sml state. Since it
      was invalidate upper, it recompute it. That prevent a correct prefetch
      and cause a performance issue.
      
      We fix it by writing only once the information by move. And it
      prevent the recompute later since the state is not write during the
      loop.
      
      closes odoo/odoo#121919
      
      Signed-off-by: default avatarWilliam Henrotin (whe) <whe@odoo.com>
      9b5a8e58
    • Rmi Rahir (rar)'s avatar
      [FIX] spreadsheet: raise error for json fields in lists · 2fc706ad
      Rmi Rahir (rar) authored
      
      The json fields are not supported in lists at the moment because they
      require additional RPC to fetch the display value as long as its
      formatting.
      
      closes odoo/odoo#121532
      
      Task: 3324679
      Signed-off-by: default avatarLucas Lefèvre (lul) <lul@odoo.com>
      2fc706ad
    • Antoine (ande)'s avatar
      [FIX] website_sale_stock_wishlist: add to cart · 37ae328e
      Antoine (ande) authored
      
      Current behaviour:
      When activating "Prevent Sale of Zero Priced Product",
      zero priced products could still be added to cart,
      using the wishlist.
      
      Expected behaviour:
      Zero priced products should not be added to cart
      
      Steps to reproduce:
      1. Activate the setting "Prevent Sale of Zero Priced Product"
      2. Create a product with a sales price of zero
      3. Go on the product selling page, cannot be added to cart
      4. Add the product to your wishlist
      5. Go in the wishlist
      6. The product can be added to the cart
      
      Cause of the issue:
      add_to_cart_button was overriden
      
      Fix:
      Added condition on override
      
      opw-3283057
      
      closes odoo/odoo#121531
      
      Signed-off-by: default avatarAntoine Vandevenne (anv) <anv@odoo.com>
      37ae328e
    • Maximilien (malb)'s avatar
      [FIX] base: missing form view · a7a6887a
      Maximilien (malb) authored
      
      Before this PR when a demo data error occurred (and the errors is too big). You could click on the error and a form view appeared. But if the error was too big, the text for module_id and wizard_id were impacted and were way too small to be readable (like a missing colspan). By adding a form view form this specific model it seems to solve the issues.
      
      closes odoo/odoo#117002
      
      Task-id: 3252698
      Signed-off-by: default avatarJohn Laterre (jol) <jol@odoo.com>
      a7a6887a
    • Odoo's avatar
      [FIX] web_editor: non-uniform behaviour in · 2eb1b477
      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#121892
      
      Task-id: 3269908
      X-original-commit: d06e043c
      Signed-off-by: default avatarDavid Monjoie (dmo) <dmo@odoo.com>
      2eb1b477
    • adda-odoo's avatar
      [FIX] crm: add minimum of return value to _get_assignment_quota · e96c541f
      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#121877
      
      X-original-commit: 15e2a1eb
      Signed-off-by: default avatarThibault Delavallee (tde) <tde@openerp.com>
      e96c541f
    • pedrambiria's avatar
      [FIX] pos_restaurant: stay on current table after refund · bf7f2a19
      pedrambiria authored
      
      Previously, when conducting a refund on a table, the system would
      switch the active table to the table associated with the refunded
      order. This was not the desired behavior, as it resulted in the details
      of the order disappearing, requiring the user to navigate back to
      the refund process.
      
      Steps to reproduce the issue:
      
       - install PoS restaurant
       - pick a table, do an order and pay it
       - pick another table, refund
       - choose the previous order and refund
      -> the order details disappear directly. You have to go back to refund.
      
      opw-3301603
      
      closes odoo/odoo#121351
      
      X-original-commit: 1b28952d42c4c0830a1e9a73c6d1dd7f334e122b
      Signed-off-by: default avatarHeinz Robin (rhe) <rhe@odoo.com>
      Signed-off-by: default avatarPedram Bi Ria (pebr) <pebr@odoo.com>
      bf7f2a19
    • pedrambiria's avatar
      [FIX] google_calendar: use the event user token to send the request · b45abc3d
      pedrambiria authored
      
      Before this commit: it was possible to create an event for another user as
      its organizer. But even if that user has a synchronized Google calendar, it
      will be sent by the current user token, and it causes several issues.
      
      The solution is to use the event's organizer token if it exists.
      
      opw-3076595
      
      closes odoo/odoo#120352
      
      X-original-commit: 96694316
      Signed-off-by: default avatarArnaud Joset (arj) <arj@odoo.com>
      Signed-off-by: default avatarPedram Bi Ria (pebr) <pebr@odoo.com>
      b45abc3d
    • Renaud Thiry's avatar
      [FIX] web_editor: prevent adding sandbox · b6ea1dd3
      Renaud Thiry authored
      
      in 28740b11da37239953185478de9f391265db543f
      we add an option for a sanboxed iframe.
      
      This mistakenly uses `null` instead of `false` in a `t-att`.
      Which sets the sandbox attribute, breaking `mass_mail`.
      
      We replace `null` with `false`, which correctly does not add the attribute
       at all.
      
       task-3255777
      
      closes odoo/odoo#121869
      
      Signed-off-by: default avatarDavid Monjoie (dmo) <dmo@odoo.com>
      b6ea1dd3
    • Stanislas Gueniffey's avatar
      [IMP] web_editor: remove dead '_onInput' code · 44bfc23e
      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#121827
      
      X-original-commit: c63cd2f0
      Signed-off-by: default avatarDavid Monjoie (dmo) <dmo@odoo.com>
      44bfc23e
    • Lucas Perais's avatar
      [FIX] web: aceField with a value of false · b2dffa40
      Lucas Perais authored
      
      Have a record with a field displayed with the aceField.
      That field should have a value of false (ie: unset).
      Display that record on a form view.
      
      With the pager, go on to the next record.
      
      Before this commit, a write was triggered because the aceField considered itself as changed
      even though we did not do anything.
      This was because the value of false was compared to the ace value (empty string) when leaving the record.
      Being different, this triggered the current record to be updated and saved.
      
      After this commit, a false value is locally transformed to the empty string when checking if the field has
      some changes. Hence, there is no write triggered.
      
      opw-3326914
      
      closes odoo/odoo#121634
      
      Signed-off-by: default avatarLucas Perais (lpe) <lpe@odoo.com>
      b2dffa40
    • Rémy Voet (ryv)'s avatar
      [IMP] core: avoid extra invalidate of compute no-store field. · 96bfd7dd
      Rémy Voet (ryv) authored
      
      `tocompute` in the `Transaction` contains store field on records to
      be recomputed. No-store compute fields are directly invalidated from
      the cache when a dependency changes (see `BaseModel.modified`).
      
      In fact, `_recompute_field` was actually doing too much for nothing.
      Also, it may invalidate caches of compute no-store fields for no reason
      (e.g., if they are searchable). Remove the part for field compute
      no-store field. And prevent `_recompute_field` callers from calling it
      with no-store fields.
      
      closes odoo/odoo#121355
      
      Signed-off-by: default avatarRaphael Collet <rco@odoo.com>
      96bfd7dd
    • Rémy Voet (ryv)'s avatar
      [FIX] core: maximum recursion because of `active` fields. · 13b656ac
      Rémy Voet (ryv) authored
      In specific situation, unlink can lead to raise a `RecursionError`:
      - The model `A` has a many2one `b_id` field toward a model `B`.
      This field is set with `ondelete='cascade'`.
      - The model `A` has one **store** related field **no-sudo** named
      `a_related` (`related='b_id.b_other_field`).
      - With `ir.rule` on model `A` with a domain containing `a_related`
      
      You have one record B `b_1` with 20 records A linked to it
      (`a_1, ..., a_20`). When you try to unlink `b_1`:
      
      Stack:
      
        File "...", line 543, in ...
          b_1.unlink()
        File "/home/odoo/Documents/dev/odoo/odoo/models.py", line 3594, in unlink
          self.env.flush_all()
      
      => At this point, `a_1, ..., a_20` have already been deleted from the
      database because of the 'cascade' deletion. But the ORM doesn't have
      any information about this, and `a_related` (for `a_1, ..., a_20`) are
      flagged to be recomputed (because it depends on `b_id.b_other_field`)
      
        File "/home/odoo/Documents/dev/odoo/odoo/api.py", line 732, in flush_all
          self._recompute_all()
        File "/home/odoo/Documents/dev/odoo/odoo/api.py", line 728, in _recompute_all
          self[field.model_name]._recompute_field(field)
        File "/home/odoo/Documents/dev/odoo/odoo/models.py", line 6165, in _recompute_field
          field.recompute(records)
        File "/home/odoo/Documents/dev/odoo/odoo/fields.py", line 1348, in recompute
          self.compute_value(record)
      
      => `self.compute_value(recs)` raised a `MissingError` before recalling
      `compute_value` with only the first `record` (but others are still in
      the prefetch)
      
        File "/home/odoo/Documents/dev/odoo/odoo/fields.py", line 1368, in compute_value
          records._compute_field_value(self)
      
      => `a_related` of `record` is removed from to_compute, but only the
      first record, not the rest of the records present in the prefetch set.
      
        File "/home/odoo/Documents/dev/odoo/odoo/models.py", line 4194, in _compute_field_value
          fields.determine(field.compute, self)
        File "/home/odoo/Documents/dev/odoo/odoo/fields.py", line 100, in determine
          return needle(records, *args)
        File "/home/odoo/Documents/dev/odoo/odoo/fields.py", line 689, in _compute_related
          values = [first(value[name]) for value in values]
        File "/home/odoo/Documents/dev/odoo/odoo/fields.py", line 689, in <listcomp>
          values = [first(value[name]) for value in values]
        File "/home/odoo/Documents/dev/odoo/odoo/models.py", line 5860, in __getitem__
          return self._fields[key].__get__(self, type(self))
        File "/home/odoo/Documents/dev/odoo/odoo/fields.py", line 2772, in __get__
          return super().__get__(records, owner)
        File "/home/odoo/Documents/dev/odoo/odoo/fields.py", line 1186, in __get__
          recs._fetch_field(self)
        File "/home/odoo/Documents/dev/odoo/odoo/models.py", line 3162, in _fetch_field
          self._read(fnames)
      
      => `_read` tries to read the first record + others from the prefetch set
      
        File "/home/odoo/Documents/dev/odoo/odoo/models.py", line 3215, in _read
          self.with_context(active_test=False)._flush_search([], order='id')
        File "/home/odoo/Documents/dev/odoo/odoo/models.py", line 4607, in _flush_search
          self.env[model_name].flush_model(field_names)
        File "/home/odoo/Documents/dev/odoo/odoo/models.py", line 5560, in flush_model
          self._recompute_model(fnames)
        File "/home/odoo/Documents/dev/odoo/odoo/models.py", line 6134, in _recompute_model
          self._recompute_field(field)
      
      => This is where the recursion starts, record compute will move forward
      one by one. But sadly, the stack grows very fast, and with only a few
      (already deleted) records to recompute, the issue will be generated.
      
        File "/home/odoo/Documents/dev/odoo/odoo/models.py", line 6165, in _recompute_field
          field.recompute(records)
        File "/home/odoo/Documents/dev/odoo/odoo/fields.py", line 1348, in recompute
          self.compute_value(record)
        File "/home/odoo/Documents/dev/odoo/odoo/fields.py", line 1368, in compute_value
          records._compute_field_value(self)
        File "/home/odoo/Documents/dev/odoo/odoo/models.py", line 4194, in _compute_field_value
          fields.determine(field.compute, self)
        File "/home/odoo/Documents/dev/odoo/odoo/fields.py", line 100, in determine
          return needle(records, *args)
        File "/home/odoo/Documents/dev/odoo/odoo/fields.py", line 689, in _compute_related
          values = [first(value[name]) for value in values]
        File "/home/odoo/Documents/dev/odoo/odoo/fields.py", line 689, in <listcomp>
          values = [first(value[name]) for value in values]
        File "/home/odoo/Documents/dev/odoo/odoo/models.py", line 5860, in __getitem__
          return self._fields[key].__get__(self, type(self))
        File "/home/odoo/Documents/dev/odoo/odoo/fields.py", line 2772, in __get__
          return super().__get__(records, owner)
        File "/home/odoo/Documents/dev/odoo/odoo/fields.py", line 1186, in __get__
          recs._fetch_field(self)
        File "/home/odoo/Documents/dev/odoo/odoo/models.py", line 3162, in _fetch_field
          self._read(fnames)
        File "/home/odoo/Documents/dev/odoo/odoo/models.py", line 3215, in _read
          self.with_context(active_test=False)._flush_search([], order='id')
        File "/home/odoo/Documents/dev/odoo/odoo/models.py", line 4607, in _flush_search
          self.env[model_name].flush_model(field_names)
        File "/home/odoo/Documents/dev/odoo/odoo/models.py", line 5560, in flush_model
          self._recompute_model(fnames)
        File "/home/odoo/Documents/dev/odoo/odoo/models.py", line 6134, in _recompute_model
          self._recompute_field(field)
      
      How to fix it:
      Move the logic of the MissingError of `_recompute_field` inside the
      `recompute` directly.
      
      Part-of: odoo/odoo#121355
      13b656ac
    • Rémy Voet (ryv)'s avatar
      [REV] core: handle recursion error when resolving stored fields · ba0ed2b4
      Rémy Voet (ryv) authored
      This reverts commit 9e710945.
      
      Why?
      - It is useless in 16.0, the bug it claims to fix should not exist. In the
      commit explanation the sentence 'this calls `_read`, which flushes the
      field we're trying to read' is wrong, since
      https://github.com/odoo/odoo/pull/66938 (merged in 15.5). (It is still true
      for fields that are in an ir.rule, but it sounds very unlikely to have
      a recursive field in ir.rule that causes trigger the problem)
      - It creates worst errors (infinite loop for recursive field computation on
      missing record - Next commit).
      - Also, it looks like a dangerous fix that can hide or trigger new
      issues.
      
      Part-of: odoo/odoo#121355
      ba0ed2b4
    • roen-odoo's avatar
      [FIX] point_of_sale: long product name completely visible · 1d1a42a7
      roen-odoo authored
      
      Current behavior:
      When a product had a too long name, the name was truncated and couldn't
      be completely seen.
      
      Steps to reproduce:
      - Change the name of a product to a very long name with spaces
      - Open the POS
      - The product name is truncated
      
      Note:
      To fix this we stop showing placeholders when a product doesn't have an
      image set.
      
      opw-3245538
      
      closes odoo/odoo#121041
      
      Signed-off-by: default avatarHeinz Robin (rhe) <rhe@odoo.com>
      1d1a42a7
    • Antoine Guenet's avatar
      [FIX] web_editor: save on more than just input · 226a3704
      Antoine Guenet authored
      Since commit [1], the state of the editor in the html field is only set
      to dirty when the user triggers an input event. This means that if the
      user uses the mouse to change the content of the field (eg, drag and
      dropping snippets), the editor is not marked as dirty so the save button
      will not appear and autosave will not work.
      
      This commit fixes this by checking the editor's dirty state whenever a
      history step event is triggered. Since this reverts commit [1], we need
      to ensure the bug it fixed does not reappear. This is done by ensuring
      we don't check the saved value against the modified editing value when
      it's empty (namely, the editor doesn't allow an empty string as a value
      and replaces it with `<p><br></p>`, which we need to undo in
      `_isDirty`).
      
      task-3263653
      task-3288416
      opw-3274329
      
      [1]: https://github.com/odoo/odoo/pull/113088/commits/095bbb93d6c3b9b0b099b7ed1a6a15e8ad914e9f
      
      
      
      closes odoo/odoo#120593
      
      Signed-off-by: default avatarDavid Monjoie (dmo) <dmo@odoo.com>
      226a3704
    • Deependra Solanki's avatar
      [FIX] web_editor: command click goes through fix · 4a25135d
      Deependra Solanki authored
      
      Before this commit:
      
      Previously, when opening a command bar below an image such that the command bar
      was on the image, clicking on the command bar would select both the command bar
      option and the image.
      
      After this commit:
      
      Clicking on the command bar no longer selects the image when it is beneath the
      command bar.
      
      Task - 3126311
      
      closes odoo/odoo#118593
      
      Signed-off-by: default avatarDavid Monjoie (dmo) <dmo@odoo.com>
      4a25135d
  3. May 02, 2023
    • Arnaud Baes's avatar
      [FIX] base_import_module: extract only used files and thread-safe · cabb9e7e
      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>
      cabb9e7e
  4. May 22, 2023
    • Carlos Carral's avatar
      [FW][IMP] core: support dropping materialized views · ba2313b8
      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#121675
      
      Forward-port-of: odoo/odoo#117424
      Signed-off-by: default avatarXavier Morel (xmo) <xmo@odoo.com>
      ba2313b8
    • Thomas Lefebvre (thle)'s avatar
      [FIX] google_calendar: edit schedule of recurring event · aacc8f03
      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#121677
      
      X-original-commit: 3f145af0
      Signed-off-by: default avatarArnaud Joset (arj) <arj@odoo.com>
      Signed-off-by: default avatarLefebvre Thomas (thle) <thle@odoo.com>
      aacc8f03
  5. May 21, 2023
  6. May 19, 2023
    • Habib (ayh)'s avatar
      [IMP] web: stop autocomplete click event · 0e8eadfd
      Habib (ayh) authored
      
      The analytic_distribution component used an extension of the AutoComplete component for 2 reasons.
      1. to get access to the focus event
      2. to stop propogation of the autocomplete input click (which prevented the analytic popup from functioning well)
      
      The need for the focus event was removed, and it doesn't make sense to maintain an extension to simply stop event propogation. For this reason, the extension was removed, and the `.stop` is added directly to the AutoComplete
      
      Part of task-3180055
      
      closes odoo/odoo#115504
      
      Signed-off-by: default avatarWilliam André (wan) <wan@odoo.com>
      0e8eadfd
    • Habib (ayh)'s avatar
      [IMP] analytic: add search more option · aebaf168
      Habib (ayh) authored
      Allow users to find analytic accounts in the analytic widget if there are more than 7 results for their search criteria, by providing a Search More option.
      
      Additional Enhancements include:
      - remove the 'Add a Line' button. replace with an empty tag (no analytic account, remainder of distribution)
      - remove the custom AutoComplete. this was used to set the active group on autoComplete focus, and to prevent propogation of click events.
      - no longer keep track of the active group (editing plan). Instead pass the group (plan id) to the relevant functions.
      - rename variables, for example request > searchTerm
      - keep the header of the popup in place (no scroll when there are many tags)
      - test the widget in list view (with the search more feature)
      - add a new analytic account list view, as users should not multi-edit in the search more dialog
      
      Current behavior before PR:
      Users were forced to type the entire analytic account name if they had many analytic accounts with similar names.
      
      Desired behavior after PR is merged:
      A "Search More" option is added to the Autocomplete options when there are more than 6 analytic accounts found. The Search More option provides a SelectCreate Dialog where users are able to find the required analytic account easily. Users are able to select multiple accounts by checking the items in the list.
      
      Task-3180055
      
      Part-of: odoo/odoo#115504
      aebaf168
    • ノウラ's avatar
      [FIX] project: Fix traceback when date_format is false · 0ba04dc5
      ノウラ 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#121774
      
      X-original-commit: 6d1b4bd96ffbb43c0e2397f89d5594c0bcd4e1e7
      Signed-off-by: default avatarXavier Bol (xbo) <xbo@odoo.com>
      Signed-off-by: default avatarnea@odoo.com <nea@odoo.com>
      0ba04dc5
    • Carlos Dauden's avatar
      [FIX] stock: _log_less_quantities_than_expected call... · f154de3f
      Carlos Dauden authored
      [FIX] stock: _log_less_quantities_than_expected call _log_activity_get_documents with empty dict and raises error
      
      closes odoo/odoo#121691
      
      X-original-commit: c62bd8b3
      Signed-off-by: default avatarTiffany Chang <tic@odoo.com>
      f154de3f
    • Mylyna Hy's avatar
      [FIX] stock: show exception log when cancel backorders · 74a7309e
      Mylyna Hy authored
      Steps to Reproduce Issue for single picking:
      1. Install Sales, Inventory
      2. Create an SO and confirm
      3. Go to the transfer, assign the done value to be less than demanded
      4. Validate the transfer and cancel the backorder
      
      Current Behavior:
      There is no exception error on the SO chatter
      
      Expected Behavior:
      An exception error should be logged on the SO chatter
      
      Other Info: When cancelling a backorder for a single picking,
      the exception error about less quantity than expected is not logged on the SO.
      "process_cancel_backorder" does not call _log_less_quantities_than_expected.
      As defined in "process", the exception is only logged when validating multiple pickings at once but
      one is to backorder but the other is not.
      
      opw-3222508
      
      X-original-commit: a1dfc58eebd1badc3eea501b23861748b3762d75
      Part-of: odoo/odoo#121691
      74a7309e
    • Guillaume (gdi)'s avatar
      [FIX] website: compute company id for new users · 3fbfb530
      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#121558
      
      X-original-commit: eda9ad14
      Signed-off-by: default avatarBenoit Socias (bso) <bso@odoo.com>
      3fbfb530
    • Nshimiyimana Séna's avatar
      [FIX] l10n_it_edi: receive bill that has a document discount · 0ffd8d33
      Nshimiyimana Séna authored
      Bug:
      Currently, trying to import a fatturapa XML that has a document discount
      doesn't do anything.
      
      Setup:
      - install l10n_it_edi and account_accountant
      - have a fatturapa XML that has a document discount
      
      Steps to reproduce:
      - switch to the Italian company ()
      - make sure that the VAT number on the document matches the one on the
        company
      - attempt to upload the XML bill
      
      You should be met with an empty vendor bill page.
      
      Cause:
      The issue comes from here: https://github.com/odoo/odoo/blob/43c9820b1d3020d89b1b7ca016754e29d1fc6b58/addons/l10n_it_edi/models/account_edi_format.py#LL725C21-L729C83
      
      
      in 16.0, `invoice_form` is not an instance of `Form`, but a record.
      
      opw-3193634
      
      closes odoo/odoo#121010
      
      Signed-off-by: default avatarJosse Colpaert <jco@odoo.com>
      0ffd8d33
    • Renaud Thiry's avatar
      [FIX] mail: allow editing of mail mail · 855df256
      Renaud Thiry authored
      
      As it holds full HTML documents, mail.mail often encounters issues with
      the html editor.
      
      We piggy-back off the intoduction of the switching
      behavior between code-view and readonly-view behavior introduced in
      a5c0085ce91570c6c961e3293dfe50f4faba6043
      
      The 'sandboxed preview' mode can now be enabled with an option
      and will ensure all content can only be viewed in a sandboxed iframe
      or in the code editor.
      
      This re-introduces editing, which was mistakenly fully disabled in the
      usability fix that introduced body_content here:
      5055b374
      
      Some tests are added to ensure the key points of this commit remain
      the same. Tests are re-ordered alphabetically to match the order
      of execution, making debugging easier.
      
      task-3255777
      
      closes odoo/odoo#118423
      
      Signed-off-by: default avatarDavid Monjoie (dmo) <dmo@odoo.com>
      855df256
    • Renaud Thiry's avatar
      [IMP] mail: add search on body_content · ac18b73b
      Renaud Thiry authored
      It can be useful to search the body_content field
      to find specific text while not including HTML tags
      and attributes in the search.
      
      task-3255777
      
      Part-of: odoo/odoo#118423
      ac18b73b
    • Renaud Thiry's avatar
      [FIX] web_editor: hide codeview when readonly · 906f72d4
      Renaud Thiry authored
      In 2389f77c
      containsComplexHTML was added to allow editing of html content
      that would otherwise break when inserted as-is in a DOM
      
      For this we added a rule to always display the code view toggle button.
      This should not be the case when the field is marked as readonly.
      
      Switching to the code view in readonly mode will cause a traceback.
      
      task-3255777
      
      Part-of: odoo/odoo#118423
      906f72d4
    • David Monjoie's avatar
      [FIX] web_editor: fix select all in empty paragraph · 76a5a76d
      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#121711
      
      X-original-commit: 4bcba1d7
      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>
      76a5a76d
    • dhba-odoo's avatar
      [FIX] web_editor: entering a hax color triggers traceback · b526bc1e
      dhba-odoo authored
      
      Before this commit:
      
      In mass_mailing entering a hax color for text triggers traceback.
      
      After this commit:
      
      Now, the traceback will not be triggered and color will be applied to the text
      
      Task-3271517
      
      closes odoo/odoo#120507
      
      Signed-off-by: default avatarDavid Monjoie (dmo) <dmo@odoo.com>
      b526bc1e
    • hupo-odoo's avatar
      [FIX] account: cash rounding · 4ff539d5
      hupo-odoo authored
      
      Fix the cash rounding displayed on accounting documents such as customer invoices, credit notes, vendor bills and vendor refunds. The amount that was computed was incorrect in most case. The only case that was working was the customer invoice when using the company currency. The PR address the issue of cash rounding for all account move type and when using foreign currencies as well.
      
      Steps to Reproduce
       - Activate Cash Roundings.
       - Create a half-up cash rounding with a precision of 1.
       - Create a new bill with a pre-tax amount of 378 and a tax rate of 15%
       - Apply the cash rounding to the bill and save.
       - Review the "Total Rounded" value.
      
      Expected Results:
      The 'Total Rounded' value should be 435.00
      
      Actual Results:
      The displayed 'Total Rounded' value is 434.40
      
      opw-3235723
      opw-3236011
      opw-3277942
      opw-3271713
      
      task-3257577
      
      closes odoo/odoo#119545
      
      Signed-off-by: default avatarWilliam André (wan) <wan@odoo.com>
      Co-authored-by: default avatarNshimiyimana Serge Séna <sesn@odoo.com>
      4ff539d5
    • Michele's avatar
      [IMP] stock: unreserve only quantity required if available quantity is less... · c3857908
      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#121692
      
      X-original-commit: 999c2045
      Signed-off-by: default avatarWilliam Henrotin (whe) <whe@odoo.com>
      c3857908
Loading