Skip to content
Snippets Groups Projects
  1. May 16, 2023
    • Gauthier Wala (gawa)'s avatar
      [FIX] sale: Some followers of moves should not be added · c3df8fc0
      Gauthier Wala (gawa) authored
      
      - Create a Deferred Revenue Model on a Current Liability account
      - Create a Sale Order yourself (User 1), with Salesperson User 2
      - Create the invoice from it
      - Remove the salesperson from the invoice and add User 3 instead
      - Change the account to the Revenue Model's one
      - Post the invoice
      - Post the deferred revenue created
      => User 2 is follower of the entries generated
      
      The problem is that the context comes from the sales order, and
      contains a `default_user_id` in the context.
      The solution provided is to remove it from the context given, as
      it serves no purpose (the invoices are already created).
      
      opw-3141495
      
      closes odoo/odoo#121514
      
      X-original-commit: 31046332
      Signed-off-by: default avatarVictor Feyens (vfe) <vfe@odoo.com>
      Signed-off-by: default avatarWala Gauthier (gawa) <gawa@odoo.com>
      c3df8fc0
    • Julien Van Roy's avatar
      [FIX] account_edi_ubl_cii: unit prices should not be rounded · bd795593
      Julien Van Roy authored
      When unit prices have more than 2 digits, it is currently not reflected
      in the UBL formats. Consequently, the line amounts are not equal to the
      unit price * quantity (assume there is no discount, charges or
      allowance) and it raises validation errors: "Invoice line net amount
      MUST equal (Invoiced quantity * (Item net price/item price base
      quantity) + Sum of invoice line charge amount - sum of invoice line
      allowance amount".
      
      To fix this, we no longer round the unit prices.
      
      NB: the decimal accuracy should be set in the settings (otherwise, the
      default is 2 digits for unit prices).
      
      See https://docs.peppol.eu/poacc/billing/3.0/bis/#_rounding
      
      
      
      opw-3290035
      task-3302904
      
      closes odoo/odoo#121508
      
      X-original-commit: d7d41991
      Signed-off-by: default avatarLaurent Smet <las@odoo.com>
      Signed-off-by: default avatarJulien Van Roy <juvr@odoo.com>
      bd795593
    • roen-odoo's avatar
      [FIX] pos_sale: remove auto promotion from settled orders · 895c7601
      roen-odoo authored
      
      Current behavior:
      When you apply a promotion on a sale order, then settle it in a PoS
      session, the promotion will be applied two times. One time from the sale
      order, and one from the PoS.
      
      Steps to reproduce:
      - Create a promotion program with a discount of 50% with no code needed
      - Add the promotion program to the PoS
      - Create a sale order with a product of 200$ and apply the promotion
      - The total price of the order should be 100$
      - Settle the sale order in a PoS session
      - The promotion is applied twice and the total price is 50$ instead of
        100$
      
      opw-3247545
      
      closes odoo/odoo#119673
      
      Signed-off-by: default avatarJoseph Caburnay (jcb) <jcb@odoo.com>
      895c7601
    • David Tran's avatar
      [FIX] sale: log notes with wrong quotation viewer · 6e166502
      David Tran authored
      
      The note "Quotation viewed by customer" posted when a public/portal user
      access an order came with the order's partner name instead of the actual
      user's partner name
      
      This made confused for internal users to see something in internal note
      like **Colleen Diaz** with a message **Quotation viewed by customer
      Nicole Ford**
      
      This commit makes sure to use the right partner name except the
      quotation is viewed anonymously (with access token)
      
      closes odoo/odoo#121515
      
      X-original-commit: 3489fd16
      Signed-off-by: default avatarVictor Feyens (vfe) <vfe@odoo.com>
      6e166502
    • Mahdi cheikh rouhou (macr)'s avatar
      [FIX] sale : get correct button title invoice email · 8d791167
      Mahdi cheikh rouhou (macr) authored
      
      When we have automatic invoicing enabled , the email sent to the user
      when he confirms his payment online will contain a button 'View Journal
      Entry'
      
      To reproduce the error :
      1- Install accounting, website, ecommerce, sales apps
      2- Go to website settings and activate automatic invoice
      3- Install test payment method and activate it
      4- Log out of the current account
      5- Make a purchase of any item and confirm the payment
      6- You will receive 2 emails , the second one will have the invoice and
      it will contain a button View journal entry
      
      The origin of the problem is not providing model_description when
      sending the invoice so it will take the display_name of the model
      'account.move' by default which is Journal entry.
      
      opw-3271345
      
      closes odoo/odoo#120124
      
      Signed-off-by: default avatarVictor Feyens (vfe) <vfe@odoo.com>
      8d791167
    • Preksha Chouhan's avatar
      [FIX] web_editor: convert color opacity to be compatible with PIL Image color · a5418770
      Preksha Chouhan authored
      
      ValueError 'unknown colour specifier' occurs when we access
      export_icon_to_png(). This error occurs when we change the colour of an
      icon in the mailing template, because the value of alpha (opacity) in 'rgba'
      is in the range of 0 to 1, but PIL Image support colour opacity range 0 to 255.
      
      This commit converts the opacity value range (0 to 1) to a range (0 to 255)
      compatible with the PIL image library when the colour specifier is 'rgba'.
      
      sentry - 3933353285
      
      closes odoo/odoo#116476
      
      Signed-off-by: default avatarDavid Monjoie (dmo) <dmo@odoo.com>
      a5418770
    • niyasraphy's avatar
      [FIX] point_of_sale: error with multi picking validation · a6ffa139
      niyasraphy authored
      
      before this commit, on validating multiple picking
      from the transfers tree view is raising singleton
      exception.
      
      * enable "Ship Later" feature in pos.
      * create two orders with ship later.
      * from inventory app, select the above two
      pickings are from action button click validate
      * exception is raised.
      
      after this commit, no traceback wont be shown.
      
      closes odoo/odoo#120787
      
      Signed-off-by: default avatarJoseph Caburnay (jcb) <jcb@odoo.com>
      a6ffa139
  2. May 15, 2023
    • Mylyna Hy's avatar
      [IMP] point_of_sale: no CoA error visible for pos · 2f817a7b
      Mylyna Hy authored
      
      Problem: The error "There is no chart of accounts installed for this company..." appears for POS shop configurations
      if they don't have a chart template configured for the company. It doesn't take into account if the company has its
      own set of accounts so it will always show the error unless the chart template is set.
      
      Solution: Include an additional condition to check if the company has accounting entries which is used to check
      if the company has used its own set of chart of accounts for accounting.
      
      Purpose: The error will only appear if the company has no chart template set or no accounting entries.
      
      opw-3291399
      
      closes odoo/odoo#121296
      
      X-original-commit: b5106da3
      Signed-off-by: default avatarLaurent Smet <las@odoo.com>
      Signed-off-by: default avatarMylyna Hy (myhy) <myhy@odoo.com>
      2f817a7b
    • Nicolas Lempereur's avatar
      [FIX] web: fix numbering test with l10n date update · ca1d66c5
      Nicolas Lempereur authored
      
      Running "Numbering system" JS test on current version of chrome, two
      assertions fails. This is happening because of an update of
      localization.
      
      Related to commit: 5bfe7321
      
      closes odoo/odoo#121431
      
      Signed-off-by: default avatarNicolas Lempereur (nle) <nle@odoo.com>
      ca1d66c5
    • Benjamin Vray's avatar
      [FIX] website: fix overflowing navbar links on mobile · 4e996e67
      Benjamin Vray authored
      
      This commit fixes a bug with the navbar links in the header of a website
      on mobile. When the text of a link is long enough to be wider than the
      screen, the text does not wrap to the next line as intended, but instead
      overflows to the right outside of the screen, causing part of the text
      to be hidden.
      
      Steps to reproduce the bug:
      
      - Edit the text of one of the menu links on a website to make it longer
      than the width of the mobile screen.
      - Bug: In mobile view, part of the link text is hidden.
      
      This bug occurs with both the "default" hamburger type and the
      "off-canvas" hamburger type.
      
      opw-3233684
      
      closes odoo/odoo#121377
      
      X-original-commit: 0a575bea
      Signed-off-by: default avatarQuentin Smetz (qsm) <qsm@odoo.com>
      Signed-off-by: default avatarVray Benjamin (bvr) <bvr@odoo.com>
      4e996e67
    • Maruan Aguerdouh (magm)'s avatar
      [FIX] crm: forecast_graph view working for dashboard view board · 78be4e64
      Maruan Aguerdouh (magm) authored
      Steps to reproduce:
      
      1. Install CRM and dashboard module
      2. Go to CRM > Reporting > Forecast > Group By: Salesperson.
      3. Click on the graph icon and then on the Stacked icon.
      4. Click on Favorites > Add to My dashboard > Add.
      5. Go to dashboard.
      
      Issue:
      
      The graph is not displayed in the dashboard, instead we got an error
      "Cannot read properties of undefined", which is caused because of the
      new GraphView for the Forecast that's not working for this version.
      
      Solution:
      
      Added legacy ForecastGraphView as in previous similar fixes, to get the
      proper view.
      
      Forward bot up to saas-15.2
      
      similar to https://github.com/odoo/odoo/pull/86571/files
      
      
      
      opw-3284731
      
      closes odoo/odoo#120931
      
      Signed-off-by: default avatarMathieu Duckerts-Antoine <dam@odoo.com>
      78be4e64
    • Florian Charlier's avatar
      [FIX] gamification: update internal users goals · 7f0d1905
      Florian Charlier authored
      
      For performance reason, we avoided computing goals for the set of users
      that didn't log in recently (See ec0c0f29).
      However, users can stay logged in for a while without having a new "log
      in event" (password asked), such that active internal users can keep
      old values in their challenges when reports are sent, which is not good.
      
      Until an improvement can be implemented in master, we drop this time
      constraint for active internal users.
      
      A test is added, checking the behavior of the method called by the cron.
      
      Task-3226408
      
      closes odoo/odoo#121301
      
      X-original-commit: 6c77dd82
      Signed-off-by: default avatarThibault Delavallee (tde) <tde@openerp.com>
      7f0d1905
    • Arnold Moyaux's avatar
      [FIX] stock: wrong variable reference · 0bba45a0
      Arnold Moyaux authored
      
      product variable used in the rounding precision come from the upper
      loop and won't work for all the quantites.
      
      opw-3229080
      
      closes odoo/odoo#121247
      
      X-original-commit: ea923a08
      Signed-off-by: default avatarTiffany Chang <tic@odoo.com>
      0bba45a0
    • Benjamin Vray's avatar
      [FIX] website, website_form: fix anchor link redirects · 425c6841
      Benjamin Vray authored
      Before this commit, links scrolling to an anchor with a special
      character did not work and displayed a traceback. The issue was that to
      check that the anchor is valid, we don't need to check that the anchor
      is a valid url as we have been doing since these commits [1], [2]. But
      we only need to check if the jQuery selector is valid to correctly
      target the element to which the page must scroll.
      
      Indeed, the anchor widget returns stuff like 'ok%C3%A9%25' when typing
      'oké%' wich is not valid jQuery selector. It has to be encoded to
      '#ok\\%C3\\%A9\\%25' to be valid and that's what this commit does.
      
      We also changed the way to display a new anchor to the user in this
      commit. Before, we showed the anchor unencoded in a notification and now
      we show it encoded. That way, if the user copies the anchor from the
      notification, it's the real anchor.
      
      Also, this commit detect if the success URL of the redirect of a from is
      the current page to perform a scroll to the anchor instead of a
      redirect. To make this comparison, we needed to add the url code of the
      language of the current page to the session info.
      
      Also, before this commit, the page froze when we clicked on the "submit"
      button of a form that redirected to an anchor that did not exist.
      
      [1]: https://github.com/odoo/odoo/commit/0abfaeda96c2eaa868cc7fc5fa1926dfa90fc420
      [2]: https://github.com/odoo/odoo/commit/b492bde6a121be1c15ed90ce0827fcfd72a12f5c
      
      
      
      task-2172312
      
      closes odoo/odoo#119720
      
      X-original-commit: fb087dbe
      Signed-off-by: default avatarRomain Derie (rde) <rde@odoo.com>
      425c6841
  3. May 14, 2023
  4. May 12, 2023
    • Christophe Simonis's avatar
      [FIX] core: load tests from all entries in `--upgrade-path` · 08adb3e6
      Christophe Simonis authored
      
      Allow extending tests for any modules, regardless of existing ones
      in another entry of the `upgrade-path`.
      
      Bonus point: tests no longer need to be imported in the `__init__.py`
      file.
      
      closes odoo/odoo#121218
      
      X-original-commit: e4d1a9e0
      Signed-off-by: default avatarChristophe Simonis <chs@odoo.com>
      Co-authored-by: default avatarAlvaro Fuentes <afu@odoo.com>
      08adb3e6
    • Abdelouahab (abla)'s avatar
      [FIX] base: merging unreadable pdfs · d906ac77
      Abdelouahab (abla) authored
      
      To Reproduce
      ============
      - create two Vendor Bills and attach to each one a PDF from the ones
      provided by the client on the ticket.
      - select these two bills and and try to print Original Bills an error will be raised
      
      Problem
      =======
      while merging these PDFs, PyPDF2 throws a `TypeError` which is not caught by the server
      
      Solution
      ========
      catch `TypeError` to raise a UserError
      
      opw-3285540
      
      closes odoo/odoo#121212
      
      X-original-commit: d2b97524
      Signed-off-by: default avatarabla001 <abla@odoo.com>
      d906ac77
    • Touati Djamel (otd)'s avatar
      [FIX] mrp_subcontracting: compute bom price into company currency · 353ba8ef
      Touati Djamel (otd) authored
      
      Steps to reproduce the bug:
      - Enable “subcontracting” in the mrp settings
      - Create a storable product “P1”:
          - Add a vendor:
          - supplier: “Azure interior”
          - currency: euro
          - price: 20
          - Add a BoM:
              - Type: subcontracting
              - add any product as component
              - Save
      - Check that the currency of the company is in dollars
      - Click on Compute Price from BoM button in the product form
      
      Problem:
      The seller's price is not converted into dollars
      
      opw-3321346
      
      closes odoo/odoo#121063
      
      Signed-off-by: default avatarWilliam Henrotin (whe) <whe@odoo.com>
      353ba8ef
    • Mylyna Hy's avatar
      [FIX] stock: show exception log when cancel backorders · ca301df2
      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
      
      closes odoo/odoo#120994
      
      X-original-commit: 92cd7d08
      Signed-off-by: default avatarTiffany Chang <tic@odoo.com>
      ca301df2
  5. May 11, 2023
  6. May 10, 2023
    • Touati Djamel (otd)'s avatar
      [FIX] stock: change product's company · 166a7cfd
      Touati Djamel (otd) authored
      
      Steps to reproduce the bug:
      - Connect with the company A
      - Create a consumable product “P1”
      - Create a receipt transfer with this product
      - confirm the transfer
      - Come back to the product form
      - limiter le produit que a la “Company B”
      
      Problem:
      no user error triggered
      Go to inventory > operation > transfer: a Traceback is triggered
      
      Before this commit, there is no verification while changing a product's
      company for consumable. That can lead to an issue where some operations
      cannot be done because of access errors. To avoid that, this commit
      prevents to change the product's company if some move lines for this
      product exist in another company.
      
      opw-3300559
      
      closes odoo/odoo#120947
      
      X-original-commit: a6666de7
      Signed-off-by: default avatarDjamel Touati (otd) <otd@odoo.com>
      166a7cfd
    • Julien (jula)'s avatar
      [FIX] mail: do not compute chat windows in DiscussPublicView · 6628e05a
      Julien (jula) authored
      
      __Current behavior before PR:__
      When someone joins a call in the discuss public view and receives a message in the chatter, the part of the screen supposed to display the video streams of the participants goes black.
      
      This happens because it is trying to open a chat window in the bottom right as it is done usually. However since we are in the public view it removes it instantly together with the participants cards.
      
      __Description of the fix:__
      If we are in the discuss public view, it is useless to make chat windows. This will prevent opening of chat windows.
      
      __Steps to reproduce the issue:__
      1. Open the discuss app and start a meeting.
      2. Copy the Invitation Link
      3. Open a new private window to join the call with a guest user.
      4. Then go back to the non-guest user page and send a message in the chatter.
      5. Notice that the participants cards vanished on the private window page.
      
      opw-3229747
      
      closes odoo/odoo#119359
      
      Signed-off-by: default avatarAlexandre Kühn (aku) <aku@odoo.com>
      6628e05a
    • pedrambiria's avatar
      [FIX] pos_restaurant: stay on current table after refund · b16ee763
      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#121012
      
      Signed-off-by: default avatarHeinz Robin (rhe) <rhe@odoo.com>
      b16ee763
    • Laurent Smet's avatar
      [FIX] account: Fix cascading computation leading to wrong move_name computation · 147427bb
      Laurent Smet authored
      
      When l10n_mx_edi is installed and a payment is posted, the move_name field on account.move.line
      being a related to move_id.name is not well computed.
      That is because posting a move trigger the computed field in a protected mode due to `flush_recorset`.
      This mode prevents any computed field to be recomputed twice.
      This flush triggers `_compute_name` calling `sequence_mixin`, itself doing another `flush_recorset`.
      This extra flush triggers `_compute_l10n_mx_edi_cfdi_uuid` that access to `move.payment_id.reconciled_bill_ids`.
      This access to this field triggers its recomputation and then, `_compute_stat_buttons_from_reconciliation` is called.
      This method does `self.env['account.move.line'].flush_model()` that force the computation of `move_name` to `/`.
      `sequence_mixin` assigns the new `name` to the journal entry but `move_name` is not recomputed due to the
      protected environment.
      
      closes odoo/odoo#120630
      
      X-original-commit: 29d6101c
      Signed-off-by: default avatarOlivier Colson (oco) <oco@odoo.com>
      Signed-off-by: default avatarLaurent Smet <las@odoo.com>
      147427bb
    • kir-odoo's avatar
      [FIX] delivery: shipping carrier is set after delivery generated · 963b82c3
      kir-odoo authored
      
      Before this commit
      ==================
      when SO is confirmed and Delivery is created then add the shipping method
      in SO, in this case, the shipping carrier is not set in the existing undelivered
      delivery of that SO.
      
      After this commit
      =================
      So in this commit, we set the shipping carrier for undelivered delivery.
      
      taskId - 2946360
      
      closes odoo/odoo#120966
      
      X-original-commit: 58f9139f
      Signed-off-by: default avatarTiffany Chang <tic@odoo.com>
      963b82c3
    • Alvaro Fuentes's avatar
      [FIX] mail: allow to create a manual blacklist model · dead6731
      Alvaro Fuentes authored
      Issue 1: before this patch it was impossible to create a manual model
      marked as "Is blacklist". The reason is that a blacklist model
      implicitly need an `email` field, but such field is impossible to add in
      a manual model: the field must start with `x_`.
      
      Solution: append `x_` to the implicit email field. Note, in principle
      the user gets an error if `x_email` is not present. Solved by adding the
      field when creating the custom model. Ideally we should show some hint
      in the interface to make it more user friendly. That is out of the scope
      of this patch.
      
      Issue 2: when we have a manual model that is mail blacklist it's
      impossible to create its model class. We get an error because the MRO is
      not correct. The reason is that we are adding `mail.thread.blacklist`
      _after_ `mail.thread` in the `_inherit` list. That list is used to
      generated the `__bases__` of the model class[1]. According to Python's
      MRO rules[2], since `mail.thread.blacklist` appears after `mail.thread`
      as parents of the custom model class this order _must_ be respected. But
      `mail.thread` must appear _before_ `mail.thread.blacklist` because the
      latter inherits from the former. This is a contradiction and the MRO
      algorithm cannot succeed. To put it in a simple example:
      ```py
      class A: pass
      class B(A): pass
       # This fails:
       # class C(A, B): pass
       # The right order is:
      class C(B, A): pass
       # Equivalent to:
      class D(B): pass
       # C and D have the same MRO linearization excluding themselves
      assert D.mro()[1:] == C.mro()[1:]
      ```
      Example traceback:
      ```
      Traceback (most recent call last):
        File "/home/odoo/src/odoo/14.0/odoo/service/server.py", line 1201, 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 464, in load_modules
          registry.setup_models(cr)
        File "/home/odoo/src/odoo/14.0/odoo/modules/registry.py", line 263, in setup_models
          env['ir.model']._add_manual_models()
        File "/home/odoo/src/odoo/14.0/odoo/addons/base/models/ir_model.py", line 430, in _add_manual_models
          Model = model_class._build_model(self.pool, cr)
        File "/home/odoo/src/odoo/14.0/odoo/models.py", line 585, in _build_model
          ModelClass.__bases__ = tuple(bases)
      TypeError: Cannot create a consistent method resolution
      order (MRO) for bases BaseModel, mail.thread, mail.thread.blacklist, base
      ```
      
      Solution: check if a model inherits from `mail.thread.blacklist` first.
      There is no need to add `mail.thread` if inheriting
      `mail.thread.blacklist` because the inheritance is already implicit.
      
      This issue was observed during upgrades. We convert custom models and
      fields into manual to allow upgrading without custom code. This causes
      issues because the MRO error appears when a custom model inherits mail
      blacklist.
      
      [1]: https://github.com/odoo/odoo/blob/02f820fb0eaddbb3a4269a0967184c8aaf52c363/odoo/models.py#L585
      [2]: https://www.python.org/download/releases/2.3/mro/
      
      
      
      closes odoo/odoo#120922
      
      X-original-commit: 8848bb57
      Signed-off-by: default avatarChristophe Simonis <chs@odoo.com>
      Signed-off-by: default avatarAlvaro Fuentes Suarez (afu) <afu@odoo.com>
      dead6731
Loading