Skip to content
Snippets Groups Projects
  1. Feb 09, 2023
    • pedrambiria's avatar
      [FIX] google_calendar: avoiding return of recordset when using ormcache · 91f9bf2b
      pedrambiria authored
      
      Before this commit: In some cases where some events won't sync to
      Odoo properly you got the "Unable to use a closed cursor." error. The
      problem is that `_from_google_ids` function returns a recordset, and the
      underlying cursor may be closed.
      
      Steps to reproduce the issue:
       1. Create user_A and user_B in Odoo
       2. Sync user_A and user_B with Google calendar
       3. Create an event with user_B on the Google calendar
       4. Run the "Google Calendar: synchronization" cron
       5. Change the created event's owner to user_A on the Google calendar
       6. Run the "Google Calendar: synchronization" cron
      => You will get this error on the log, and the event won't sync:
      
      ```
      Traceback (most recent call last):
        File "/home/odoo/src/odoo/odoo/api.py", line 886, in get
          return field_cache[record._ids[0]]
      KeyError: 99
      
      During handling of the above exception, another exception occurred:
      
      Traceback (most recent call last):
        File "/home/odoo/src/odoo/odoo/fields.py", line 1061, in __get__
          value = env.cache.get(record, self)
        File "/home/odoo/src/odoo/odoo/api.py", line 889, in get
          raise CacheMiss(record, field)
      odoo.exceptions.CacheMiss: 'calendar.event(99,).google_id'
      
      During handling of the above exception, another exception occurred:
      
      Traceback (most recent call last):
        File "/home/odoo/src/odoo/addons/google_calendar/models/res_users.py", line 91, in _sync_all_google_calendar
          user.with_user(user).sudo()._sync_google_calendar(google)
        File "/home/odoo/src/odoo/addons/google_calendar/models/res_users.py", line 70, in _sync_google_calendar
          synced_events = self.env['calendar.event']._sync_google2odoo(events - recurrences, default_reminders=default_reminders)
        File "/home/odoo/src/odoo/addons/google_calendar/models/google_sync.py", line 147, in _sync_google2odoo
          existing = google_events.exists(self.env)
        File "/home/odoo/src/odoo/addons/google_calendar/utils/google_event.py", line 180, in exists
          events.odoo_ids(env)
        File "/home/odoo/src/odoo/addons/google_calendar/utils/google_event.py", line 88, in odoo_ids
          found = self._load_odoo_ids_from_db(env, model)
        File "/home/odoo/src/odoo/addons/google_calendar/utils/google_event.py", line 111, in _load_odoo_ids_from_db
          mapping = {e.google_id: e.id for e in odoo_events}  # {google_id: odoo_id}
        File "/home/odoo/src/odoo/addons/google_calendar/utils/google_event.py", line 111, in <dictcomp>
          mapping = {e.google_id: e.id for e in odoo_events}  # {google_id: odoo_id}
        File "/home/odoo/src/odoo/odoo/fields.py", line 1087, in __get__
          recs._fetch_field(self)
        File "/home/odoo/src/odoo/odoo/models.py", line 3276, in _fetch_field
          self._read(fnames)
        File "/home/odoo/src/odoo/addons/calendar/models/calendar_event.py", line 436, in _read
          super()._read(fields)
        File "/home/odoo/src/odoo/odoo/models.py", line 3343, in _read
          cr.execute(query_str, params + [sub_ids])
        File "<decorator-gen-20>", line 2, in execute
        File "/home/odoo/src/odoo/odoo/sql_db.py", line 89, in check
          raise psycopg2.OperationalError('Unable to use a closed cursor.')
      ```
      
      The solution is to use ormcache on a function that returns the ids of the
      events.
      
      opw-3098799
      
      closes odoo/odoo#109557
      
      Signed-off-by: default avatarArnaud Joset <arj@odoo.com>
      91f9bf2b
  2. Feb 08, 2023
  3. Feb 07, 2023
  4. Feb 06, 2023
  5. Feb 05, 2023
  6. Feb 03, 2023
  7. Feb 02, 2023
    • Pablo Montenegro's avatar
      [FIX] l10n_ar: VAT on foregin invoices · 613aaa09
      Pablo Montenegro authored
      
      Partner's VAT identification number now is not missing when printing Foregin Invoices.
      
      closes odoo/odoo#110483
      
      Task: 947
      Signed-off-by: default avatarJosse Colpaert <jco@odoo.com>
      613aaa09
    • roen-odoo's avatar
      [FIX] point_of_sale: Correctly compute refund cogs value · df2bd1f7
      roen-odoo authored
      
      Current behavior:
      When making a refund of an order in the PoS, the cost of good was
      computed as if the refund was a classic order.
      
      Steps to reproduce:
      - Make sure you are in anglo-saxon accounting
      - Create a category that use AVCO and automated valuation
      - Create a product with a cost of 10€ that is part of the new category
      - Create a PoS order with the product
      - Refund the order
      - Close the session, and check the accounting entries, the cost of good
        sold is 20€ instead of 0€
      
      Note: this fix needs you to set the return picking type in the Operation
      type of the PoS
      
      opw-3149324
      
      closes odoo/odoo#111252
      
      Signed-off-by: default avatarWilliam Henrotin (whe) <whe@odoo.com>
      df2bd1f7
    • yhu-odoo's avatar
      [FIX] mrp: cancel leftover moves when create backorder · d99ac29d
      yhu-odoo authored
      
      Previously, when underconsumption occured, we split the move (in
      post_inventory). And if backorder, the moves not done would be linked to
      the new backorder MO (when backorder MO is created).
      After 8883c06a, we create backorder MOs
      before _post_inventory, making it so the moves not done will not be
      linked to the backorder MOs and reserved qtys are not released.
      To fix, we set cancel_backorder to be true to cancel all the leftover
      moves and release the reserved qty.
      
      Task-2697611
      
      closes odoo/odoo#80271
      
      closes odoo/odoo#110990
      
      Signed-off-by: default avatarTiffany Chang <tic@odoo.com>
      Signed-off-by: default avatarWilliam Henrotin (whe) <whe@odoo.com>
      d99ac29d
    • yhu-odoo's avatar
      [IMP] mrp: make mo under consumption consistent with picking · c89c563b
      yhu-odoo authored
      Considering the MO under consumption situation:
        component A, to consume = 2, consumed = 1
      Previous, after "mark as done", the MO will have two lines:
        component A, to consume = 1, consumed = 1, state done
        component A, to consume = 0, consumed = 0, state done
      Now, after "mark as done", it will be consistent with picking:
        component A, to consume = 1, consumed = 1, state "done"
        component A, to consume = 1, consumed = 0, state "concel"
      
      Task 2446915
      PR #66583
      ENT PR odoo/enterprise#16554
      
      NOTE: this commit has been backported from [1] and, at that time, the
      modified part of the test `test_basic` didn't exist. Then, the part of
      the test has been added with the assert value equal to '2' and has been
      modified during the FW (see [2]) so it matches with the new behaviour
      introduced by [1]
      Same with [3]
      
      [1] 729db008
      [2] odoo/odoo#75001
      [3] odoo/odoo#75443
      
      Part-of: odoo/odoo#110990
      c89c563b
    • Bruno Boi's avatar
      [FIX] web: render all day events (calendar) · 7d1ccd77
      Bruno Boi authored
      
      The calendar renderer used event.record.allday and not event.allDay
      and as such doesn't use the attribute set on the view.
      If the model doesn't have a field called 'allday' this can't work.
      This commit fixes that.
      OPW-2968130
      
      closes odoo/odoo#110669
      
      Signed-off-by: default avatarMichaël Mattiello <mcm@odoo.com>
      Co-authored-by: default avatarJustine Doutreloux <justine.doutreloux@acsone.eu>
      7d1ccd77
    • Justine Doutreloux's avatar
      [CLA] add signature for jdoutreloux · 0dc41e59
      Justine Doutreloux authored
      Part-of: odoo/odoo#110669
      0dc41e59
    • Paimon's avatar
      [CLA] add CLA for paimonchan · 08586e85
      Paimon authored
      
      closes odoo/odoo#111293
      
      Signed-off-by: default avatarWilliam Henrotin (whe) <whe@odoo.com>
      08586e85
    • Paimon's avatar
      [FIX] fix cannot change product company when only eixst single company · 4364183a
      Paimon authored
      Part-of: odoo/odoo#111293
      4364183a
  8. Feb 01, 2023
    • Daniel Reis's avatar
      [FIX] bus: Bus unavailable error in multi process mode · 9a2823ca
      Daniel Reis authored
      Starting the Odoo server with more than one worker results in repeated
      "Bus unavailable" exceptions in the server log.
      
      This seems related to the change made at
      https://github.com/odoo/odoo/commit/a2ed3d3d5bdb6025a1ba14ad557a115a86413e65
      
      
      
       Investigation shows the the bus model file is loaded before gevented
       mode is started, and thus the wroker won't have the ImDispach
       available.
      
      closes odoo/odoo#111352
      
      Signed-off-by: default avatarStockbauer Matthieu (tsm) <tsm@odoo.com>
      9a2823ca
    • Romain Derie's avatar
      [FIX] website: not rely on sudo cache magic for menu visibility · bdaae9ad
      Romain Derie authored
      
      Before this commit conditions based on `_handle_visibility` and
      `_get_cached_visibility` did work only by relying on the cache of the
      `menu.page_id` being populated when accessing `is_visible` in sudo.
      This does not work if the cache is cleared between the calls.
      
      This commit makes sure all 3 conditions have access the record.
      
      The actual issue has not been reproduced locally yet.
      The various workers, crons, websocket work on distinct envs - even
      through code they cannot impact the cache of another local env outside
      the `check_signaling` system which is only used between requests.
      For the problem to occur, some intra-request multithreading is needed
      but it could not be located so far.
      
      task-3149270
      
      closes odoo/odoo#111217
      
      Signed-off-by: default avatarRomain Derie (rde) <rde@odoo.com>
      bdaae9ad
  9. Jan 31, 2023
    • Julien (jula)'s avatar
      [FIX] web, stock: escape JSON error when downloading report · 740c7c61
      Julien (jula) authored
      
      __Description of the issue:__
      
      When something goes wrong while downloading a report file, a 500 error
      is sent as JSON. However the frontend interprets this response as HTML
      and then try to parse the text content as JSON.
      
      Most of the time this works, but if the response contains any HTML tags,
      like `<lambda>` from a Python stacktrace, the JSON response will get
      misinterpreted as HTML instead of regular text, causing the subsequent
      JSON interpretation to fail.
      
      The end result for the user is that empty tracebacks will be displayed
      instead of User Errors or actual tracebacks.
      
      __Desired behavior:__
      
      The JSON response is HTML escaped before being sent and will therefore
      be correctly parsed and displayed to the user.
      
      This basically restore what was done prior of #104594.
      
      closes odoo/odoo#111433
      
      Enterprise: odoo/enterprise#36523
      Signed-off-by: default avatarJulien Castiaux <juc@odoo.com>
      740c7c61
    • Stefan-Calin Crainiciuc (stcc)'s avatar
      [FIX] sale_mrp, sale_stock: compute is_reverse based on move type · f7582195
      Stefan-Calin Crainiciuc (stcc) authored
      
      Very similar to the usecase in commit dafe732e6874fbdd15dfd213b5c5c0cde93e534e
      
      Steps to reproduce:
      
      - Install Accounting, Sales, Stock
      - Create a product category PC:
      	- Costing method: FIFO
      	- Inventory Valuation: Automated
      - Create a product P:
          - Type: Storable
          - Product Category: PC
      - Create a Sales Order SO with 1 x P at cost 10
      - Confirm delivery
      - SO > Create Invoice > Post
      - SO > Return the delivery
      - Change product price from 10 to 6
      - SO > Create Invoice (!!)
      - The invoice will be marked as a credit note automatically
      - Post the invoice
      
      Issue:
      
      The product is listed in the journal items, which is correct,
      but its value is 6 while it should be 10.
      
      If we create the invoice from the Sales Order instead of adding a
      credit note, then the move lines will not be considered reversed,
      since they do not have an associated invoice.
      
      Solution:
      
      Consider the move type when deciding if the move line is reversed or not.
      
      opw-3077772
      
      closes odoo/odoo#111035
      
      Signed-off-by: default avatarAdrien Widart <awt@odoo.com>
      f7582195
    • roen-odoo's avatar
      [FIX] point_of_sale: Add internal product reference to invoice · 94b23475
      roen-odoo authored
      
      Current behavior:
      The internal product reference is not added to the invoice when the
      invoice is created from the POS.
      
      Steps to reproduce:
      - Create an order in the POS
      - Validate the order and print the invoice
      - Open the invoice, the internal product reference is not written on the
        invoice
      
      opw-3119678
      
      closes odoo/odoo#111371
      
      Signed-off-by: default avatarEngels Robin (roen) <roen@odoo.com>
      94b23475
    • pedrambiria's avatar
      [FIX] pos_adyen: prevent having the same Adyen in multi-company · a9e4b1ad
      pedrambiria authored
      
      Before this commit: it was possible to create two PoS terminals in two
      companies with the same `adyen_terminal_identifier`. So it's possible,
      after each payment, it would add the response to the wrong payment
      method's `adyen_latest_response`.
      
      The solution is to bypass multi-company record rule in
      `_check_adyen_terminal_identifier`.
      
      opw-3131814
      
      closes odoo/odoo#111320
      
      Signed-off-by: default avatarTrinh Jacky (trj) <trj@odoo.com>
      a9e4b1ad
    • std-odoo's avatar
      [FIX] microsoft_outlook: support single tenant apps · 23a33bb7
      std-odoo authored
      
      Purpose
      =======
      Allow to customize the Outlook endpoint to be able to use single
      tenant apps.
      
      Task-3053447
      
      closes odoo/odoo#104795
      
      Signed-off-by: default avatarThibault Delavallee (tde) <tde@openerp.com>
      23a33bb7
    • niyasraphy's avatar
      [FIX] website_forum: display correct user image in forum sidebar · 31ad927c
      niyasraphy authored
      
      Before this commit, on accessing the validation queue in the website forum,
      the user image shown in the sidebar is different from the logged in user image.
      
      The cause of issue was the variable passed from the controller and the
      variable used for iterating the for loop who are the same, aka user. Thus
      the value for 'user' is getting changed. resolved by storing the user value
      to a temporary variable and restoring it after the loop.
      
      After this commit, in the validation queue it will show the same logged in
      user image in sidebar.
      
      closes odoo/odoo#110904
      
      Signed-off-by: default avatarThibault Delavallee (tde) <tde@openerp.com>
      31ad927c
    • Samuel Degueldre's avatar
      [FIX] web: update owl to 1.4.11 · 30ec5fde
      Samuel Degueldre authored
      Release notes: https://github.com/odoo/owl/releases/tag/v1.4.11.1
      
      
      
      This fixes an issue with refs in iframes in firefox 109+
      
      closes odoo/odoo#111344
      
      Signed-off-by: default avatarAaron Bohy (aab) <aab@odoo.com>
      30ec5fde
  10. Jan 30, 2023
    • Romain Derie's avatar
      [FIX] website: redirect to case insensitive URL if not exact match · 639cfc76
      Romain Derie authored
      
      Before this commit, if a link to a page was not correct because of a
      case mismatch, it would simply land on a 404 page.
      While it's correct, as URL are case sensitive, it leads to a few bad UX
      flow at the admin/editor level:
      - Create a link in your page (on a text or a button eg), type an URL
        which does not exists (to create it after) like /Page
      - Click on the link/button you just made, you are redirected to /Page
        which display a 404 with the "Create page" option (correct)
      - When you click on that button, it will actually create a page with
        /page URL, leading to a mismatch between the URL you created and the
        page URL.
        Your link/button will still lead to a 404 URL as it points to /Page.
      
      Since it's just a fallback when an exact URL match is not found, it
      should not break anything and should not have bad impact at any level
      (seo/speed etc).
      Indeed:
      - It's done through a 302 redirect
      - `_serve_page()` is already a fallback case, so it will only make
        the `website.redirect` and 404 cases a bit slower due to the extra
        search query.
      
      The only possible scenario seems to be if the user (mind the uppercase):
      - Created a /Page page
      - Created a redirect from /page to /another-page
      
      In this case, /page won't land on /another-page but on /Page.
      This flow seems unlikely and is not actually wrong either way.
      At least, it certainly is less important than ensuring a case
      insensitive fallback.
      
      Finally, note that another solution would have been to either:
      - Force page URL to lower case.
        -> This is not stable friendly, people might be relying on this to
           create pages with different casing:
           `/Batman-VII-The-Dark-Knight-Whatevers`, while not recommended,
           doesn't sounds idiot.
           On top of not being stable friendly, we probably want to keep
           offering this possibility
      - Redirect all URLs to lowercase endpoints.
        -> This is obviously not stable and not Odoo's jobs. It should be
           something decided by the sysadmin and done at nginx (etc) level.
      
      task-3110294
      opw-3104030
      
      closes odoo/odoo#109812
      
      Signed-off-by: default avatarQuentin Smetz (qsm) <qsm@odoo.com>
      639cfc76
    • Nasreddin Boulif (bon)'s avatar
      [FIX] survey: fix print of survey results · b933fcf5
      Nasreddin Boulif (bon) authored
      
      Steps to reproduce (Using Chromium-based browser > v. 108):
      
        - Install Survey module
        - Open 'Feedback Form' survey
        - Click on 'See Results' button
        - Try to print the 'results' of 'Feedback Form'
      
      Issues:
      
        - Hundreds of empty pages added when printing.
        - Chart not fully displayed.
      
      Cause:
      
        - The chartjs library add some HTML elements not displayed (inside div
        with class `chartjs-size-monitor`) to handle the resizing of the
        chart canvas.
        One of the element has a width and height of 1000000px with an
        overflow:hidden, but the overflow does not work properly when printing.
        (Issue introduced in Chrome v. 108, working fine in v. 107 or on any
        Firefox version)
      
        - The chart canvas is not resized to 100% of its parent container and
        therefore not fully displayed. (Not working in all Chrome and Firefox
        versions)
      
      Solution:
      
        Add CSS (with print media rule):
        - Set style to `display: none` on `chartjs-size-monitor` HTML element.
        - Set the width and height of the chart canvas to 100%.
      
      opw-3109523
      
      closes odoo/odoo#110874
      
      Signed-off-by: default avatarNasreddin Boulif (bon) <bon@odoo.com>
      b933fcf5
    • Andrea Grazioso (agr-odoo)'s avatar
      [FIX] l10n_mx: wrong tag on 899.01.99 account · 1ff11758
      Andrea Grazioso (agr-odoo) authored
      
      opw-3073678
      
      closes odoo/odoo#111330
      
      Related: odoo/enterprise#36448
      Signed-off-by: default avatarNicolas Viseur (vin) <vin@odoo.com>
      1ff11758
    • Jurgen (jugj)'s avatar
      [FIX] hr_org_chart: Count indirect subordinates correctly · 23e729e5
      Jurgen (jugj) authored
      
      task - 3142380
      
      closes odoo/odoo#110687
      
      Signed-off-by: default avatarKevin Baptiste <kba@odoo.com>
      23e729e5
    • Pierre-Yves Dufays's avatar
      [FIX] survey: fix detect duplicate partner invitation · 78912f10
      Pierre-Yves Dufays authored
      
      When sending the same survey to the same partner, the system detects it and
      allows the user to choose between sending a new invitation or resending the
      old one so that the user can continue the survey that might already be ongoing.
      The detection was not working anymore and this fixes the problem.
      
      Technical note: _compute_existing_partner_ids was intersecting record set
      partner_ids (the one currently added) and a record set of partner for which an
      invitation has already been sent. The intersection didn't work because
      partner_ids relation was not completely set and instead of id, had "origin" id.
      Comparing id using a filter solves the problem (using the trick that .ids,
      return also the origin ids).
      
      Task-3087702
      
      closes odoo/odoo#108448
      
      Signed-off-by: default avatarWarnon Aurélien (awa) <awa@odoo.com>
      78912f10
    • Richard deMeester's avatar
      [FIX] stock_account: Changing costing method with negative stock · 3ff51daa
      Richard deMeester authored
      
      Usecase to reproduce:
      - Set product as FIFO and a cost of 10$
      - Sell 5 units
      - Modify the cost method to average
      
      We expect the value of the stock to remain -50$.
      However it went to -150$
      
      It happens because the change of cost method is not supported
      with negative quantity of stock. It's not really a huge bug because
      it will be reconcile to the real value in the next in and when the
      stock will be positive again but at least it gives a proper valuation
      of the inventory.
      
      opw-3100717
      
      closes odoo/odoo#108692
      
      Signed-off-by: default avatarArnold Moyaux (arm) <arm@odoo.com>
      3ff51daa
    • Thomas Lefebvre (thle)'s avatar
      [FIX] auth_signup: send confirmation email when registering · fe7cb4da
      Thomas Lefebvre (thle) authored
      
      Steps to reproduce:
      - In settings, activate "Free sign up" option;
      - Go to "Sign in" page;
      - Click on "Don't have an account?";
      - Create an account.
      
      Issue:
      No confirmation email is sent.
      
      Cause:
      The `qcontext.get('token')` variable does not exist
      in the case of a "Free sign up".
      And therefore, we do not respect the condition to send an email.
      
      opw-3103867
      
      closes odoo/odoo#108888
      
      Signed-off-by: default avatarMartin Trigaux (mat) <mat@odoo.com>
      fe7cb4da
Loading