Skip to content
Snippets Groups Projects
  1. May 26, 2023
    • Louis (loco)'s avatar
      [FIX] *: display the correct eye icon of the invisible elements · 37205288
      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
      
      X-original-commit: https://github.com/odoo/odoo/commit/aae9053cbab6e0d3eda256a67fce98aced183ee7
      Part-of: odoo/odoo#122454
      37205288
    • Louis (loco)'s avatar
      [FIX] web_editor: reorder the elements of the invisible elements panel · 6c9ec26d
      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
      
      X-original-commit: https://github.com/odoo/odoo/commit/3f10fc99c92176c7379ec7d460afb2feb87ecc23
      Part-of: odoo/odoo#122454
      6c9ec26d
    • Mohit Beniwal's avatar
      [FIX] uom: prevent set value of ratio as zero in uom · b79e5afe
      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#122333
      
      X-original-commit: afbd59e5
      Signed-off-by: default avatarWilliam Henrotin (whe) <whe@odoo.com>
      b79e5afe
    • niyasraphy's avatar
      [FIX] mrp: clear product variant onchanging product in bom · 5808fc89
      niyasraphy authored
      
      before this commit, on changing the product from bom is
      not clearing the product variant field, if the product
      variant feature is not activated in the database.
      
      * activate the product variant in the db
      * create a product and variants
      * open bill of material, and set the created
      product as product and set any variant in product
      variant field
      * now go to settings and disable product variant feature
      * come back to same bom and change the product
      * the product variant field will still have the other
      product
      
      onchange_product_tmpl_id is written to clear the
      product variant field value, but as the product
      variant field has group the onchange value is
      not getting updated.
      
      after this commit, on changing the product the product
      variant field will get cleared even if the product
      variant feature is not activated.
      
      closes odoo/odoo#121859
      
      Signed-off-by: default avatarWilliam Henrotin (whe) <whe@odoo.com>
      5808fc89
    • Achraf's avatar
    • Raúl's avatar
      [REF] l10n_ec: Message validation for VAT · f4ca2350
      Raúl authored
      
      - We refactored the VAT validation from a validation error to a warning that is stored in l10n_ec_vat_error
      - Remove the "-" and "EC" from the base_vat in the EC validation/example
      - Only validate the length in the base_vat
      - Add compute field with the warning message in the l10n_ec
      
      closes odoo/odoo#121099
      
      Signed-off-by: default avatarJosse Colpaert <jco@odoo.com>
      f4ca2350
    • Csaba Tóth's avatar
      [CLA] OdooTech Zrt signs Odoo CCLA v1.0 · 65f6d123
      Csaba Tóth authored
      
      closes odoo/odoo#122570
      
      X-original-commit: 3e757c59
      Signed-off-by: default avatarMartin Trigaux (mat) <mat@odoo.com>
      65f6d123
    • David (dafr)'s avatar
      [FIX] purchase: recompute qty_received_method · 243835da
      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#122353
      
      X-original-commit: fcc1e8e3
      Signed-off-by: default avatarWilliam Henrotin (whe) <whe@odoo.com>
      Signed-off-by: default avatarFesquet David (dafr) <dafr@odoo.com>
      243835da
    • Preksha Chouhan's avatar
      [FIX] point_of_sale: prevent traceback while creating new pos category · ead65a64
      Preksha Chouhan authored
      
      When user create a pos category from 'restaurant.printer' model in
      'pos_restaurant' module. it will give an error with the
       message -
      
      'sequence item 0: expected str instance, bool found'
      
      Steps to Produce:-
      
      1. Install 'pos_restaurant' module
      2. Go to 'point_of_sale' module
      3. Go to 'Configuration' -> 'Order Printers'
      4. Click on any printer or create new
      5. Under 'Printed Product Categories' click 'Add a line'
      6. Click 'New'
      
      Trace-back will be generated.
      
      Applying these changes will resolve this issue.
      
      sentry - 4072172292
      
      closes odoo/odoo#120519
      
      Signed-off-by: default avatarJoseph Caburnay (jcb) <jcb@odoo.com>
      ead65a64
  2. May 25, 2023
  3. Apr 13, 2023
  4. May 25, 2023
  5. May 24, 2023
Loading