Skip to content
Snippets Groups Projects
  1. Feb 08, 2021
    • Adrien Horgnies's avatar
      [FIX] product: generate variant combinations faster · 2e5634fa
      Adrien Horgnies authored
      
      The function `_get_possible_combinations` generates possibles combinations
       for the product template attribute values (ptav) of each product template
       attribute line (ptal) of a given product template. It used to iterate over
       them using a cartesian product. A combination can be invalid if it
       contains two incompatibles ptav. The problem is that it used to filter out
       invalid combinations after generating them. It's a problem because there
       can be a lot of invalid combinations to filter out before finding a valid
       combination. Even before the first valid combination if the first ptav of
       the two first ptal are incompatible.
      
      The solution brought by this commit is to reject the invalid combinations
       while building them rather than after. It does so by using a cartesian
       product implementation with early rejection. The algorithm tests each
       ptav when incorporating it in a partial combination and if it's
       incompatible, it goes to the next partial combination and thus skips all
       combinations starting with the invalid partial combination.
      
      The client that reported the issue has a product template with about 25
       ptal with an average of 9 ptav. The ptav of the first ptal was
       incompatible with the first ptav of second ptal. It had to build and
       filter out 5.76*10^15 ptav before finding the first valid ptav. If we
       generate 10^6 ptav by second (it's much less) user would get first ptav
       after 182 years. Now it's instantaneous.
      
      opw-2335936
      
      closes odoo/odoo#65089
      
      Signed-off-by: default avatarSébastien Theys (seb) <seb@odoo.com>
      2e5634fa
    • Nicolas Lempereur's avatar
      [FIX] account: can refresh tax audit action · d685a475
      Nicolas Lempereur authored
      
      Because of context:
      
      {'search_default_account_id': [active_id]}
      
      refreshing on the tax audit action could cause an error because in normal
      use case we have active_id that is never an account.account id (but for
      example an account.tax.report.line).
      
      There doesn't seem to be any use case where that context is useful since
      it was introduced in 2017 (81089042), this action is always used with an
      overriden context. So this commit is removing it.
      
      opw-2388448
      
      closes odoo/odoo#65698
      
      Signed-off-by: default avatarNicolas Lempereur (nle) <nle@odoo.com>
      d685a475
  2. Feb 07, 2021
  3. Feb 04, 2021
  4. Feb 05, 2021
  5. Jan 26, 2021
    • Arnold Moyaux's avatar
      [FIX] stock: couldn't unreserve mixed tracking stock · 3bbefb10
      Arnold Moyaux authored
      
      - Install stock
      - Go to Inventory > Configuration > Settings and enable "Lots" and "Storage Locations"
      - Create a Product tracked By Lots (i.e. Product X)
      - Go to Inventory > Operations > Inventory Adjustments
      - Create an Inventory Adjustment for Product X:
      
           Product   |   Location   |   Lot/SN   |   Real Quantity
       -------------------------------------------------------------
          Product X  |   WH/Stock   |   LOT 01   |       20
          Product X  |   WH/Stock   |            |       10
      
      - Validate Inventory
      - Go to Inventory > Operations > Transfers and create one:
        * Source Location: WH/Stock
        * Destination Location: WH/Stock/Shelf1
        * Operation Type: Internal Transfers
        * Operations:
          [Product: Product X, Initial Demand: 25]
      - Save Transfer, Mark As Todo and Check availability
      - Click on list icon of Operation line for Product X to display Detailed Operations
      - 20 units of LOT 01 and 5 units without lot have been reserved
      - Set LOT 01 for the 5 reserved units without lot and confirm
      - Open Detailed Operations again
      - There are now 20 units of LOT 01 and 5 units of LOT 01
      - Remove the row with 5 units and confirm
      - Check availability and open Detailed Operation
      - There is now only a row with 25 reserved units of LOT 01
      - Unreserve
      The following errror is raised:
      "It is not possible to unreserve more products of P than you have in stock."
      
      It happens because the system is not able to manage quants with lots and
      wihtout lots at the same time. When modifying the move line to 25
      reserved units. It's composed of 20 quants with lot and 5 quants without
      lot. And when unreserving it will check if there is a quants with 25
      units with the lot and if it's not found 25 units without lot. But never
      25 units of quants with lots and without lots.
      
      opw-2419444
      
      Close #64497
      
      closes odoo/odoo#65057
      
      Signed-off-by: default avatarArnold Moyaux <amoyaux@users.noreply.github.com>
      3bbefb10
  6. Feb 03, 2021
  7. Feb 01, 2021
    • nie's avatar
      [FIX] l10n_ch: use commercial company name in invoice PDF · d9ea1d5f
      nie authored
      Steps:
      - Edit the current company (1):
        - Country: Switzerland
        - Currency: CHF
      - Install l10n_ch
      - Go to Invoicing > Configuration > Bank Accounts
      - Edit Bank:
        - Bank Account: create a new one:
          - Account Holder: (1)
      - Go to Configuration > Journal
      - Edit Customer Invoices:
        - Advanced Settings tab:
          - Communication Standards: Switzerland
      - Go to Customers > Customers
      - Create a new customer (2):
        - Fill in street, city, zip code and country
      - Edit (2):
        - Contacts & Addresses tab:
          - Add:
            - Select Invoice Address
            - Contact Name: Keep this field blank
      - Go to Customers > Invoices
      - Create a new one:
        - Customer: "(2), Invoice Address"
        - Add a product
      - Validate it
      - Click Print QR-Bill
      
      Bug:
      Traceback here:
      https://github.com/odoo/odoo/blob/b76e9ef658bde0178fa1660b6ad27b880e91632a/addons/l10n_ch/models/res_bank.py#L129
      
      
      TypeError: 'bool' object is not subscriptable
      
      Explanation:
      The contact name of an address is optional. When nothing is filled in
      that field, it returns `False`, hence the error.
      Using the commercial company name ensures a name is put in the invoice,
      even if the contact doesn't belong to a company.
      
      opw:2447158
      
      closes odoo/odoo#65357
      
      Signed-off-by: default avatarbackspac <backspac@users.noreply.github.com>
      d9ea1d5f
    • Ivan Yelizariev's avatar
      [FIX] core: initialize new stored related field via SQL · 02417290
      Ivan Yelizariev authored
      Filling the new column in SQL is dramatically faster than doing it via
      the ORM, which iterates over all the records in the table.
      
      The test case is creating a related field for 100+ records with distinct
      values.  Setting the field's value was taking more than 100 queries.  It
      now takes 3 queries.
      
      task-2449313
      opw-2380445
      opw-2389376
      https://github.com/odoo/enterprise/pull/15910
      
      
      
      closes odoo/odoo#65232
      
      Signed-off-by: default avatarRaphael Collet (rco) <rco@openerp.com>
      02417290
  8. Dec 11, 2020
    • david's avatar
      [FIX] hr_expense: wrong company account when creating from mail · dca2127f
      david authored
      
      In a multicompany environment, when a expense is created from the
      expense email alias, the expense account is computed with SUPERUSER
      context, so depending on the SUPERUSER set company, we could get
      a mismatch of expense and employee's company and the account one, wich
      causes a subsequent error when trying to post the expense.
      
      closes odoo/odoo#63188
      
      Signed-off-by: default avatarSimon Goffin (sig) <sig@openerp.com>
      dca2127f
  9. Feb 01, 2021
    • Christophe Monniez's avatar
      [FIX] packaging: add a bom to nsi script · 3d0871d1
      Christophe Monniez authored
      
      When using the windows installer in French language, the `Hôte` label
      used to configure postgresql server does not display correctly.
      
      The LangString documentation does not specify how to use the special
      characters but after some tests, specifying a BOM for the nsi file seems
      to be the way to go.
      
      closes odoo/odoo#65354
      
      Signed-off-by: default avatarChristophe Monniez (moc) <moc@odoo.com>
      3d0871d1
    • nie's avatar
      [FIX] account: clearer bank account holder validation message · b76e9ef6
      nie authored
      
      Steps:
      - Go to Accounting > Configuration > Accounting > Bank Accounts
      - Create a new Bank Account
        - "Bank Account" field: create and edit a new one
          - Account Holder: Anyone but your company
      - Save
      
      Bug:
      Validation Error: The holder of a journal's bank account must be the
      company (YourCompany).
      
      Explanation:
      The error is not clear enough. Users may be confused because this
      validation error appears upon saving a "Bank Account Journal"
      (`account.journal`) but is talking about "Partner Bank Account"
      (`res.partner.bank`) which is a field of the "Bank Account Journal".
      
      opw:2448183
      
      closes odoo/odoo#65281
      
      Signed-off-by: default avatarbackspac <backspac@users.noreply.github.com>
      b76e9ef6
  10. Jan 31, 2021
  11. Jan 29, 2021
  12. Dec 09, 2020
  13. Nov 17, 2020
  14. Jan 28, 2021
  15. Jan 19, 2021
  16. Jan 22, 2021
    • Priyanka kakadiya's avatar
      [FIX] project: propagate internal subtypes to tasks · 9c5a79ff
      Priyanka kakadiya authored
      
      Manual backport of commit done in 13.0 odoo/odoo@227c8fb53265de03b202133c4e8012b8bcce01b4
      
      before this commit:
      
      while changing subtypes of the project it was only
      propagating those subtypes to the task, whose parent_id is set.
      internal subtypes are not propagating in the task of a project.
      
      So, filter internal subtypes and concat them with the subtypes which
      have parent_id.
      
      after this commit:
      internal subtypes will also propagate to their tasks
      
      LINKS
      
      Task ID-2205643
      Task ID-2241688
      COM PR #56775
      
      Signed-off-by: default avatarThibault Delavallee (tde) <tde@openerp.com>
      9c5a79ff
    • sahista pathan's avatar
      [FIX] mail: correctly update new and removed subtypes when updating subscription · edd40c3d
      sahista pathan authored
      
      Currently, the subtype checked selection is not saved when the user adds and
      removes subtypes. Indeed either an addition is performed, either a removal
      but having both is not correctly taken into account when updating an existing
      subscription.
      
      How to reproduce
        * click on the pencil icon to edit the subscription of the follower;
        * as an example default "Discussions" will be the only one selected;
        * check "Notes" and save;
        * -> this works;
        * click again on the pencil icon and uncheck "Notes" and check "Activities"
          then save;
        * -> this does not work as only removal is performed (Activities is not
          checked);
      
      The problem only occurs when you unchecked subtypes and checked other ones.
      
      This commit fixes that behavior by taking into consideration both new
      subtypes and subtypes to remove.
      
      LINKS
      
      Task ID-2205643
      Task ID-2241688
      COM PR #56775
      
      Co-Authored-By: default avatarThibault Delavallee <tde@odoo.com>
      Co-Authored-By: default avatarShahista Pathan <sat@odoo.com>
      edd40c3d
    • Thibault Delavallée's avatar
      [FIX] mail: fix auto subscribe subtypes computation · 97eb1c64
      Thibault Delavallée authored
      
      Manual backport of commit done in 13.0 odoo/odoo@9e7092a03f6c44287c661e2b39a943d240aa2bde
      
      This commit contains a followup / rewrite / backport of #34150 :
      
        * odoo/odoo@16dd3da
        * odoo/odoo@0b11ed8
      
      Fix: propagate generic internal subtypes from parent to childs with auto
      subscribe.
      
        With this commit, when the user subscribes to internal subtypes like
        activities on a parent record (e.g. a project) then the user follows them
        by default on every sub record creation (e.g. all new tasks of this project).
      
      Fix: do not reset existing subtypes when changing parent of a record using
      auto subscribe mechanism.
      
        With this commit, when changing subtype subscription from a parent record
        (e.g. project) avoid resetting all subtypes subscription on existing sub
        records (e.g. all new tasks of this project). Only new records will use the
        parent chosen subtypes. This is done through propagation of followers
        existing policy (see Follower._insert_followers() for more details);
      
      Note that fix done here is slightly different from the one done in odoo/odoo@16dd3da
      as there was some mismatch with internal model-related subtypes. Thix fix
      will be forward ported and improve the previous one.
      
      Task ID-2205643
      Task ID-2241688
      COM PR #56775
      
      Co-Authored-By: default avatarThibault Delavallee <tde@odoo.com>
      Co-Authored-By: default avatarAlexandre Khun <aku@odoo.com>
      Co-Authored-By: default avatarPriyanka kakadiya <pka@odoo.com>
      97eb1c64
    • Thibault Delavallée's avatar
      [IMP] test_mail: add test for auto subscribe · b1f8ec77
      Thibault Delavallée authored
      
      Manual backport of commit done in 13.0 odoo/odoo@ad210729da4bf72dad77acc4030a38478340f4c6
      
      We recently found a bug about generic internal subtypes not being correctly
      propagated when doing auto subscribe.
      
      For example: subscribe to a project, check an internal subtype like activities.
      Auto subscribe done on project tasks should include actitivities subtype but
      is currently not the case.
      
      This test highlights the issue and a fix will be provided soon. In this test
      we check both
      
        * generic subtype propagation (comment- or activities- like subtypes);
        * model-specific subtype propagation through parent relationship (like
          following New Task on project to follow New on task);
        * internal subtypes not being propagated to portal users;
        * auto subscribe at create with both create and parent follower reasons;
      
      LINKS
      
      Task ID-2205643
      Task ID-2241688
      COM PR #56775
      
      Co-Authored-By: default avatarThibault Delavallee <tde@odoo.com>
      Co-Authored-By: default avatarPriyanka kakadiya <pka@odoo.com>
      b1f8ec77
  17. Jan 26, 2021
  18. Jan 20, 2021
  19. Jan 22, 2021
  20. Jan 24, 2021
  21. Jan 21, 2021
  22. Jan 20, 2021
    • Nicolas Lempereur's avatar
      [FIX] website_event_questions: don't duplicate answers · 5e25f60d
      Nicolas Lempereur authored
      
      The answers are currently added to question from the event_type_id on
      create. This caused that if you duplicated an event, the answers would
      be duplicated since we go through create a second time.
      
      opw-2425120
      closes #64795
      
      Signed-off-by: default avatarNicolas Lempereur (nle) <nle@odoo.com>
      5e25f60d
    • Daniel Reis's avatar
      [FIX] sale_timesheet: Timesheet based invoicing does not work for subtasks · aa7749b6
      Daniel Reis authored
      
      Steps to reproduce:
      
      1. Enable Project Subtasks
      2. On the "Office Design" Project, select a Task and create a subtask for it
      3. Go to the Project Overview and Create Sales Order
      4. Enter timesheets: 11 hours for the parent task, and 10 hours for the subtask
      5.  On the created Sales Order check the invoiced time
      
      Current behavior:
      The 11 hours form the parent task are shown as delivered in the Sales Order, but the 10 hours from the subtask are not.
      
      Expected behavior:
      Both the parent ans subtask time should be shown as delivered, so that it can be invoices.
      
      Closes #63930
      
      opw:2426098
      
      closes odoo/odoo#64791
      
      Signed-off-by: default avatarSimon Goffin (sig) <sig@openerp.com>
      aa7749b6
  23. Jan 18, 2021
Loading