Skip to content
Snippets Groups Projects
  1. Jan 06, 2022
    • Thibault Delavallée's avatar
      [REF] various: remove usage and dependency on html2text library · d79197f1
      Thibault Delavallée authored
      
      We have our own html2plaintext, already used in lot of use cases instead of
      just a few for the html2txt library.
      
      Notably for emails: most emails going through Odoo stack use our simple
      html2plaintext to format the body alternative. When no body alternative
      is given to ``build_email`` an alternative is built using the library to
      remove. Using our own parser allows to have the same results compared to
      using ``MailMail.send()``. Difference lies in spaces and new lines as well
      as markdown. Our html2plaintext is a bit simple and does not try to generate
      Markdown but generates a simple plaintext version.
      
      This also helps solving some issues with depending on that library.
      
      Task-2702034
      
      closes odoo/odoo#82330
      
      X-original-commit: odoo/odoo@9b5f86e8fa5bef341ea7392b86987092d6f6933a
      Related: odoo/enterprise#23292
      Signed-off-by: default avatarThibault Delavallee (tde) <tde@openerp.com>
      d79197f1
    • Thibault Delavallée's avatar
      [IMP] base: test body alternative done in build_email · abd375a6
      Thibault Delavallée authored
      Purpose of this commit is to add some tests about body alternative done
      in build_email when none is given. It uses a library we are about to
      remove and testing it is therefore necessary.
      
      Task-2702034
      
      X-original-commit: odoo/odoo@1c20511e056c5e8dfeefe0ece196c48f6eb7d42c
      Part-of: odoo/odoo#82330
      abd375a6
    • Josse Colpaert's avatar
      [FIX] l10n_it_edi_sdicoop: avoid tracebacks when no file, batching · c20e3b95
      Josse Colpaert authored
      
      When we ack a file for having correctly received the response e.g.,
      the file is deleted on the server and will not have a file key in the reponse,
      at least before the server itself will have a new response to share.
      
      Before, it would traceback, while now, we do nothing.  (as we are still waiting)
      
      Also, when we get the notice that the term of 2 weeks is passed, it means
      it is successfull.
      
      Also, for the batching we had a traceback, because it was possible to have
      a batching mixing step 1 and step 2, which fails doing invoices.l10n_it_edi_transaction
      
      So we added whether there is a tranaction or not in the batch key.
      
      opw-2703669
      
      closes odoo/odoo#82298
      
      Signed-off-by: default avatarWilliam André (wan) <wan@odoo.com>
      c20e3b95
    • Touati Djamel (otd)'s avatar
      [FIX] stock(_account): traceback with stock user on forecast report · 2fc459ed
      Touati Djamel (otd) authored
      backport of: https://github.com/odoo/odoo/pull/82053/commits/dcc300c51b7f9f5e9e6f1111344fef75eb097532
      
      
      
      2 issues:
      - When going to the report forecast the value of the stock is computed.
      However the stock user should not be able to access the valuations
      - Since an access error is return the graph view is not instanciate and
      the javascript code try to amend an empty result to the DOM. It results
      with a traceback on top of 403 page
      
      opw-2725974
      opw-2727384
      
      closes odoo/odoo#82317
      
      Signed-off-by: default avatarArnold Moyaux <arm@odoo.com>
      Co-authored-by: default avataramoyaux <arm@odoo.com>
      2fc459ed
    • Achraf (abz)'s avatar
      [FIX] web: Add word-break to kanban_content · efe13125
      Achraf (abz) authored
      
      When we create a record with a very long continuous title (without spaces) the string comes out of the kanban block.
      Reproducible on several applications such as Notes, CRM, etc.
      
      opw-2680915
      
      closes odoo/odoo#82306
      
      Signed-off-by: default avatarSamuel Degueldre <sad@odoo.com>
      efe13125
    • alt-odoo's avatar
      [CLA] Add Corporate Moduon CLA · 6a320b3e
      alt-odoo authored
      
      closes odoo/odoo#82309
      
      X-original-commit: aa9dcb28
      Signed-off-by: default avatarMartin Trigaux (mat) <mat@odoo.com>
      Co-authored-by: default avatarrafaelbn <rblasco@moduon.team>
      6a320b3e
    • roen-odoo's avatar
      [FIX] mail : Remove double signature on invoice email · 4b00548e
      roen-odoo authored
      
      Current behavior :
      When sending an invoice by email there was 2 signature in the mail
      
      Steps to reproduce :
      Create an invoice
      Send it by email
      Check the mail, there are 2 signatures
      
      opw-2703272
      
      closes odoo/odoo#81086
      
      Signed-off-by: default avatarThibault Delavallee (tde) <tde@openerp.com>
      4b00548e
    • Akim Juillerat's avatar
      account: Fix journal dashboard graph query order · 36d2643e
      Akim Juillerat authored
      
      As the query results are set in a list of dicts relying on the
      position of the dicts inside the list, the SQL query must ensure
      the results returned by postgres are ordered properly so that it
      will match the order in which the dicts are defined inside the list.
      
      closes odoo/odoo#81966
      
      X-original-commit: bac93bf5
      Signed-off-by: default avatarLaurent Smet <las@odoo.com>
      36d2643e
    • Adrien Widart's avatar
      [FIX] pos_restaurant: distinguish product variants · 911a178c
      Adrien Widart authored
      
      When using a product attribute with a creation mode defined on "never",
      the order sent to the kitchen doesn't consider the product attribute
      value
      
      To reproduce the issue:
      (Use demo data)
      1. Create a product P:
          - In variants, add the "size" attribute with at least two values
              - (Note that the creation mode of this attribute is "never")
          - Available in POS
              - Category: Miscellaneous
      2. In Point of Sale, edit the "Bar" POS and enable:
          - Product Configurator
          - Order Printer (the Kitchen Printer must be working)
      3. Start a POS session
      4. Select a table and add:
          - 1 x P with a size value
          - 1 x P with another(!) size value
      5. Send the order to the kitchen
      
      Error: The printed order only contains one line: 2 x P with the first
      size value selected
      
      When checking if the current order has some changes, the lines summary
      builrder does not distinguish the product variants
      
      OPW-2698626
      
      closes odoo/odoo#81660
      
      Signed-off-by: default avatarMasereel Pierre <pim@odoo.com>
      911a178c
  2. Jan 05, 2022
    • Josse Colpaert's avatar
      [FIX] l10n_sa_invoice: amounts in the QR code should be in Saudi Riyal · 3b50fb04
      Josse Colpaert authored
      
      closes odoo/odoo#81979
      
      Signed-off-by: default avatarWilliam André (wan) <wan@odoo.com>
      3b50fb04
    • Brice bib Bartoletti's avatar
      [FIX] account: soften duplicate ref constrains · 20061487
      Brice bib Bartoletti authored
      The aim of this commit is to allow EDIs to create and save account move
      even if a supplier reference is duplicated.
      This is achieved by delaying the moment to which the constrains is
      triggered.
      
      Before this commit:
      A user can only upload a bill once. (xml ubl format for instance)
      If he needs to upload it a second time, he will be forced to find a
      workaround.
      
      After this commit:
      User will be able to upload as many bill as he wants but will receive a
      ValidationError when trying to post the invoice if the reference is
      duplicated.
      The user will be able to post the bill very easily by changing the
      reference a bit if he wants to pursue.
      
      closes odoo/odoo#82261
      
      Community-pr: https://github.com/odoo/odoo/pull/81748
      Enterprise-pr: https://github.com/odoo/enterprise/pull/23255
      
      
      Task: 2612299
      X-original-commit: 92b93819
      Related: odoo/enterprise#23260
      Signed-off-by: default avatarWilliam André (wan) <wan@odoo.com>
      20061487
    • Adrien Widart's avatar
      [FIX] {purchase_}stock, product: base product name on supplier · 9fae8e2a
      Adrien Widart authored
      Suppose a product with several suppliers, all with the same partner. On
      the purchase order, the product description will always be based on the
      last supplier
      
      To reproduce the issue:
      1. Create a vendor V
      2. Create a product P:
          - Type: Storable
          - In Purchase, add a line L01:
              - Vendor: V
              - Vendor Product Name: Name01
              - Vendor Product Code: C01
              - Quantity: 1
              - Price: 10
          - In Purchase, add a second line L02:
              - Vendor: V
              - Vendor Product Name: Name02
              - Vendor Product Code: C02
              - Quantity: 20
              - Price: 2
          - Once P is saved, ensure the lines order in the purchase tab:
              - L01
              - L02
      3. Add a reordering rule on P:
          - Min: 1
      4. Run the scheduler
      5. Open the generated PO
      
      Error: The description is incorrect ("[C02] Name02" instead of "[C01]
      Name01")
      
      When computing the display name of the product,
      https://github.com/odoo/odoo/blob/7691567286869ca65e63fc79c2cee11e1f415fcb/odoo/models.py#L1728-L1730
      
      
      `name_get` returns a tuples list: `[(37, '[C01] Name01'), (37, '[C02]
      Name02')]` where `37` is the product identifier. This list is then
      converted into a dictionary and here is the issue: it will use the last
      tuple to define the value for key `37`, i.e. "[C02] Name02". Therefore,
      `name_get` should return the correct name, and only this one.
      
      Another issue could be highlighted: when the user changes the quantity
      of the purchase order line, if another supplier info is selected, the
      description won't be updated (for the same reason as above)
      
      OPW-2702616
      
      closes odoo/odoo#82049
      
      Signed-off-by: default avatarTiffany Chang <tic@odoo.com>
      9fae8e2a
    • Paolo (pgi)'s avatar
      [FIX] account_edi_proxy_client, l10n_it_edi_sdicoop: base64 + configurable url · 6f5beab3
      Paolo (pgi) authored
      When encoding a string or bytes with base64,
      the resulting byte string must be decoded
      to get the string back.
      
      * `addons/account_edi_proxy_client/models/account_edi_proxy_user.py`
        AccountEdiProxyUser._register_proxy_user()
      
      + making the default server url configurable with an ir.config_param:
      
      There is a test_mode to allow experimentation on the IAP server.
      To be able to switch between the two, we need to make the
      SERVER_URL configurable.
      
      backport of https://github.com/odoo/odoo/pull/77968
      
      
      but needed some fixes
      
      opw-2703669
      
      closes odoo/odoo#81715
      
      Signed-off-by: default avatarWilliam André (wan) <wan@odoo.com>
      6f5beab3
    • Achraf (abz)'s avatar
      [FIX] wesbite_sale: Prevent traceback on website/shop without headers · 2a9768f6
      Achraf (abz) authored
      
      When you disable the headers through the website editor and try to add
      a product to the wishlist, a traceback occurs because there is an animation
      that uses the dom element of the wishlist that doesn't exist.
      We can avoid the animation in the case where the wish is not defined
      
      reproducible in 14.0 with the wishlist (must be activated in settings)
      and in 15.0 with the cart and the wishlist
      
      opw-2722163
      
      closes odoo/odoo#82247
      
      Signed-off-by: default avatarRomain Derie (rde) <rde@odoo.com>
      2a9768f6
    • roen-odoo's avatar
      [FIX] stock: Owner filter crash · 4c42e43c
      roen-odoo authored
      
      Current behavior:
      Filter "Owner is not set" on Package in inventory app was causing a traceback
      
      Steps to reproduce:
      - Go in inventory app
      - Go in package
      - Apply a filter "Owner is not set"
      - You get a traceback
      
      opw-2714726
      
      closes odoo/odoo#82229
      
      X-original-commit: e4b35090
      Signed-off-by: default avatarNicolas Lempereur (nle) <nle@odoo.com>
      Signed-off-by: default avatarEngels Robin (roen) <roen@odoo.com>
      4c42e43c
  3. Jan 04, 2022
    • Pierre Masereel's avatar
      [FIX] l10n_sa_pos: qr code not seen on ticket · 3b293d14
      Pierre Masereel authored
      
      When a ticket was sent by email or printed, the qr code was not
      visible. This was because it was not correctly put in the report and was
      injected in the DOM throught the mounted of the component.
      
      So we are now setting it in the qweb and prepare the values in
      export_for_printing instead of inject it through the component that
      display it.
      
      closes odoo/odoo#81562
      
      closes odoo/odoo#82219
      
      Signed-off-by: default avatarMasereel Pierre <pim@odoo.com>
      3b293d14
    • Philippe Wauthy's avatar
      [FIX] hr_holidays: fix test_leave_whole_company_07 test · a0d55d59
      Philippe Wauthy authored
      
      test_leave_whole_company_07 test was failing due ot the hr_leave_date_check2
      constraint.
      This constraint check that date_from <= date_to for a leave.
      
      date_from and date_to were not assigned any value before and had a default value
      of fields.Datetime.now. Depending on which date_from or date_to is created first,
      a few second difference can exist and this violates the hr_leave_date_check2 constraint
      
      task-2726143
      
      closes odoo/odoo#82172
      
      X-original-commit: 77a5dfd1
      Signed-off-by: default avatarKevin Baptiste <kba@odoo.com>
      a0d55d59
  4. Jan 03, 2022
    • Martin Trigaux's avatar
      [FIX] hr_holidays: specify group for report · 62a5ab53
      Martin Trigaux authored
      
      closes odoo/odoo#82166
      
      X-original-commit: 3d544731
      Signed-off-by: default avatarYannick Tivisse (yti) <yti@odoo.com>
      Signed-off-by: default avatarMartin Trigaux (mat) <mat@odoo.com>
      62a5ab53
    • Florian Damhaut's avatar
      [FIX] mrp: Context irrelevant of hidden parameters for stock_mrp · eddda890
      Florian Damhaut authored
      
      Step to reproduce:
      - Inventory > Configuration > Operations Types > Manufacturing (or any other operation type with code 'mrp_operation')
      - Change 'Type of Operation' to 'Receipt' (or any other but 'manufacturing')
      - Uncheck box field 'Use Existing Lots/Serial Numbers'
      - Change 'Type of Operation' back to 'Manufacturing'
      - Set correct value for 'Default Source Location' (type Receipt changed the value to 'Vendor', need to fix it)
      
      - Create a storable product with the route 'Manufacture' selected.
      - Create a BoM for this product, with a component tracked by lot (Add quantity to component)
      - Create a MO for the product > Confirm > Check Availability
      
      Current Behaviour :
      Quantity are reserved, but the lot_ids are not visible
      The behaviour is due to the fact that hidden parameters still have effect when they should act as their default value. To ensure it's the case, they are set back to their original value when the user switch between configuration to avoid ending in a wrongful configuration.
      
      Behaviour after PR :
      Lot ids are shown no matter the hidden configuration of picking type
      
      opw-2680370
      
      closes odoo/odoo#81290
      
      Signed-off-by: default avatarArnold Moyaux <arm@odoo.com>
      eddda890
    • Merlin (megu)'s avatar
      [FIX] base: error raised when automated action with many2many field and reference evaluation · 8d45823f
      Merlin (megu) authored
      Automated action with a many2many field and reference evaluation can be created but don't work
      
      Steps to reproduce:
      1. Install Automated Action Rules module and Contacts app
      2. Create an automated action for model 'Contact' with trigger 'On Creation' and action 'Update the Record'
      3. Add a line to the automated action 'Data to Write' for the field 'Tags (res.partner)' with evaluation type 'Reference'
      4. Go to Contacts, create and save a new one
      5. An error is raised when trying to execute the automated action
      
      Solution:
      Raise an error when a many2many field is of evaluation type 'Reference'
      
      OPW-2673939
      
      (This PR is a duplicate of https://github.com/odoo/odoo/pull/82035
      
       which for some reason couldn't do the forward ports)
      
      closes odoo/odoo#82139
      
      Signed-off-by: default avatarNicolas Lempereur (nle) <nle@odoo.com>
      8d45823f
  5. Jan 02, 2022
  6. Dec 31, 2021
    • Olivier Dony's avatar
      [FIX] mail, mass_mailing: fix attachment ownership · 1bcbd640
      Olivier Dony authored
      
      Attachments that are uploaded on a record that isn't saved yet are
      created with res_id set to 0. In the case of attachments linked through
      a m2m rather than the usual (res_model, res_id), it means they may not
      be readable afer the creation of the record, except by their creator.
      
      Re-attaching them to the mailing / template at the end of the create()
      call fixes the ownership.
      
      Fixes #81935
      
      closes odoo/odoo#82106
      
      X-original-commit: 3857629a
      Signed-off-by: default avatarOlivier Dony <odo@odoo.com>
      1bcbd640
    • David (dafr)'s avatar
      [FIX] stock_inventory: Fix Memory Error · a48e3820
      David (dafr) authored
      
      read_group on "stock.inventory.line" could result in a memory error when the database possess to many stock.inventory.line
      Those filters were removed on commit ba92e1da by AVD to prevent a test error where those fields were False. On his advices, I re-added them with the '|' comparator handle the False cases.
      
      OPW-2714644
      
      closes odoo/odoo#81998
      
      X-original-commit: 7e13cc7a
      Signed-off-by: default avatarArnold Moyaux <arm@odoo.com>
      a48e3820
  7. Dec 30, 2021
    • Martin Trigaux's avatar
      [FIX] web: add record id when uploading · 6b4b68a2
      Martin Trigaux authored
      
      Before that, uploading a file from a kanban was adding res_id=0
      Was missing from 5e81850e
      
      closes odoo/odoo#82089
      
      Signed-off-by: default avatarMartin Trigaux (mat) <mat@odoo.com>
      6b4b68a2
    • Habib (ayh)'s avatar
      [IMP] stock: include UOM object in aggregated product quantities · 0594c045
      Habib (ayh) authored
      
      with l10n_mx_edi_stock being introduced in enterprise - we require the unit of measure object in the aggregated lines so that it can be used on the delivery report.
      
      odoo/enterprise#21591
      Task-2585661
      
      closes odoo/odoo#82086
      
      Signed-off-by: default avatarJosse Colpaert <jco@odoo.com>
      0594c045
    • qsm-odoo's avatar
      [FIX] web, *: fix the grab cursor not working on all browsers · 23ebcca9
      qsm-odoo authored
      
      *: web_editor, point_of_sale, pos_restaurant
      
      The grab cursor is currently not working on all browsers (at least
      Chrome Linux). The fallback rule does not even work, meaning that if
      you type:
      
      ```
      cursor: move;
      cursor: grab;
      ```
      
      Those browsers does not even use "move" as they see "grab" as valid but
      use the "default" cursor.
      
      This commit replaces our "grab" uses with a local cursor ensuring it
      works.
      
      Related to task-2431469
      
      closes odoo/odoo#82071
      
      X-original-commit: c8e4e1e9
      Related: odoo/enterprise#23182
      Signed-off-by: default avatarQuentin Smetz (qsm) <qsm@odoo.com>
      23ebcca9
    • roen-odoo's avatar
      [FIX] sale: Payment had wrong sales team · 26e035d4
      roen-odoo authored
      
      Current behavior :
      When creating payment from invoice, the payment had the wrong sales team id
      
      Steps to reproduce :
      - Create atleast 2 invoices with different sales team and same partner
      - Register payments for every invoice
      - Go in payments list view
      - Filter on partner and group by sales team
      - All the payments are grouped in the same sales team
      
      opw-2681041
      
      closes odoo/odoo#81593
      
      Signed-off-by: default avatarEngels Robin (roen) <roen@odoo.com>
      26e035d4
    • Yannick Tivisse's avatar
      [FIX] web: Fix access right issues on external layout prining · 96e4f84d
      Yannick Tivisse authored
      
      Backport of 3891ab34 to 14.0 following f2c1ee5a
      It was not possible to print payslip report
      
      Purpose
      =======
      
      If the user doesn't have access to ir.ui.view (aka no admin or
      website access rights), printing a report with a configured
      external layout will lead to a traceback, as it's forbidden
      for the use to read on the field "key" on the related ir.ui.view.
      
      As we only want to retrieve the view key, this is safe to use
      sudo at that point.
      
      Fixes odoo/odoo#81960
      
      closes odoo/odoo#82050
      
      Related: odoo/enterprise#23159
      Signed-off-by: default avatarMartin Trigaux (mat) <mat@odoo.com>
      96e4f84d
    • Merlin (megu)'s avatar
      [FIX] stock: display forecasted quantity with correct precision · 1388a753
      Merlin (megu) authored
      
      The quantity of the forecasted report was displayed without any precision specified
      
      Steps to reproduce:
      1. Install the Stock and Sales apps
      2. Create a storable product
      3. Create a quotation for this product with a quantity of 1.63
      4. Confirm the quotation
      5. Go to the product and open the forecasted report
      6. The 'Not Available' quantity is -1.6300000000000001 instead of -1.63
      
      Solution:
      Specify the widget and decimal precision used for the quantity
      
      OPW-2713548
      
      closes odoo/odoo#81992
      
      Signed-off-by: default avatarArnold Moyaux <arm@odoo.com>
      1388a753
    • Romain Derie's avatar
      [FIX] test_website: add test for 308 redirect and qs · 3e81c2e5
      Romain Derie authored
      
      With a 308 redirection from `/url` to `/new_url`:
      Links like `/url?a=a` should be rewritten to `/new_url?a=a` and not
      `/new_url?a=a&a=a`.
      
      closes odoo/odoo#81685
      
      Signed-off-by: default avatarNicolas Lempereur (nle) <nle@odoo.com>
      3e81c2e5
    • Nicolas Lempereur's avatar
      [FIX] http_routing: redirect no double query_string · 86974f91
      Nicolas Lempereur authored
      Reproduction:
      
      - have 308 redirection from /shop to /boutique and refresh routes
      - go in incognito on /boutique?order=name+asc (don't go on
        /boutique first, or restart odoo to clear ORM cache)
      - select a sorting option eg. price
      
      => we are redirected to /boutique?order=name+asc?order=list_price+asc
      and this error is shown:
      
      Invalid "order" specified (is_published desc, name asc?order=list_price
       asc, id desc).
      
      This is happening because url_rewrite is keeping current query string
      (see ir.http()._slug_matching) and caching it. So if the first call
      caches:
      
        url_rewrite('/boutique') => /boutique?order=name+asc
      
      all other url_rewrite('/boutique') calls will give you
      /boutique?order=name+asc even if the query string has changed.
      
      In addition to that, url_for may append query_string to url_rewrite
      return value, so you may get a double query_string such as:
      
      ?order=name+asc?order=list_price+asc
      
      which causes the error.
      
      In this fix, we restore the removal of query string that was removed in
      3beb4545.
      
      opw-2702036
      
      Part-of: odoo/odoo#81685
      86974f91
  8. Dec 29, 2021
  9. Dec 28, 2021
  10. Dec 27, 2021
    • qsm-odoo's avatar
      [FIX] website: do not lose the shadow configuration on option hover · e2a1c683
      qsm-odoo authored
      
      Hovering the shadow mode option reset the entire shadow instead of just
      previewing the mode change.
      
      Related to opw-2701512
      
      closes odoo/odoo#81038
      
      Signed-off-by: default avatarRomain Derie (rde) <rde@odoo.com>
      e2a1c683
    • Nasreddin Boulif (bon)'s avatar
      [FIX] website: allow to remove shadow on all cards · 2eb70a47
      Nasreddin Boulif (bon) authored
      
      Steps to reproduce:
      
        - Install `website_hr_recruiment` module
        - Go to `your_website.com/jobs`
        - Activate Edit mode and add a "3 Columns" block
        - Select one of the columns and set the shadow to `None`
      
      Issue:
      
        Shadow is not removed, and by default the "outset" mode is selected.
      
      Cause:
      
        When we check the state of the shadow with `css('box-shadow')`, it
        will always be set because a custom css 'box-shadow' is set by the
        module website_hr_recruitment on card element, and therefore the value
        will always be either 'inset' or 'outset'.
      
      Solution:
      
        If widget value is set to '', replace `box-shadow` style to 'none'
        (only if needed) so it will override the style from css file.
      
      opw-2701512
      
      Part-of: odoo/odoo#81038
      Co-authored-by: default avatarqsm-odoo <qsm@odoo.com>
      2eb70a47
Loading