Skip to content
Snippets Groups Projects
  1. Jun 14, 2019
  2. Jun 13, 2019
  3. Jun 12, 2019
    • Christophe Simonis's avatar
      efc64edf
    • Julien Castiaux's avatar
      [FIX] mail: send same attachment multiple times · 306abd01
      Julien Castiaux authored
      
      In the Discuss app, using Chrome or IE11, try to send the same
      attachment to different channels. The first attachment is correctly
      detected but not the next ones.
      
      The problem is due to a browser inconsistency, on firefox selecting the
      same file in an `<input type=file>` triggers the `change` event. This is
      not the case on Chrome/IE, selecting the same file doesn't triggers an
      `onchange`.
      
      opw-2006647
      
      closes odoo/odoo#34076
      
      Signed-off-by: default avatarAlexandre Kühn (aku) <aku@odoo.com>
      306abd01
    • sri-odoo's avatar
      [FIX] website_slides: design, questions margins · ed7b3b0f
      sri-odoo authored
      
      Slightly increase margins between questions in a test.
      
      closes odoo/odoo#34055
      
      Signed-off-by: default avatarJérémy Kersten (jke) <jke@openerp.com>
      ed7b3b0f
    • Denis Ledoux's avatar
      [FIX] http: Unreachable server when db_maxconn reached during registry loading · 242e485b
      Denis Ledoux authored
      On `WebRequest` `__exit__`, when an exception occured,
      (in `self.registry.signal_changes` or `self.registry.reset_changes`)
      cursor were left unclosed as `self._cr.close` was not called
      in such cases.
      
      Having exceptions in the above mentioned method do not happen
      often, but when it does it left unclosed and unusable cursors
      in the connection pool, and in the extreme case explained below,
      it left the connection pool with only unclosed and unusable cursors.
      The entire server was then unusable as it no longer had working cursors.
      
      Case:
      - Start a multi-thread server with db_maxconn set to 5
      - Ensure you do not send any request to the server,
      not even with a left open tab on `http://localhost:8069` in your browser
      - Send 6 parallel HTTP requests to `/web/login`
      thanks to an external thread python script
      (See below, at the end of this long commit message)
      
      According to your registry state (if you have a lot of modules installed or not),
      and the native Python Garbage Collecting state,
      you might end with
      - either warnings telling some unclosed cursor were garbage collected,
      and therefore closed (by a kind of luck thanks to the Python garbage collecting),
      - either, a server completely blocked not accepting any other request
      (you can try for instance `curl http://localhost:8069`
      and you end up with a `500 Internal Server Error`
      
      This observed issue looks to appear only in 11.0. Not 10.0 or 12.0.
      This is because only 11.0 clear the cache during registry loading:
      `https://github.com/odoo/odoo/blob/f1706c848d41c47646dabca771996e9b9f788241/odoo/modules/loading.py#L236`
      This cache clearing doesn't happen in 10.0 nor 12.0
      (in 12.0, thanks to e181f592)
      
      When sending the 6 parallel requests,
      it uses instantly all the 5 available cursors of the connection pool to handle these requests,
      and when each request exits, in `__exit__`, it calls `self.registry.signal_changes()`
      which tries to open a new cursor because of
      - `self.cache_invalidated` which is True, for all the 6 requests, thanks to the call to `clear_caches`
      explained above during the registry loading and the fact all requests have been treated in parallel,
      - `with closing(self.cursor()) as cr:`, `self.cursor()` attempting to use a new cursor
      (the `closing(...)` does not have any incidence on this issue, despite it could look like guilty)
      
      The attempt to use a new cursor fails, as there is no more available (`db_maxconn` is reached),
      raising a `PoolError('The Connection Pool Is Full')` exception.
      
      In the request `__exit__` method, because of this exception raised when calling `signal_changes`,
      `self._cr.close` is never reached, and the parallel request therefore left only unclosed
      cursors in the connection pool,
      therefore leaving the server in a state where it only has unusable cursors
      and therefore can't do anything more.
      
      This might look like really bad luck to land in such a state,
      but we observed multiple actual case on Odoo.sh,
      the one referenced in this commit (opw-2008340) was because of an Outlook client
      which launched 18 parallel requests to fetch the email images,
      and the server wasn't spawned, therefore neither was the registry.
      The server registry was therefore just loaded when it received the 18 parallel requests,
      and it therefore triggered this extreme use case.
      The server was left unusable for several minutes, until a forced restart.
      
      For reference, here is the script that has been used to trigger the 6 parallel requests:
      ```
      import requests
      import threading
      
      threads = []
      for i in range(6):
      threads.append(threading.Thread(target=lambda: requests.get('http://localhost:8069/web/login'))
      
      )
      for thread in threads:
      thread.start()
      
      ```
      
      opw-2008340
      
      closes odoo/odoo#34071
      
      Signed-off-by: default avatarDenis Ledoux <beledouxdenis@users.noreply.github.com>
      242e485b
    • Christophe Simonis's avatar
    • Christophe Simonis's avatar
    • Christophe Simonis's avatar
      348f3d8b
    • Nicolas Martinelli's avatar
      [FIX] stock: incorrect field · b5dddce5
      Nicolas Martinelli authored
      
      The field is now `quantity`. This wasn't spotted before because the
      method is not used anywhere.
      
      opw-2008491
      
      closes odoo/odoo#34067
      
      Signed-off-by: default avatarNicolas Martinelli (nim) <nim@odoo.com>
      b5dddce5
    • Pierre Rousseau's avatar
      [FIX] snailmail: re-render report when using snailmail · 4c7f236f
      Pierre Rousseau authored
      
      If the option 'Reload from attachment' is checked for a report, it will be generated from the existing attachments.
      However, for snailmail, we have to force the re-rendering to apply specific css rules to match the layout of a A4 letter.
      
      Task-ID: 2008896
      
      closes odoo/odoo#34053
      
      Signed-off-by: default avatarRémi Rahir (rar) <rar@odoo.com>
      4c7f236f
  4. Jun 13, 2019
    • Sébastien Theys's avatar
      [FIX] website_sale: fix modal price when Select Quantity is disabled · bb9c3910
      Sébastien Theys authored
      
      To reproduce:
      
      - Go on the website page of a product with optional products.
      - Disable the Select Quantity customize show.
      - Click add to cart.
      
      This will open the optional product modal, where the quantity will be displayed.
      
      However changing that quantity will have no effect, especially the price will
      not update accordingly.
      
      The real issue is that the quantity should not be displayed there if Select
      Quantity is disabled, but this has never worked before, so this is outside the
      scope of this fix.
      
      Anyway, since the quantity is present there, we would at least expect it to
      correctly recompute the price, which worked fine when the modal was introduced,
      but has been broken since 51e51055
      
      opw-2005317
      
      closes odoo/odoo#33992
      
      Signed-off-by: default avatarNicolas Martinelli (nim) <nim@odoo.com>
      bb9c3910
    • Nicolas Martinelli's avatar
      [FIX] hr_payroll_account: analytic account · 4b8f72eb
      Nicolas Martinelli authored
      
      - Set an analytic account on an employee contract
      - Set credit and debit accounts on the salary rules
      - Create a payslip, confirm
      
      The journal items created do not use the analytic account set on the
      contract.
      
      If no analytic account is set on the salary rule, we fall back on the
      contract account.
      
      opw-2006090
      
      closes odoo/odoo#34095
      
      Signed-off-by: default avatarNicolas Martinelli (nim) <nim@odoo.com>
      4b8f72eb
  5. Jun 12, 2019
    • Xavier-Do's avatar
      [FIX] test_new_api: move demo_data.xml in demo category · 271f1ec6
      Xavier-Do authored
      
      Installing test_new_api without demo will fail since demo_user
      does not exists. This is a problem if we want to test migration
      with all modules installed. This simple fix solve the problem.
      
      closes odoo/odoo#34065
      
      Signed-off-by: default avatarChristophe Simonis <chs@odoo.com>
      271f1ec6
    • Nans Lefebvre's avatar
      [FIX] stock: put stored related field product_code in compute_sudo · f1706c84
      Nans Lefebvre authored
      
      Have a multi-company setup, with shared products.
      Write the default code of a product; an access error is raised on inventory.line
      
      On inventory.line, the field product_code is defined as related to
      'product_id.default_code', and stored.
      So when writing on the default_code of a product, we get the inventory lines of
      other companies. For obvious reasons their access is protected by the record
      rule "Inventory Line multi-company", therefore the access error is raised.
      
      To avoid that situation stored related fields should be in compute_sudo.
      
      Note that similarly this is necessary for product_name.
      There is one more subtlety: directly writing on the product.product does trigger
      the access error, but writing it on the product.template does not.
      
      opw 2007167
      
      closes odoo/odoo#34019
      
      Signed-off-by: default avatarNans Lefebvre (len) <len@odoo.com>
      f1706c84
  6. Jun 11, 2019
  7. Jun 13, 2019
  8. Jun 12, 2019
  9. Jun 11, 2019
Loading