Skip to content
Snippets Groups Projects
  1. Feb 10, 2021
  2. Feb 09, 2021
  3. Feb 08, 2021
    • Adrien Horgnies's avatar
      [FIX] product: generate variant combinations faster · 98616c46
      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#65723
      
      X-original-commit: 2e5634fa
      Signed-off-by: default avatarSébastien Theys (seb) <seb@odoo.com>
      98616c46
    • Christophe Monniez's avatar
      [FIX] tools: prevent call to pillow exif_transpose image method · 38f696df
      Christophe Monniez authored
      
      In a previous fix [0], the call to exif_transpose was kept to allow
      rotation of images format different than `JPEG`.
      
      After a small test, it appeared that the call would crash if the image
      in another format had the same `LensInfo` tag.
      So it's safer to not call this method at all.
      
      With this commit, the rotation tag is retrieved disregarding the file
      format by using the `getexif` method if available, falling back to the
      private method for Pillow < 6 support.
      
      As a bonus, a test is also added with a small embedded `JPEG` image,
      crafted with an `Orientation` exif tag and, for reference,  the
      `LensInfo`tag that caused so much trouble.
      
      [0] b83c48d5
      
      closes odoo/odoo#65653
      
      Signed-off-by: default avatarChristophe Monniez (moc) <moc@odoo.com>
      38f696df
    • yhu-odoo's avatar
      [FIX]stock_account: don't show consumable in valuation report · 57695f82
      yhu-odoo authored
      
      In "Inventory Valuation", when click "Inventory at Date" then "confirm".
      Record for consumable products will be shown in the report.
      
      Previously fix in #62622 which disabled svl for consumable products,
      then rolled back in #63386 due to mrp need to create svl for consumables
      to analyse cost.
      
      In this commit, we add a domian filter to not show consumables in
      "Inventory Valuation"
      
      Task 2449211
      PR #65726
      
      Signed-off-by: default avatarArnold Moyaux <amoyaux@users.noreply.github.com>
      57695f82
    • Nicolas Lempereur's avatar
      [FIX] account: can refresh tax audit action · e7030bd9
      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#65754
      
      X-original-commit: f7998c04813c65ba0b8ba046c052332ede2ba1cb
      Signed-off-by: default avatarNicolas Lempereur (nle) <nle@odoo.com>
      e7030bd9
  4. Feb 05, 2021
    • Samuel Degueldre's avatar
      [FIX] web_editor: insert record name as text · fde240eb
      Samuel Degueldre authored
      
      Previously, the many2one widget from the web_editor used jQuery's
      '.html()' method when inserting a record name into the page. The record
      name was not HTML-escaped before this, which may have unexpect result
      and break the layout.
      
      This commit fixes that by using the '.text()' method instead.
      
      This bug only affects pages containing a many2one (contact excluded)
      at the time of selection and not after the selection.
      e.g. on the /event page, changing the category of an existing event
      via the website editor
      
      closes odoo/odoo#65639
      
      X-original-commit: 53aff7f0
      Signed-off-by: default avatarMartin Trigaux (mat) <mat@odoo.com>
      fde240eb
  5. Feb 08, 2021
    • Tiffany Chang (tic)'s avatar
      [FIX] mrp: use bom quantity in bom report · 2bfd0fb0
      Tiffany Chang (tic) authored
      
      This commit makes it so when the bom structure report (Structure & Cost
      smartbutton) is opened the product quantity defaults to the BoM's
      `product_qty` amount rather than 1.
      
      Steps to reproduce:
      - Create/open a BoM
      - Set `product_qty` to any value greater than 1
      - Click on "Structure & Cost" button.
      
      Expected result: product quantities scaled to the `product_qty`
      Actual result: product quantities scaled to Quantity = 1
      
      closes odoo/odoo#65732
      
      Task: 2429885
      X-original-commit: 30c05ad9
      Signed-off-by: default avatarArnold Moyaux <amoyaux@users.noreply.github.com>
      2bfd0fb0
    • Denis Ledoux's avatar
      [FIX] mrp: `qty_available` computation of a kit and its component · 8e152a56
      Denis Ledoux authored
      
      When `qty_available` was being called
      for a kit and its components at the same time,
      e.g.:
       - Kit product
         - Product 1
         - Product 2
      
      The kit product available qty was always computed to `0.0`,
      because when computing its component available quantity,
      they were computed to `0.0` because they were marked
      as `protected` by the ORM when calling the compute method
      for these records at the first call.
      When the `qty_available` compute method for the kit
      then called recursively the `qty_available` compute
      method for the component, as the component record
      were marked as protected,
      the ORM filled their value with the Falsy value `0.0`.
      
      This issue occured particularly in the upgrade integrity unit test
      which makes sure the available quantities of the products remain
      unchanged after upgrade. This test computes the available
      quantities for a bunch of products at the same time,
      and its therefore likely a kit product gets its available
      quantity computed as the same time than its components.
      
      upg-3185
      upg-4215
      upg-4228
      upg-5558
      upg-5745
      upg-5856
      upg-6012
      upg-6064
      upg-6076
      upg-6306
      upg-6514
      upg-6588
      upg-6729
      
      closes odoo/odoo#65701
      
      Signed-off-by: default avatarArnold Moyaux <amoyaux@users.noreply.github.com>
      8e152a56
    • Thibault Delavallée's avatar
      [FIX] mass_mailing: fix batch call of action_send_mail · d63734eb
      Thibault Delavallée authored
      
      Loop inner calls should use mailing not self.
      
      Task ID-2455433
      
      closes odoo/odoo#65739
      
      X-original-commit: 3ff00944
      Signed-off-by: default avatarThibault Delavallee (tde) <tde@openerp.com>
      d63734eb
  6. Feb 07, 2021
  7. Feb 05, 2021
  8. Feb 03, 2021
    • Anh Thao Pham (pta)'s avatar
      [FIX] product_margin: fix Avg. Sale Unit Price · a3ee7adf
      Anh Thao Pham (pta) authored
      
      - Install product_margin
      - Go to Invoicing > Customers > Invoices and create an Invoice
      - Add a Credit Note
      - Go to Accounting > Reporting > Product Margins and check Product used in the Invoice
      The "Avg. Sale Unit Price" is incorrect. It should be 0 as it is for "# Invoiced in Sale"
      
      Credit Notes are not taken into consideration when computing "Avg. Sale Unit Price".
      This is also the case for discount.
      
      opw-2382797
      
      closes odoo/odoo#65464
      
      Signed-off-by: default avatarAnh Thao PHAM <kitan191@users.noreply.github.com>
      a3ee7adf
  9. Feb 04, 2021
    • Aaron Bohy's avatar
      [FIX] web: nested x2many with non inline views · 63c60549
      Aaron Bohy authored
      
      This commit partially reverts commit [1], and backports commit
      [2] from 14.0.
      
      Even though [1] correctly fixes the faulty scenario, there is a
      variation of this scenario which isn't handled. It has been
      fixed in 14.0 by [2], and that fix also fixes the original
      issue of [1]. So we keep the tests of both [1] and [2], and
      the fix of [2].
      
      [1] dd97d446ee94a32089f200bb7122139d31e69873
      [2] f6c06bd0
      
      closes odoo/odoo#65540
      
      Signed-off-by: default avatarGéry Debongnie (ged) <ged@openerp.com>
      63c60549
    • Benjamin Vray's avatar
      [FIX] web_editor: allow to center button with summernote · d4f38c34
      Benjamin Vray authored
      
      Before this commit, it was not possible to center a button using the
      editor option 'align center'.
      
      It is because, using document.execCommand(), the Chrome browser doesnt
      want apply 'text-align: center' on nodes with centered children. And
      the buttons have the boostrap class '.btn' which adds text-align:
      center.
      
      So the hack here is disabling the text-align property from the '.btn'
      class during the execution of document.execCommand().
      
      task-2423935
      
      closes odoo/odoo#64461
      
      Signed-off-by: default avatarQuentin Smetz (qsm) <qsm@odoo.com>
      d4f38c34
    • Aaron Bohy's avatar
      [FIX] web: nested invisible x2many in sub form view · f4f09f83
      Aaron Bohy authored
      PR [1] recently backported a several tricky x2many fixes from 14.0
      to 13.0. Unfortunately, in 13.0, there is a scenario (that isn't
      in 14.0) for which commit [2] produces a crash:
      
       - have an x2many field A (displayed as a list) that contains
         another x2many field, say B
       - B is also in A's form view, but it is 'invisible="1"'
      
      Before this commit, it crashes when you tried to open A's form
      view.
      
      For instance, go to Manufacturing > Bill of Materials > form view
      > click on a component line.
      
      Since B is invisible in A's form view, we don't load its
      fieldsInfo (as we won't need to display it). This commit refines
      [2] to detect this case and avoid the crash.
      
      [1] https://github.com/odoo/odoo/pull/65101/
      [2] https://github.com/odoo/odoo/pull/65101/commits/ab7b7cfe5365a37fcf44f98154f1b48c754ea80c
      
      
      
      opw 2452732
      
      closes odoo/odoo#65525
      
      Signed-off-by: default avatarGéry Debongnie (ged) <ged@openerp.com>
      f4f09f83
  10. Feb 02, 2021
  11. Feb 04, 2021
  12. Feb 03, 2021
    • Goffin Simon's avatar
      [FIX] account: Printing journal entries · ba32244c
      Goffin Simon authored
      
      Steps to reproduce the bug:
      
      - Accounting - Journal Entries - form view - Print - Invoices
      
      Bug:
      
      A UserError was raised 'Only invoices could be printed.' but in the attachment,
      the PDF was generated.
      
      opw:2452278
      
      closes odoo/odoo#65446
      
      Signed-off-by: default avatarLaurent Smet <smetl@users.noreply.github.com>
      ba32244c
    • sahista pathan's avatar
      [FIX] mail: correctly update new and removed subtypes when updating subscription · 9df7ff52
      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
      
      X-Original-Commit odoo/odoo@d16b03663823ea5a8192ef863c9975af0f4b246d
      
      closes odoo/odoo#65315
      
      Signed-off-by: default avatarThibault Delavallee (tde) <tde@openerp.com>
      Co-authored-by: default avatarThibault Delavallee <tde@odoo.com>
      Co-authored-by: default avatarShahista Pathan <sat@odoo.com>
      9df7ff52
  13. Feb 02, 2021
    • Nasreddin (bon)'s avatar
      [FIX] web: Not hide daterange if scrolling on mobile + unit test · fb010063
      Nasreddin (bon) authored
      
      Issue
      
      	- Install "Field Service" app
      	- Create new task
      	- Try to select Planned start/end date and valid
      
      	Daterange picker is hiding when trying to scroll down to valid selection.
      
      Cause
      
      	The daterange picker is closed when ev.target is not inside the picker,
      	however ev.target always return the document element.
      
      Solution
      
      	Do not hide daterange picker on scrolling if on mobile.
      
      	Note : It will only apply if scrolling on the daterange picker and
      	       will still hide if scrolling outside this last one.
      
      opw-2428099
      
      closes odoo/odoo#64406
      
      Signed-off-by: default avatarAdrien Dieudonné (adr) <adr@odoo.com>
      fb010063
    • Ivan Yelizariev's avatar
      [FIX] core: initialize new stored related field via SQL · 82644c3e
      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#65409
      
      X-original-commit: 57a7496ec6ae06cfc41536ceee9c3a819603e889
      Signed-off-by: default avatarRaphael Collet (rco) <rco@openerp.com>
      82644c3e
    • nie's avatar
      [FIX] l10n_ch: use commercial company name in invoice PDF · 2537bb01
      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#65394
      
      X-original-commit: d9ea1d5f
      Signed-off-by: default avatarbackspac <backspac@users.noreply.github.com>
      2537bb01
    • Goffin Simon's avatar
      [FIX] stock_account: Update standard price from import · 6bb324c3
      Goffin Simon authored
      
      Steps to reproduce the bug:
      
      - Let's consider a storable product P with cost = 10€
      - Let's update quantity to 10 units
      - Export an update of P in an xlsx file F
      - Change in F the cost of P from 10€ to 20€
      - Import F
      - Go to Inventory valuation
      
      Bug:
      
      The valuation of P was still 100€ instead of 200€
      
      opw:2424292
      
      closes odoo/odoo#65324
      
      Signed-off-by: default avatarSimon Goffin (sig) <sig@openerp.com>
      6bb324c3
    • Goffin Simon's avatar
      [FIX] hr_expense: Create an expense product with vendor taxes · 02d0591b
      Goffin Simon authored
      
      Steps to reproduce the bug:
      
      When trying to import or create a expense product with supplier taxes,
      the supplier taxes were removed.
      
      PS: The field vendor taxes is available in the expense product view
      
      opw:2444551
      
      closes odoo/odoo#65191
      
      Signed-off-by: default avatarSimon Goffin (sig) <sig@openerp.com>
      02d0591b
    • david's avatar
      [FIX] hr_expense: wrong company account when creating from mail · 5ee81665
      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#65366
      
      X-original-commit: dca2127f
      Signed-off-by: default avatarSimon Goffin (sig) <sig@openerp.com>
      Co-authored-by: default avatarsimongoffin <sig@odoo.com>
      5ee81665
  14. Feb 01, 2021
  15. Jan 29, 2021
  16. Feb 01, 2021
    • Christophe Monniez's avatar
      [FIX] packaging: add a bom to nsi script · 8b5d9f08
      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#65362
      
      X-original-commit: 3d0871d1
      Signed-off-by: default avatarChristophe Monniez (moc) <moc@odoo.com>
      8b5d9f08
    • Nicolas (vin)'s avatar
      [FIX] account: allow to display the line currency when exporting to xlsx · b314e6dc
      Nicolas (vin) authored
      
      Currently, when exporting move lines via for example the partner ledger,
      we are not displaying the currency in any way in the xlsx.
      
      For some company, this can be limiting since they may want to do
      post-treatment inside the file after export, which can require such
      information.
      
      This change will add the 'always_set_currency_id' field as optional
      into the list view of the amls, allowing to keep the information about
      the currency when exporting if needed.
      
      task id #2381355
      
      closes odoo/odoo#61821
      
      Signed-off-by: default avatarQuentin De Paoli (qdp) <qdp@openerp.com>
      b314e6dc
    • nie's avatar
      [FIX] account: clearer bank account holder validation message · 0909ad80
      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#65322
      
      X-original-commit: b76e9ef6
      Signed-off-by: default avatarbackspac <backspac@users.noreply.github.com>
      0909ad80
  17. Jan 29, 2021
    • nie's avatar
      [FIX] hr_attendance: user can see other users attendances · b3247c81
      nie authored
      
      Steps:
      - As admin, go to Settings > Users & Companies > Users
      - Edit Mark Demo (demo)
      - In Human Resources > Attendances, select Manual Attendance or blank
      - As demo, go to My Profile
      - Click the smart button showing the hours worked for the last month
      - Remove all filters
      
      Bug:
      The demo user, who hasn't the rights to see the other employees
      attendances, can see them.
      
      Explanation:
      Every user must have the right to read attendances in order to see their
      own attendances. Not giving the users the read rights in the security
      record rule prevents the record rule from being applied when reading
      attendances. This makes the read access rights the only rule and allows
      everyone to see the attendances of the others.
      
      This commit also fixes the default selected employee when going to the
      attendances tree view on these paths:
      - User
      - Employee
      - User > Employee
      
      In fact, sometime, `active_id` is the ÌD of the user and not of the
      employee. This leads to incorrect results since another employee's
      attendances are shown.
      
      Finally, this commit prevents users from creating attendances from other
      apps since only attendance officers and above can have access to the
      creation form within the Attendances app.
      
      opw:2440117
      
      closes odoo/odoo#64866
      
      Signed-off-by: default avatarbackspac <backspac@users.noreply.github.com>
      b3247c81
  18. Jan 30, 2021
    • Anh Thao Pham (pta)'s avatar
      [FIX] pos_cash_rounding: fix cash rounding for cash method only · b0eb0fe0
      Anh Thao Pham (pta) authored
      
      - Go to Point of Sale > Configuration > Settings & enable "Cash Rounding"
      - Configure POS:
        * Enable Invoicing
        * Enable "Cash Rounding" and "Only on cash methods"
        * Select 0.05 HALF-UP Rounding Method
      - Start POS session
      - Select a Product and change its Price to a value that should be rounded (i.e. $ 16.51)
      - Select a Customer
      - Proceed to Payment
      - Enable Invoice
      - Select Bank Payment method
      - Validate
      An error is raised: "Could not fully process the POS Order: Order / is not fully paid.".
      And a popup is diplayed: "Please print the invoice from backend"
      
      The issue comes from the fact that amount is also rounded for other payment methods
      than cash, even if "Only on cash methods" has been enabled.
      
      opw-2449222
      
      closes odoo/odoo#65297
      
      Signed-off-by: default avatarpimodoo <pimodoo@users.noreply.github.com>
      b0eb0fe0
  19. Jan 31, 2021
Loading