Skip to content
Snippets Groups Projects
  1. Jul 18, 2021
  2. Jul 16, 2021
  3. Jul 15, 2021
    • prro-odoo's avatar
      [FIX] fleet: display only current companies' fleet · 41828bc2
      prro-odoo authored
      
      How to reproduce the problem:
      - Install the Fleet app.
      - Create a user that has access to 2 or more companies (e.g. Mitchell Admin).
      - Log in as this user. Go to fleet -> Vehicles -> Vehicles Costs/Contracts/Fuel Logs/Services Logs
      - Uncheck one of your companies.
      - The user still has access to the fleet of the other companies, even if they are unchecked.
      
      Cause of the problem : missing record rules
      
      Solution : added multi-companies rules
      
      opw-2518188
      
      closes odoo/odoo#73654
      
      X-original-commit: ad62f877
      Signed-off-by: default avatarNicolas Lempereur (nle) <nle@odoo.com>
      Signed-off-by: default avatarprro-odoo <proose@users.noreply.github.com>
      41828bc2
  4. Jul 16, 2021
  5. Jul 06, 2021
    • Andrea Grazioso (agr-odoo)'s avatar
      [FIX] mrp: merge SFP for 2 different MO · 7ab0ac3e
      Andrea Grazioso (agr-odoo) authored
      Set the warehouse with manufacturing 3 steps
      Create a BoM with a Components that use a Sub BoM
      Set Both product MTO + Manufacture
      Create a MO
      You have only 2 picking for the first MO with the SFP
      that contains both the finished product and the intermediate
      component. However they are created and moved at two different times
      since you could not create the finished product withtout the
      component, so there is no meaning to put them both in the same picking.
      
      It happens because the _assign_picking will merge moves with the same
      procurement group. In our case, it's the wanted behavior to have the
      2 differents SFP linked to the same MO.
      
      The idea between the fix is:
      - We want to have the pick components picking merged.
      - We want to have the store components split since they come from
      different MO
      So we create the different procurement groups during the _run_pull with
      the picking type of store finished product. This way the pickings won't
      be merged during _assign_picking
      
      We will also propagate those groups to the newly created MO in order to
      keep the picking type sequence and correct name.
      
      FW PORT of
      https://github.com/odoo/odoo/commit/bcfa03821b92bf52675db0e3b54d3cb19dfe3087
      
      
      
      opw-2585525
      
      closes odoo/odoo#73248
      
      Signed-off-by: default avatarNicolas Lempereur (nle) <nle@odoo.com>
      7ab0ac3e
  6. Jun 25, 2021
  7. Jul 16, 2021
    • Florent de Labarre's avatar
      [FIX] point_of_sale : show correctly UserError · 7a92eade
      Florent de Labarre authored
      
      Before this commit UserError, ValidationError are not correctly show.
      Get the same behaviour of V12.
      
      closes odoo/odoo#73649
      
      Signed-off-by: default avatarpimodoo <pimodoo@users.noreply.github.com>
      Co-authored-by: default avatarJoseph Caburnay (jcb) <caburnay.joseph@gmail.com>
      7a92eade
    • Alvaro Fuentes's avatar
      [FIX] web: fix web_read_group total groups count · 728a6f75
      Alvaro Fuentes authored
      
      Fetching all the groups from the DB causes MemoryError on some DBs
      Example Accounting > Accounting > Journals > Miscellaneous menu:
      ```
       Traceback (most recent call last):
         File "/tmp/tmpbnah9jtp/migrations/base/tests/test_mock_crawl.py", line 176, in crawl_menu
          self.mock_action(action_vals)
         File "/tmp/tmpbnah9jtp/migrations/base/tests/test_mock_crawl.py", line 267, in mock_action
          mock_method(model, view, fields_list, domain, group_by)
         File "/tmp/tmpbnah9jtp/migrations/base/tests/test_mock_crawl.py", line 380, in mock_view_tree
          self.mock_web_read_group(model, view, domain, group_by, fields_list, limit_group=5)
         File "/tmp/tmpbnah9jtp/migrations/base/tests/test_mock_crawl.py", line 425, in mock_web_read_group
          data = model.web_read_group(domain, fields_list, group_by, limit=limit)["groups"]
         File "/home/odoo/src/odoo/14.0/addons/web/models/models.py", line 96, in web_read_group
          all_groups = self.read_group(domain, ['display_name'], groupby, lazy=True)
         File "/home/odoo/src/odoo/14.0/odoo/models.py", line 2248, in read_group
          result = self._read_group_raw(domain, fields, groupby, offset=offset, limit=limit, orderby=orderby, lazy=lazy)
         File "/home/odoo/src/odoo/14.0/odoo/models.py", line 2387, in _read_group_raw
          result = [self._read_group_format_result(d, annotated_groupbys, groupby, domain) for d in data]
         File "/home/odoo/src/odoo/14.0/odoo/models.py", line 2387, in <listcomp>
          result = [self._read_group_format_result(d, annotated_groupbys, groupby, domain) for d in data]
       MemoryError
      ```
      
      This issue was observed during the upgrade requests upg-18830, target
      14.0; and upg-61934 (legacy), target 13.0
      
      The issue can be reproduced on a clean DB with just account_accountant
      installed and ~2 millions account moves on a Misc journal.
      
      closes odoo/odoo#73823
      
      X-original-commit: a9b3d9cf
      Signed-off-by: default avatarChristophe Simonis <chs@odoo.com>
      728a6f75
    • Benjamin Frantzen (bfr)'s avatar
      [FIX] l10n_it_edi: fixed zip code check for the buyer · 86aa7507
      Benjamin Frantzen (bfr) authored
      
      If the buyer is Italian, it must have a zip code of length 5.
      If the buyer is not Italian, the zip code is optional
      
      closes odoo/odoo#73817
      
      Signed-off-by: default avatarLaurent Smet <smetl@users.noreply.github.com>
      86aa7507
    • kerteszgergo's avatar
      [CLA] signature for kerteszgergo · 0a11e597
      kerteszgergo authored
      
      closes odoo/odoo#73330
      
      Signed-off-by: default avatarMartin Trigaux (mat) <mat@odoo.com>
      0a11e597
    • Mashanz's avatar
      [FIX] base: typo on class label · 454c4261
      Mashanz authored
      
      closes odoo/odoo#72671
      
      Signed-off-by: default avatarMartin Trigaux (mat) <mat@odoo.com>
      454c4261
    • Mashanz's avatar
      [CLA] Signature for mashanz · e8ef346d
      Mashanz authored
      e8ef346d
  8. Jun 04, 2021
  9. Jul 15, 2021
  10. Jul 16, 2021
    • Adrien Widart's avatar
      [FIX] point_of_sale: extract UID from POS reference · f5b23781
      Adrien Widart authored
      When using another language than English, the UID of a POS order may be
      incorrect
      
      To reproduce the error:
      1. Open a POS's configuration and enable "Manage Orders"
      2. In Settings > Languages, add ans switch to:
          - French (BE) / Français (BE)
      3. Start a POS session
      4. Process an order
      5. Open the orders managers
      
      Error: the processed order is named "Commande de 00001-001-0001", the
      "de" in the middle shouldn't be present
      
      This is the combination of "Commande" and the UID of the order. The
      latter is extract from the POS reference, which looks like "Commande
      00001-001-0001" by removing the first 6 characters. It's ok in English:
      from "Order 00001-001-0001", we have "00001-001-0001". But this won't
      work in all other languages (specially for RTL languages)
      
      The unique identifier of an order is a sequence of 12 digits:
      https://github.com/odoo/odoo/blob/3e8d921318e86631b73c8c92c2e462fd0d761582/addons/point_of_sale/static/src/js/models.js#L2865-L2868
      
      
      Knowing this, we can easily extract the UID from a POS reference
      
      OPW-2538645
      closes #71181
      closes #71182
      
      closes odoo/odoo#73777
      
      Signed-off-by: default avatarpimodoo <pimodoo@users.noreply.github.com>
      f5b23781
  11. Jul 15, 2021
  12. May 18, 2021
  13. Jul 14, 2021
  14. Jul 15, 2021
  15. Jul 13, 2021
    • Adrien Widart's avatar
      [FIX] sale_stock_margin: convert purchase_price · 04e4cd91
      Adrien Widart authored
      When confirming a SO, if the costing method of a product's category is
      not `Standard' and if the SO's currency is different from the company's
      currency, the cost of the product won't be converted to the SO's
      currency
      
      To reproduce the error:
      1. In Settings, enable:
          - Margins
          - Multi-Currencies
      2. Create a product category PC:
          - Costing Method: FIFO
      3. Create a product P:
          - Product Type: Storable
          - Product Category: PC
          - Sales Price: 200
          - Cost: 100
      4. Update P's quantity to 1
      5. Create a pricelist PL:
          - Currency: EUR
      6. Create a SO:
          - Pricelist: PL
          - Order Lines:
              - 1 x P
      7. Add field "Cost" to the tree view of the order lines
          - The value is correctly converted
      8. Confirm the SO
      
      Error: The cost of the order line is now 100€. This is actually the USD
      cost, it should be converted
      
      This code applies the same conversion as when the cost method is
      standard:
      https://github.com/odoo/odoo/blob/8a8ff03f6111f377bcd9c2b0f584c450b82a4182/addons/sale_margin/models/sale_order.py#L42-L48
      
      
      
      OPW-2563442
      
      closes odoo/odoo#73545
      
      Signed-off-by: default avatarRémy Voet <ryv-odoo@users.noreply.github.com>
      04e4cd91
  16. Jul 15, 2021
    • Benjamin Frantzen (bfr)'s avatar
      [IMP] l10n_it_edi_sdicoop: normalize codice fiscale. · 3741e141
      Benjamin Frantzen (bfr) authored
      
      Codice Fiscale can be 16 length (letters + digits) for physical people.
      Codice Fiscale can be 11 digits prefixed or not with 'IT' for companies.
      
      An error is raised if the codice fiscale is not saved in the correct format. When registering to l10n_it_edi_proxy, we try to normalize the Codice Fiscale if possible.
      
      Also, when entering the vat in the partner, the Codice Fiscale is automatically set normalized.
      
      closes odoo/odoo#73682
      
      Signed-off-by: default avatarJosse Colpaert <jco@openerp.com>
      3741e141
  17. Jul 14, 2021
  18. Jul 13, 2021
    • Raphael Collet's avatar
      [FIX] note: broken kanban view · e9de80b7
      Raphael Collet authored
      
      The view is broken because read_progress_bar() calls read_group() with
      two groupbys in eager mode.  The method read_group() is overridden for
      model `note.note` and does not handle that case: the returned result is
      incorrect.  We modify the override to call the default read_group() in
      that case, which eventually fails and makes read_progress_bar() fall
      back on its naive implementation.
      
      closes odoo/odoo#73597
      
      Signed-off-by: default avatarRaphael Collet (rco) <rco@openerp.com>
      e9de80b7
    • Ivan Yelizariev's avatar
      [FIX] mail: speed up read_progress_bar · 768e606c
      Ivan Yelizariev authored
      
      This commit fixes the performance issue in getting statistics for
      ``activity_state`` (colored clock icon for overdue/today/planned) in
      CRM.  The query has been tested for several years on a large database
      (Odoo's own production database).
      
      Performance test on 29 K crm.lead records (activity_state):
      
      With a filter for 10 records:
      
      ```
      | measurement        | before | after |
      |--------------------+--------+-------|
      | number of queries  |     25 |     5 |
      | query time, ms     |     12 |    95 | (*)
      | remaining time, ms |     32 |     7 |
      ```
      
      All records:
      
      ```
      | measurement        | before | after |
      |--------------------+--------+-------|
      | number of queries  |   1326 |     5 |
      | query time, ms     |   1739 |   129 |
      | remaining time, ms |  47934 |    17 |
      ```
      
      As we can see in the last results, the time went from almost 50 seconds
      (not responsive at all) to 150 milliseconds (responsive).  The time
      increase in (*) may be caused by imperfect measurements, which are raw
      and not averaged measures.
      
      Co-authored-by: default avatarNicolas Seinlet <nse@odoo.com>
      
      ---
      
      opw-2346901
      task-1915411
      768e606c
    • Ivan Yelizariev's avatar
      [FIX] web: speed up read_progress_bar · 5b9ae681
      Ivan Yelizariev authored
      
      The method is used to get progress per column in kanban view
      (green-yellow-red-red lines in Project, CRM etc).  There are two main
      usages:
      
      1. get statistics for ``kanban_state`` (red/green circles)
      2. get statistics for ``activity_state`` (colored clock icon for overdue/today/planned)
      
      Before this commit all cases were handled by calling search_read and then
      counting records per group in a python script.  This is very inefficient,
      especially for ``activity_state``.
      
      This new implementation relies on ``read_group`` when possible, i.e.,
      when both grouping fields (kanban column and progressbar field) are
      stored (case 1).  It then falls back on a naive implementation inside
      ``_read_progress_bar``.  Cases like 2 above can be addressed by
      overriding ``_read_progress_bar``.
      
      We also added some minimal test to ensure that we don't break anything.
      
      1. Performance test on 60 K project.task records (kanban_state):
      
      With a filter for 6 records:
      
      ```
      | measurement        | before | after |
      |--------------------+--------+-------|
      | number of queries  |      8 |     5 |
      | query time, ms     |     11 |     7 |
      | remaining time, ms |     21 |     9 |
      ```
      
      All records:
      ```
      | measurement        | before | after |
      |--------------------+--------+-------|
      | number of queries  |     67 |     5 |
      | query time, ms     |    300 |    55 |
      | remaining time, ms |   1780 |    12 |
      ```
      
      Co-authored-by: default avatarRaphael Collet <rco@odoo.com>
      
      ---
      
      opw-2346901
      task-1915411
      5b9ae681
    • Arnold Moyaux's avatar
      [FIX] stock: replenish report in 3 months · f988b762
      Arnold Moyaux authored
      
      Currently the replenishment report look for forecasted quantity of
      product today. It means that for a product if the delivery is planned
      for today the forecast will be -1, at j-1 it will be 0. However for the
      majority of use case, products take days to order and arrive.
      
      Example:
      - Product A, purchase delivery time 5 days.
      - You are the 01-01-2021 and create a SO for 10-01-2021
      Currently:
      - Product will appear in the replenishment report the 10-01-2021 and
      you will receive it the 15-01-2021. So you are late to deliver your
      customer.
      Desired behavior:
      - Product appear in the replenishment report the 05-01-2021 and if you
      order it directly you will receive it the 10-01-2021.
      
      If you want to have more time to deliver than one day, security lead
      time are there for it.
      
      However the usecase like:
      Product arrive in 2 months and you receive it in 3 days, the product won't
      appear in the replenish report anymore since the forecast in 3months is
      0
      
      It could happens that more product are missing in 3 months than today,
      so the system could have more delivery lead times and forecast at date
      to compute -> be slower. In that case a parameter could be
      added to skip the delivery times computation for each product/warehouse
      and just display the forecast in 3 months and let user compute their
      schedule themself.
      
      closes odoo/odoo#73652
      
      Signed-off-by: default avatarArnold Moyaux <amoyaux@users.noreply.github.com>
      f988b762
  19. Jul 14, 2021
  20. Jul 13, 2021
  21. Jul 14, 2021
    • Goffin Simon's avatar
      [FIX] hr_expense: Wrong journal entries · 3add44d4
      Goffin Simon authored
      
      Steps to reproduce the bug:
      
      - Let's consider an expense E paid by the company
      - Validate E and post journal entries
      
      Bug:
      
      Two journal entries were created:
      
      1. Outstanding payments (debit) / Account Payable (credit) as draft
      2. Expense (debit) / Outstanding payments (credit) as posted
      
      With the this fix:
      
      Only the second entry is created and posted
      
      This reverts commit 25ac51e0.
      
      opw:2510663
      
      closes odoo/odoo#73677
      
      Signed-off-by: default avatarWilliam André (wan) <wan@odoo.com>
      3add44d4
  22. Jul 13, 2021
  23. Jul 12, 2021
    • Adrian Torres's avatar
      [FIX] base: perform sanity check on undeletable ir.model.data · 75697934
      Adrian Torres authored
      
      This commit adds a sanity check to the part of the ORM that uninstalls
      module data, as a recap, here's how module uninstallation works:
      
      - We fetch all data (ir.model.data) that corresponds to the module being
      uninstalled (`WHERE module='my_module'`)
      - We divide this data according to its type (ir.model, ir.model.field,
      constraints, etc.)
      - We fetch the corresponding records to each type, we delete them in a
      certain order (e.g. ir.model.field before ir.model) and then finally we
      delete the ir.model.data as a last step
      
      The data is deleted in batch for maximum performance, if one of the data
      cannot be deleted however, we perform a binary search until we find the
      culprit(s) and we store these culprits in a list of undeletable_ids.
      
      At the end of the process, we delete all ir.model.data **except** for
      the ones that are undeletable, however, it is possible that because of
      the multiple-step procedure, an undeletable ir.model.data could have
      become deletable.
      
      Imagine that an ir.model.field cannot be deleted, its module data id is
      added to the list of undeletable_ids, however if later on its ir.model
      is deleted successfully, the ir.model.field is dropped because its table
      is dropped, in this case the ir.model.data becomes deletable, but since
      we simply ignore it at the end of the process, we potentially end up
      with orphaned xmlids.
      
      This can be problematic when we reinstall the module and uninstall it
      again, as the system does not expect an orphaned xmlid, will completely
      crash and prevent the 2nd uninstallation of the module.
      
      This is the case with CRM and its
      crm.lead.scoring.frequency.field.field_id field, its ir.model.field
      cannot be deleted because the name field (and display_name) of the same
      model depend on it, so it is left as is, then further down the process
      the entire model is deleted and as a result so is all of its remaining
      fields, however the ir.module.data for the field that could not be
      deleted remains.
      
      opw-2575592
      
      closes odoo/odoo#73523
      
      X-original-commit: 6d37a46d
      Signed-off-by: default avatarAdrian Torres (adt) <adt@odoo.com>
      Co-authored-by: default avatarRaphael Collet <rco@odoo.com>
      75697934
  24. Jul 13, 2021
Loading