Skip to content
Snippets Groups Projects
  1. Jan 29, 2019
    • Nicolas Martinelli's avatar
      [FIX] stock: unreserve · ae88e509
      Nicolas Martinelli authored
      - Create a SO with 2 stockable products: 1 is available, the other is
        not.
      - Validate, go to the picking
      - Set the 'Shipping Policy' to 'When all products are ready'
      
      The 'Unreserve' button disappears, while some products were reserved.
      
      When changing the shipping policy, the state of the picking is
      recomputed and set as `confirmed` ('Waiting').
      
      We make the button visible in this state also, when 'Shipping Policy'
      is set to 'When all products are ready'.
      
      opw-1932658
      
      closes odoo/odoo#30635
      ae88e509
  2. Nov 28, 2018
  3. Jan 28, 2019
    • Kishan Gajjar's avatar
      [FIX] web_editor: use default value for html fields of new records · daceeb53
      Kishan Gajjar authored
      While creating a new record, the default value of a field used with the
      'html_frame' field widget was not used.
      
      Discovered with task-1903256
      
      closes odoo/odoo#28838
      daceeb53
    • Nans Lefebvre's avatar
      [FIX] mrp: use the true level in BoM structure report · 201a1664
      Nans Lefebvre authored
      The BoM structure report is recursive, since product X might use a product X.Y,
      itself built using a BoM that uses X.Y.Z, and so on.
      To avoid breaking the layout in cases with too deep nestedness,
      the report returned a level bounded by 6.
      This is a totally arbitrary value: the layout can be broken not only
      because of nestedness, but also because of the length of the product name.
      So it doesn't really solve the problem.
      Moreover, a presentation problem should be solved at the presentation layer,
      which is CSS.
      
      opw 1921011
      
      closes odoo/odoo#30606
      201a1664
  4. Jan 24, 2019
    • Moens Alexandre's avatar
      [FIX]mail:reply to message with no author · aecfd1a3
      Moens Alexandre authored
      When a user/partner is deleted, their messages lose their author.
      Replying to those may result in a failure to fetch the mails from the
      incomming mail server.
      
      without this commit, partner_ids == [(4, False)] and this value "goes
      down" all the way to the orm method "write" of the Many2many field.
      
      resulting in a SQL query like :
      
      INSERT INTO mail_message_res_partner_rel (mail_message_id, res_partner_id)
          (SELECT a, b FROM unnest(ARRAY[149855]) AS a, unnest(ARRAY[false]) AS b)
          EXCEPT (SELECT mail_message_id, res_partner_id FROM mail_message_res_partner_rel WHERE mail_message_id IN (149855))
      
      which fails with the ProgrammingError : EXCEPT types boolean and integer
      cannot be matched
      
      opw-1921805
      
      closes odoo/odoo#30528
      aecfd1a3
    • Jorge Pinna Puissant's avatar
      [FIX] account: invoice outstanding credits display · 93614a35
      Jorge Pinna Puissant authored
      Before this commit, in the customer invoice form, when the outstanding
      credits have a big reference or name, the form displayed the name in a
      multiple line which made difficult to read and to understand when a
      credit starts, and when a credit stops. It also overlapped the name and
      the amounts.
      
      Now, when the name is too big, it's truncated, and the full name is
      shown when the mouse hovers the field.
      
      OPW-1915966
      
      closes odoo/odoo#30518
      93614a35
  5. Jan 28, 2019
    • Wolfgang Taferner's avatar
      [FIX] account: negative bank statement amount · c5eeae0d
      Wolfgang Taferner authored
      
      - Create a bank statement for a negative amount, e.g. -100.
      - Click 'Reconcile'.
      - Create a counterpart line for this bank statement, but specify
        receivable account.
      
      The payment created has `partner_type` set as `supplier`.
      
      Although a receivable account is used for customers.
      
      This use case can arise in case of a credit note to a customer: the
      reimbursement should create a customer payment, not a supplier payment.
      
      Co-authored-by: default avatarNicolas Martinelli <nim@odoo.com>
      
      opw-1910807
      
      closes odoo/odoo#30232
      c5eeae0d
  6. Jan 25, 2019
  7. Jan 28, 2019
    • Jorge Pinna Puissant's avatar
      [FIX] mrp: multi-companies default location · 5f77d0e7
      Jorge Pinna Puissant authored
      Before this commit, in a multi-companies when the user can manage
      multiple stock locations, there is an error with the default Locations
      ('default location' and 'default Destination Location' in an Unbuild
      Orders; and 'Raw Materials Location' and 'Finished Products Location' in
      a Manufacturing Orders). The default gives the stock location of the
      first company, if we are working in a different company it will generate
      an access error. Also, in an Unbuild Order you could choose location
      that there are not internal at the company.
      
      Now, the default location, it's the one of the first Warehouse of the
      company. And the form only propose to choose internal locations.
      
      OPW-1919771
      
      closes odoo/odoo#30585
      5f77d0e7
  8. Jan 27, 2019
  9. Jan 25, 2019
    • Denis Ledoux's avatar
      [IMP] api: improve storing performance of the api cache · 8fb76c42
      Denis Ledoux authored
      This revision moves the `cache_key` to the first level
      dict of the cache, instead of the last one.
      
      Doing so, we reduce the number of times the reference
      to the cache key is stored in the dict.
      
      For instance,
      for 100.000 records, 20 fields and 2 env (e.g. with and without sudo)
      formerly, there were 100.000 * 20 * 2 occurences of cache key references
      now, there is only 2 references.
      
      Storing references to an object consumes memory.
      Therefore, by reducing the number of object references
      in the cache, we reduce the memory consumed by the cache.
      Also, we reduce the time to access a value in the cache
      as the cache size is smaller.
      
      The time and memory consumption are therefore improved,
      while keeping the advantages of revision
      d7190a3f
      which was about sharing the cache of fields
      which do not depends on the context, but
      only on the cursor and user id.
      
      This revision relies on the fact there are less different references
      to the cache key then references to fields/records.
      Indeed, this is more likely to have 100.000 different records stored
      in the cache rather than 100.000 different environments.
      
      Here is the Python proof of concept that was used
      to make the conclusion that setting the cache_key
      in the first level dict of the cache is more efficient.
      ```Python
      import os
      import psutil
      import time
      
      from collections import defaultdict
      
      cr = object()
      uid = 1
      fields = [object() for i in range(20)]
      number_items = 500000
      
      p = psutil.Process(os.getpid())
      m = p.memory_info().rss
      s = time.time()
      
      cache_key = (cr, uid)
      cache = defaultdict(lambda: defaultdict(dict))
      for field in fields:
          for i in range(number_items):
              cache[field][i][cache_key] = 5.0
              # cache[cache_key][field][i] = 5.0
      
      print('Memory: %s' % (p.memory_info().rss - m,))
      print('Time: %s' % (time.time() - s,))
      
      ```
      - Using `cache[field][i][cache_key]`:
         - Time: 3.17s
         - Memory: 3138MB
      - Using `cache[cache_key][field][i]`:
         - Time: 1.43s
         - Memory: 756MB
      
      Even worse, when the cache key tuple is instantiated inside the loop,
      for the former cache structure (e.g. `cache[field][i][(cr, uid)]`),
      the time goes from 3.17s to 25.63s and the memory from 3138MB to 3773MB
      
      Here is the same proof of concept, but using the Odoo API and Cache:
      ```Python
      import os
      import psutil
      import time
      
      from odoo.api import Cache
      
      model = env['res.users']
      records = [model.new() for i in range(100000)]
      
      p = psutil.Process(os.getpid())
      m = p.memory_info().rss
      s = time.time()
      
      cache = Cache()
      char_fields = [field for field in model._fields.values() if field.type == 'char']
      for field in char_fields:
          for record in records:
              cache.set(record, field, 'test')
      
      print('Memory: %s' % (p.memory_info().rss - m,))
      print('Time: %s' % (time.time() - s,))
      ```
      - Before (`cache[field][record_id][cache_key]` and cache_key tuple instantiated in the loop):
         - Time: 4.12s
         - Memory: 810MB
      - After (`cache[cache_key][field][record_id]` and cache_key tuple stored in the env and re-used):
         - Time: 1.63s
         - Memory: 125MB
      
      This can be played in an Odoo shell, for instance
      by storing it in `/tmp/test.py`, and then
      piping it to the Odoo shell:
      `cat /tmp/test.py | ./odoo-bin shell -d 12.0`
      
      closes odoo/odoo#29676
      
      closes odoo/odoo#30554
      8fb76c42
    • Denis Ledoux's avatar
    • Raphael Collet's avatar
      f9582bf1
    • Hetal Dhanak's avatar
      [FIX] web: date filter operators less than greater than · 1dbef66b
      Hetal Dhanak authored
      Before this commit, in the filter, when using a custom filter with a
      date field, the operators "is after" and "is before" were set to execute
      "is after or equal" and "if before or equal" respectively. That means it
      includes in the results, records with the same date as the filter.
      
      Now, the operators 'is after' and 'is before' won't include the records
      with the same date as the filter. And the operators 'is after or equal'
      and 'is before or equal' will include the records with the same date as
      the filter.
      
      Fixes #29868
      OPW-1921756
      
      closes odoo/odoo#30560
      1dbef66b
    • jev's avatar
      [FIX] mail: activity, crash when activity type is null · a4a3bfd3
      jev authored
      When activity_type_id is null on an activity
      marking it as 'done and schedule schedule next' crashed
      
      OPW-1928989
      
      closes odoo/odoo#30522
      a4a3bfd3
  10. Jan 17, 2019
  11. Jan 24, 2019
  12. Jan 23, 2019
  13. Jan 22, 2019
    • Nicolas Martinelli's avatar
      [FIX] sale: taxes and untaxed amount · b95affa3
      Nicolas Martinelli authored
      - Create a SO, do not set a partner
      - Add a product with a tax
      
      The untaxes amount as well as the taxes remain 0.0.
      
      This is because there is no pricelist, therefore no currency.
      
      There is actually no need of rounding explicitly since these are
      monetary fields which will be rounded automatically.
      
      opw-1931796
      
      closes odoo/odoo#30450
      b95affa3
  14. Jan 17, 2019
    • Christophe Simonis's avatar
    • Christophe Simonis's avatar
      17adccd9
    • wan's avatar
      [FIX] account: journal dashboard graph wrong value · 50bae1c0
      wan authored
      OPW 1918926
      
      Current behavior:
        The sql query groups by date,id in a intermediary table instead of the result. This allows to get data in the wrong order if the statements were not produced sequentially. The fill values are computed in the wrong order and may override correct values.
      
      Desired behavior:
        There is no override of the values correctly computed.
      
      closes odoo/odoo#29936
      50bae1c0
    • Lucas Perais (lpe)'s avatar
      [FIX] base: merge contacts linked to by an o2m field with caps · ba39efdf
      Lucas Perais (lpe) authored
      Define a field on a model as:
      - o2m to res.partner
      - the field's column, hence its name, has capital letters in it
      (studio does that)
      
      create two objects of that class, each one linked to a different partner with the new o2m
      
      merge the partners
      
      Before this commit, the object linked to the second partner, was deleted
      This was because merge partner sql requests did not quote the column name
      
      After this commit, the second object still exists
      
      This commit is tested in v12.0 with PR #30300 only. In v10.0 it is not testable as
      the model concerned is in CRM, and that no new fields in business modules can be added in stable
      
      OPW 1925060
      
      closes odoo/odoo#30301
      ba39efdf
  15. Jan 15, 2019
    • Denis Ledoux's avatar
      [FIX] ir_ui_view: do not change view mode when just changing the inherit · a4096276
      Denis Ledoux authored
      Some views have the primary mode while having an inherit_id view
      In such views, if the user wants to change the inherit_id,
      the mode must remain primary.
      
      The use case behind this is a user who want to change
      the inherit_id view of the view
      product.product.form (product.product_normal_form_view)
      to another view.
      This view is in primary mode while having an inherit_id
      (product.product_template_form_view).
      In such a case, the primary mode must remain,
      otherwise the view will no longer be opened by default
      when opening a product.
      Indeed, when searching the default form view of a model,
      it only searches for primary mode views for this model.
      
      The `all` is there because this is an `api.multi` method.
      We could consider adding a `self.ensure_one`,
      but it breaks the API if someones calls this method with multiple records.
      This is likely to happen, as this method is used
      in `write` which is likely to be called with multiple records.
      
      In my opinion, in master, this should be replaced by an
      onchange so the user can see the change of mode
      when he adds or remove an inherit_id for a view.
      
      opw-1916324
      
      closes odoo/odoo#30241
      a4096276
  16. Jan 22, 2019
  17. Jan 18, 2019
  18. Jan 15, 2019
Loading