Skip to content
Snippets Groups Projects
  1. Feb 14, 2022
    • Yolann Sabaux's avatar
      [FIX] product: variant exclusion not taken into account · 24a39877
      Yolann Sabaux authored
      
      Steps to repoduce:
      - Go to Sales - products
      - Create a product
      - Add variants (3 attributes and 2 values each) Total is 8 variants.
      - onfigure variants: Select 1 attribute and exclude it for 1 variant (for example: exclude for size 12x12)
      -> the number of variants remains at 8. The one that is excluded is still visible in the Product variants tab.
      
      Solution:
      When an exclusion is created, archive all the not-possible-combination.
      
      OPW-2729329
      
      closes odoo/odoo#84515
      
      X-original-commit: 5ff4eb02
      Related: odoo/enterprise#24307
      Signed-off-by: default avatarSébastien Theys (seb) <seb@odoo.com>
      24a39877
    • Touati Djamel (otd)'s avatar
      [FIX] mrp: prevent traceback when choosing a BOM of a product without a variant · 50b538e7
      Touati Djamel (otd) authored
      Steps to reproduce the bug:
      - Go to inventory > configuration > Products > Attributes
      - Create a new Dynamic Attributes > add two attribute values
      - Create a storable Product “Test”:
          - Add the two attributes
          - Save
          - Create a BOM related to this product
      - Create a new manufacturing order:
          - Do not choose a product
          - Select the BOM related to the product “test”
      
      Problem:
      Traceback is triggered because as the product template only has dynamic variants, there is not a `product.product` record created yet.
      but we try to access it in the onchange: https://github.com/odoo/odoo/blob/14.0/addons/mrp/models/mrp_production.py#L598
      
      
      
      Solution:
      do not set the product when a BOM of a product_tmpl without a variant was chosen
      opw-2732254
      
      closes odoo/odoo#84106
      
      Signed-off-by: default avatarArnold Moyaux <arm@odoo.com>
      50b538e7
    • root's avatar
      [FIX] sale: allow overriding portal domain · 38509c2e
      root authored
      
      Before this commit the only way to modify the domain is to completely override portal_my_quotes/portal_my_orders.
      Since this function is so big this is not clean/easy to do.
      By creating a separate function we can simply override it and we can reuse the same domain in two places.
      
      closes odoo/odoo#84240
      
      Signed-off-by: default avatarYannick Tivisse (yti) <yti@odoo.com>
      38509c2e
    • Mathieu Duckerts-Antoine's avatar
      [FIX] web: flickering in graph view · 3569e1b2
      Mathieu Duckerts-Antoine authored
      
      Chart.js did badly compute the graph canvas container height (width) by
      using clientHeight (resp. clientWidth) that may be rounded up by the
      browser. This leads to the appearence of a useless scrollbar in the
      graph view and makes it flicker on some update.
      
      closes odoo/odoo#84447
      
      X-original-commit: 6bceae94
      Signed-off-by: default avatarAaron Bohy (aab) <aab@odoo.com>
      3569e1b2
  2. Feb 12, 2022
    • Alvaro Fuentes's avatar
      [FIX] stock_landed_costs: use list not tuple · d8322e64
      Alvaro Fuentes authored
      
      ae96f0e introduced an issue because the update of the m2m used a `tuple`
      instead of a `list`
      
      How to reproduce:
      
      * Apply only the (Python) code changes done in ae96f0e, keeping the same
      view (i.e. ignore the changed done to the view in ae96f0e).
      * Instead of `n=5000` in the compute set `n=1` (it cannot be reproduced
      with 5000 unless we create enough dummy data).
      * On a clean v13 db with Landed costs (Accounting + Inventory + Purchase
      + demo data)
      * Confirm a Purchase
      * Create a Landed cost
      * Try to select a transfer
      
      Traceback:
      ```
      ...
          return f(self, *args, **kwargs)
        File "/home/odoo/src/odoo/13.0/odoo/sql_db.py", line 250, in execute
          res = self._obj.execute(query, params)
      psycopg2.errors.UndefinedFunction: operator does not exist: integer = integer[]
      LINE 1: ...FROM "stock_picking" WHERE (("stock_picking"."id" in (ARRAY[...
                                                                   ^
      HINT:  No operator matches the given name and argument types. You might need to add explicit type casts.
      ```
      
      On the reported issues the traceback occur only for DBs with more than
      5000 valid pickings, and for views that use the field
      `allowed_pickign_ids`.
      
      opw-2762355
      
      closes odoo/odoo#84479
      
      X-original-commit: ccd37565
      Signed-off-by: default avatarChristophe Simonis <chs@odoo.com>
      d8322e64
  3. Feb 11, 2022
  4. Feb 10, 2022
    • Benjamin Vray's avatar
      [FIX] website: remove autocomplete from inputs in page properties · 7f458229
      Benjamin Vray authored
      
      Before this commit, on Chrome browser, the page url input and the
      visiblity password input were autocompleted with the user's login and
      password in the page properties options.
      
      After this commit, they are no longer.
      
      Regarding the url input page, it seems to be because Chrome considers
      that the first text input located before a password input in the DOM is
      a login input.
      
      task-2502747
      
      closes odoo/odoo#84372
      
      Signed-off-by: default avatarRomain Derie (rde) <rde@odoo.com>
      7f458229
    • oco-odoo's avatar
      [FIX] survey: Avoid forbidding access to survey when the answer cookie... · c642be8e
      oco-odoo authored
      [FIX] survey: Avoid forbidding access to survey when the answer cookie corresponds to no actual answer
      
      To reproduce:
      
      1) Create a survey and open it with a portal user with its /survey/start/*** link
      
      2) In a private window, connect as the admin and remove the answer in 'Not started yet' state that step 1 created.
      
      3) Go back to your portal user window and re-enter the same /survey/start/*** URL.
      ==> The portal user is brought back to the home page. He has no way to access the survey anymore, the link will always redirect him there.
      
      This is because of cookies. The first time the user opens the survey, it creates a cookie in his browser allowing him to reload the answer he was working on. In our example, this answer has been deleted for some reason (maybe some cleaning of too old 'not started' or 'in progress' stuff); so the token stored in the cookie does not correspond to anything anymore. Instead of crashing and redirecting to home page, this commit makes it so that we now ignore the cookie in that case, so that the user directly has access to the survey to build a new answer.
      
      Task-2729738
      
      closes odoo/odoo#82041
      
      Signed-off-by: default avatarThibault Delavallee (tde) <tde@openerp.com>
      c642be8e
    • oco-odoo's avatar
      [FIX] survey: Don't load answer from other user if a cookie exists · 0be94b7f
      oco-odoo authored
      To reproduce the issue:
      
      1) Create a survey requiring user login, with multiple pages
      
      2) Create portal user A and B
      
      3) With user A, go to URL /survey/start/****, where **** is the access token of your test survey. Fill in the first pages of the survey, but don't finish your submission (so: the answer has to stay 'in progress').
      
      4) Logout from user A.
      
      5) From the same browser window (or without cleaning cookies, at least), directly login with user B, and go to the same /survey/start/**** link
      
      ====> The 'in progress' answer from A is loaded, even though we are connected with B and should hence not have access to it. Instead, we should have created a new blank answer for B.
      
      This is due to our cookie management. When a cookie is kept in the browser with the token of a previously entered answer, we reload it without checking its owner.
      
      Task-2729738
      
      Part-of: odoo/odoo#82041
      0be94b7f
    • Peter Preeper's avatar
      [CLA] add signature for ppreeper · d6bf4a8e
      Peter Preeper authored
      
      closes odoo/odoo#84304
      
      X-original-commit: 8c2917c2
      Signed-off-by: default avatarMartin Trigaux (mat) <mat@odoo.com>
      d6bf4a8e
  5. Feb 09, 2022
    • Ricardo Gomes Rodrigues (rigr)'s avatar
      [IMP] l10n_pt: add type and reference account for taxes · 8d24e33e
      Ricardo Gomes Rodrigues (rigr) authored
      Useful resource to understand the different taxes:
      - IVA dedutível
      - IVA suportado
      - IVA liquidado
      https://www.e-konomista.pt/iva-dedutivel/
      
      
      
      closes odoo/odoo#84267
      
      X-original-commit: d9ad584d
      Signed-off-by: default avatarWilliam André (wan) <wan@odoo.com>
      Signed-off-by: default avatarrigr-odoo <rigr@odoo.com>
      8d24e33e
    • Guillaume (gdi)'s avatar
      [FIX] website_form: fix form ids generation · 52214a3a
      Guillaume (gdi) authored
      
      In order to respect the good practices of HTML, it is preferable that
      the IDs of HTML elements do not start with a number. This makes it
      easier to handle CSS selectors etc.
      
      task-2760205
      
      closes odoo/odoo#84236
      
      Signed-off-by: default avatarQuentin Smetz (qsm) <qsm@odoo.com>
      52214a3a
    • Bruno-brsy's avatar
      [FIX] product: help for field standard_price · 9e0a529b
      Bruno-brsy authored
      
      Step to reproduce:
      1) create a product with, the "Product Type" as
      "Storable Product" + A "Product Category" with a "Costing Method"
      set in "FIFO" mode and the Inventory Valuation in "Automated".
      
      2) create a Purchase Order for 1 unit of that product and set the unit
      price to 10.00. Confirm Order -> Receive Products -> Validate
      (the delivery) -> Apply
      
      3) create a second Purchase Order for 1 unit of the same product but
      set the unit price to a different price, like 20.00. Confirm Order ->
      Receive Products -> Validate (the delivery) -> Apply
      
      4) create a Sales Orders for 1 unit -> Confirm -> Smart button
      Delivery -> Validate -> Apply
      
      5) check the cost on the product form of that product.
      
      On the V13 it will be $10, so its the last unit that left the stock
      On V14 and upper, it will be $20, so the next product that will leave
      the stock.
      
      The help popup for the field "standard_price" doesn't reflect the
      correct behavior. It's the standard price for the next unit instead
      of the last one.
      
      closes odoo/odoo#82678
      
      Signed-off-by: default avatarWilliam Henrotin (whe) <whe@odoo.com>
      9e0a529b
    • Florian Damhaut's avatar
      [FIX] microsoft_calendar: fetch full description · 550ad53e
      Florian Damhaut authored
      
      Step to reproduce:
      - Create a event in outlook with a long description
      - Load the event in Odoo
      
      Current Behaviour:
      - Odoo use the body preview to get the event description
      If the body is longer then, the description in Odoo is incomplete.
      
      Behaviour after PR:
      - Change fetch option to get description as text
      - Use body['content']  as description which is the full body.
      
      opw-2746358
      
      closes odoo/odoo#84054
      
      Signed-off-by: default avatarArnaud Joset <arj@odoo.com>
      550ad53e
    • Dominik Zians's avatar
      [FIX] snailmail: change error code when timeout · b3c46e80
      Dominik Zians authored
      
      When the snailmail API-call timed out, the SnailmailLetter.state and SnailmailLetter.error_code were not changed, which resulted in an infinite loop of retries  via the "Snailmail: process letters queue" cron job.
      This commit changes this behavior: On a timeout the SnailmailLetter.error_code is changed such that no retry happens. Following stable policy, no timeout error is added, but 'unknown error' will be used. Preventing retries on timeout is mandatory as timed-out request are indeed processed by IAP and customer credited.
      
      closes odoo/odoo#84202
      
      X-original-commit: 1d842443
      Signed-off-by: default avatarFlorian Daloze (fda) <fda@odoo.com>
      b3c46e80
    • tranngocson1996's avatar
      [FIX] stock: add hook method · 682030f1
      tranngocson1996 authored
      
      I want to customize the value when creating the stock move but with the
      old code I can't do it. So, I add you a hook method. Look it will be
      more professional and good for developer
      
      closes odoo/odoo#83490
      
      X-original-commit: 8e185dfe
      Signed-off-by: default avatarArnold Moyaux <arm@odoo.com>
      682030f1
    • Tiffany Chang (tic)'s avatar
      [FIX] mrp: clean default_mo_ids when making backorder · 57ffccdc
      Tiffany Chang (tic) authored
      
      Steps to reproduce:
      - create 2 stored products: "Test Manufacture" and "Test Component",
      - create reordering rule (RR),e.g. min=1, max=5, for "Test Component"
        and set its route = Manufacture
      - create 2 BoMs:
        - 1 for "Test Manufacture" that has component = "Test Component"
        - 1 for "Test Component" that has any component (e.g. screw)
      - create + confirm a MO for "Test Manufacture" w/ product_qty = 5
      - cancel the auto-generated MO (via RR) for "Test Component"
      - set qty_producing=1 for "Test Manufacture" + validate + create
        backorder
      - 2 new MOs are created: 2 new MOs, the backordered MO + the RR MO
      
      Expected result: backordered MO linked to original MO via
        "procurement_group_id"
      Actual result: original MO is linked to RR MO via "procurement_group_id"
      
      Issue is due to "default_mrp_production_ids" in context during backorder
      wizard creation which is reused by the RR MO's create, which calls a
      procurement_group.create() that also reuses the same context. This
      context makes it so the newly created procurement group is linked to
      both the RR MO and the original MO. Therefore we remove this default
      value from the context.
      
      There is a rare case that a user may remove the procurement group of the
      original MO. Therefore to ensure that generated backorders are still
      linked to the original MO, we ensure that a MO has a new procurement
      group created + assigned that will be used by its backorders. We ignore
      the case where a procurement group is removed after backorders have
      already been created because there's not much we can do about that.
      
      closes odoo/odoo#84203
      
      Fixes: odoo/odoo#83742
      Signed-off-by: default avatarArnold Moyaux <arm@odoo.com>
      57ffccdc
  6. Feb 08, 2022
  7. Feb 07, 2022
    • Josse Colpaert's avatar
      [IMP] account: put country_code field in debit note and reversal wizard · bb59d8dd
      Josse Colpaert authored
      Preparation for a later PR where we use the country_code field to only show fields in the debit note and reversal wizard based on the country of the company
      
      Backport of https://github.com/odoo/odoo/pull/83986/commits/44226366e3bb657ee5299662a788b8a07b16431f
      
      
      
      closes odoo/odoo#84114
      
      Signed-off-by: default avatarWilliam André (wan) <wan@odoo.com>
      bb59d8dd
    • Ivàn Todorovich's avatar
      [FIX] (sale_)coupon: properly handle empty rule_products_domain · 59efbf39
      Ivàn Todorovich authored
      
      Also simplify _is_valid_product method to make use of _get_valid_products.
      As it uses filtered_domain is more efficient than a search_count.
      
      closes odoo/odoo#84107
      
      Signed-off-by: default avatarVictor Feyens (vfe) <vfe@odoo.com>
      59efbf39
    • pedrambiria's avatar
      [FIX] sale_coupon: check coupon's date with present time · a7fc9368
      pedrambiria authored
      
      Before this commit: a coupon's start and end dates were compared with
      the order date. When a customer adds a product to the cart, it creates
      an order on the website. If the customer makes an order, it will remain
      active until he completes it, even when the coupon is expired.
      
      To reproduce the problem, add a product to the cart, create a coupon,
      and set its end date to present time. Now you can use the coupon after
      the end date has passed. So it's better to check the date with the
      current time.
      
      opw-2711987
      
      closes odoo/odoo#83882
      
      X-original-commit: 5ce13cc0
      Signed-off-by: default avatarYannick Tivisse (yti) <yti@odoo.com>
      a7fc9368
    • Tom De Caluwé's avatar
      [FIX] website: remove divs created by default shadow computation · 17f1a0e6
      Tom De Caluwé authored
      
      The shadow option needs to create a div on the fly to be able to
      retrieve the default shadow value. This commit makes sure these divs
      are also removed when no longer needed.
      
      task-2752326
      
      closes odoo/odoo#82223
      
      Signed-off-by: default avatarQuentin Smetz (qsm) <qsm@odoo.com>
      17f1a0e6
    • qsm-odoo's avatar
      [FIX] website: update modal scrolling behavior after image loading · b83b465d
      qsm-odoo authored
      With commit [1] (and the parent commit here which reviews it), we
      move the scrollbar to the modal instead of the website content if the
      modal has scrollable content even in the case there is no backdrop. An
      exemple would be the cookie bar, configured in popup mode, with a tall
      content inside.
      
      This was however not enough: the computation which determines if the
      modal should be scrollable or not was not re-done after an image was
      loaded. So if the popup was around the height of the window, it could be
      smaller than the window's height before images loading and taller after
      which would result in having the scrollbar on the body instead of the
      scrollable popup.
      
      [1]: https://github.com/odoo/odoo/commit/8f1dd6d6087ad8252d6e7b22d13aad2c4a3f19c6
      
      
      
      closes odoo/odoo#83921
      
      Signed-off-by: default avatarRomain Derie (rde) <rde@odoo.com>
      b83b465d
    • qsm-odoo's avatar
      [FIX] website, *: restore unconventional dialogs opening + review scroll · a2363337
      qsm-odoo authored
      *: web_editor
      
      Commit [1] was not coded defensively enough: after it, dialogs not using
      a proper bootstrap structure triggered a traceback once they were opened
      (this was discovered on odoo.com where such unconventional dialogs do
      exist). Bad luck: there was actually a check to allow unconventional
      dialogs but it was not done at the right location.
      
      However, fixing this, it was found that more than this was not ok. There
      is actually no need to consider the modal-content element at all. Just
      using our `hasScrollableContent` method is enough and requires no extra
      search in the DOM. This actually also properly computes if the modal
      overflows or not while it was not the case before as it did not consider
      the modal-dialog element's paddings.
      
      Finally, the whole customized behavior of the modal scrollbar here was
      only designed to affect our Odoo modals with the s_popup_no_backdrop
      class (see original commit [2]). Indeed, only in that case we want to be
      able to switch between body scrolling and modal scrolling while the
      modal is opened. In custom cases and other Odoo cases, we want the
      standard Boostrap behavior of only being able to interact with the modal
      while opened. This commit cleans the code to restore that spirit
      (hopefully this does not cause stability issues as [1] was introduced
      only a week ago). Sorry for any inconvenience.
      
      [1]: https://github.com/odoo/odoo/commit/8f1dd6d6087ad8252d6e7b22d13aad2c4a3f19c6
      [2]: https://github.com/odoo/odoo/commit/e5a5f98819b3a70b3e2564fb91722cab415ceea9
      
      Part-of: odoo/odoo#83921
      a2363337
    • Agustín Castro Bugallo's avatar
      [FIX] stock_account: fix expected singleton error on post · acda26fd
      Agustín Castro Bugallo authored
      
      While calling `_stock_account_prepare_anglo_saxon_out_lines_vals`, the line
      `credit_expense_account = accounts['expense'] or self.journal_id.default_account_id`
      can cause a 'Expected singleton' error. During upgrades from v13 and earlier,
      the value used for `accounts['expense']` is always `None`.
      If the recordset in `self` contains more than one record, the error will happen.
      
      By replacing `self` with the iteration object `move`, this error is averted.
      
      The error happened during an upgrade from v13. Since the value assigned to
      `accounts['expense']` doesn't exist in that version, it goes to
      `self.journal_id.default_account_id` to grab it.
      If `self` has more than one record, the error happens.
      
      Traceback:
      ```
      Traceback (most recent call last):
        File "/home/odoo/src/odoo/14.0/odoo/service/server.py", line 1199, in preload_registries
          registry = Registry.new(dbname, update_module=update_module)
        File "/home/odoo/src/odoo/14.0/odoo/modules/registry.py", line 89, in new
          odoo.modules.load_modules(registry._db, force_demo, status, update_module)
        File "/home/odoo/src/odoo/14.0/odoo/modules/loading.py", line 475, in load_modules
          migrations.migrate_module(package, 'end')
        File "/home/odoo/src/odoo/14.0/odoo/modules/migration.py", line 180, in migrate_module
          migrate(self.cr, installed_version)
        File "/tmp/tmpae3wx5o6/migrations/account/saas~13.4.1.1/end-09-payment-refactoring.py", line 618, in migrate
          util.iter_browse(env["account.move"].with_context(**ctx), ids, chunk_size=1024).action_post()
        File "/tmp/tmpae3wx5o6/migrations/util/orm.py", line 197, in caller
          return [getattr(chnk, attr)(*args, **kwargs) for chnk in chain(it, self._end())]
        File "/tmp/tmpae3wx5o6/migrations/util/orm.py", line 197, in <listcomp>
          return [getattr(chnk, attr)(*args, **kwargs) for chnk in chain(it, self._end())]
        File "/home/odoo/src/odoo/14.0/addons/sale/models/account_move.py", line 14, in action_post
          res = super(AccountMove, self).action_post()
        File "/home/odoo/src/odoo/14.0/addons/account/models/account_move.py", line 2715, in action_post
          self._post(soft=False)
        File "/home/odoo/src/enterprise/14.0/l10n_mx_edi_landing/models/account_move.py", line 26, in _post
          return super()._post(soft)
        File "/home/odoo/src/enterprise/14.0/l10n_mx_edi/models/account_move.py", line 456, in _post
          return super()._post(soft=soft)
        File "/home/odoo/src/odoo/14.0/addons/sale/models/account_invoice.py", line 75, in _post
          posted = super()._post(soft)
        File "/home/odoo/src/odoo/14.0/addons/purchase_stock/models/account_invoice.py", line 171, in _post
          return super()._post(soft)
        File "/home/odoo/src/enterprise/14.0/account_reports/models/account_activity.py", line 75, in _post
          return super()._post(soft)
        File "/home/odoo/src/odoo/14.0/addons/stock_account/models/account_move.py", line 49, in _post
          self.env['account.move.line'].create(self._stock_account_prepare_anglo_saxon_out_lines_vals())
        File "/home/odoo/src/odoo/14.0/addons/stock_account/models/account_move.py", line 158, in _stock_account_prepare_anglo_saxon_out_lines_vals
          'account_id': credit_expense_account.id,
        File "/home/odoo/src/odoo/14.0/odoo/fields.py", line 3821, in __get__
          raise ValueError("Expected singleton: %s" % record)
      ValueError: Expected singleton: account.account(1383, 38, 30)
      ```
      
      closes odoo/odoo#83739
      
      Signed-off-by: default avatarWilliam Henrotin (whe) <whe@odoo.com>
      acda26fd
    • Hubert Van de Walle (huvw)'s avatar
      [FIX] payment_payulatam: change test signature data · 5c9b42fa
      Hubert Van de Walle (huvw) authored
      
      The test `test_20_payulatam_form_management` was not passing
      since #68593 due to the signature change
      
      closes odoo/odoo#84060
      
      X-original-commit: 5f43d0a1
      Signed-off-by: default avatarAntoine Vandevenne (anv) <anv@odoo.com>
      5c9b42fa
    • Hubert Van de Walle (huvw)'s avatar
      [FIX] payment_payulatam: backport of webhooks support · 07e92ee0
      Hubert Van de Walle (huvw) authored
      The original task is task-2701097
      opw-2627875
      
      X-original-commit: 4ab4f3c4
      Part-of: odoo/odoo#84060
      07e92ee0
Loading