Skip to content
Snippets Groups Projects
  1. Oct 29, 2021
    • Paolo (pgi)'s avatar
      [FIX] base: invalid UNIQUE constraint just warn · 8ed3641f
      Paolo (pgi) authored
      
      When a submodule overrides an old UNIQUE constraint with a new one,
      records in that module may respect the new one and not the old one.
      As the old module is updated, it would fail giving an ERROR message,
      and therefore blocking the Odoo.sh deployment pipeline.
      
      i.e. website_sale (old): res_users_login_key -> ['login', 'website_id']
                   base (new): res_users_login_key -> ['login']
      
      With this patch, the error level is changed from ERROR to WARNING,
      leaving Odoo.sh free to continue the build deployment, as the error
      was not a blocking one.
      
      closes odoo/odoo#79042
      
      Signed-off-by: default avatarOlivier Dony (odo) <odo@openerp.com>
      8ed3641f
    • yhu-odoo's avatar
      [FIX] stock: avoid non-deterministic order for location · 94a8ad3f
      yhu-odoo authored
      
      Stock.location is ordered by "complete_name" which is possible to be the
      same (i.e. default production locations for different companies). This
      may result non-deterministic order. Add "id" to avoid it.
      
      closes odoo/odoo#79135
      
      Signed-off-by: default avatarWilliam Henrotin (whe) <whe@odoo.com>
      94a8ad3f
  2. Oct 27, 2021
  3. Oct 26, 2021
  4. Oct 25, 2021
    • Antoine Dupuis (andu)'s avatar
      [FIX] base: catch PDFs that fail on PdfFileWriter.write · 0b4efd37
      Antoine Dupuis (andu) authored
      
      Issue:
      Our functionality for merging PDFs from multiple vendor bills relies on PyPDF2. It is well-known that PyPDF2 is sometimes unable to manipulate even perfectly normal PDFs. To provide a helpful error message to the user when this happens (i.e. give them the names of the vendor bills corresponding to the offending pdfs), the `_get_unreadeable_pdfs()` function is called right before we try to merge the PDFs in `_merge_pdfs`. This function is meant to identify the offending PDFs and provide them to the user.
      However, _get_unreadable_pdfs did not notice the problem with 3 of my customer's pdfs, because the error was only triggered once the PdfFileWriter.write function was called in _merge_pdfs. This function, however, is not called in _get_unreadable_pdfs, therefore, it did not notice that anything was wrong.
      
      Fix:
      - Change _get_unreadable_pdfs so that it also makes a call to PdfFileWriter.write
      - As soon as PdfFileWriter.write fails once, it will continue failing when we append more PDF streams to the PdfFileWriter. I therefore suggest initialising a different PdfFileWriter at each iteration of the for loop in order for an offending PDF to not cause a false positive on subsequent PDFs.
      
      closes odoo/odoo#78905
      
      Signed-off-by: default avatarNicolas Lempereur (nle) <nle@odoo.com>
      0b4efd37
    • David Beguin's avatar
      [FIX] crm: prevent division by zero in lead probability computation · 392553a4
      David Beguin authored
      If for some reason we cannot compute lead probability, we should simply
      continue to the next value without causing a division by zero.
      
      This commit is a backport of part of https://github.com/odoo/odoo/pull/76110
      
      .
      
      Task-2674586
      
      closes odoo/odoo#78765
      
      Signed-off-by: default avatarThibault Delavallee (tde) <tde@openerp.com>
      392553a4
    • Alvaro Fuentes's avatar
      [FIX] stock: fix search default property for missing locs · 17e74b48
      Alvaro Fuentes authored
      It may happen that there is a property defined on some field that is not
      the default property, but rather the property associated to a record.
      For example
      ```
      => select id,name,company_id,fields_id,value_reference,res_id from ir_property where name like '%property_stock_inventory%'
      +------+--------------------------+--------------+-------------+-------------------+----------------------+
      | id   | name                     | company_id   | fields_id   | value_reference   | res_id               |
      |------+--------------------------+--------------+-------------+-------------------+----------------------|
      | 528  | property_stock_inventory | 1            | 4665        | <null>            | product.template,752 |
      | 6    | property_stock_inventory | <null>       | 4665        | stock.location,5  | <null>               |
      +------+--------------------------+--------------+-------------+-------------------+----------------------+
      ```
      In this case the property with id=528 is not a default property since
      res_id is not NULL. Alternatively the property id=6 is a default one.
      
      The issue here is that when searching for the missing locations we do
      not filter out the properties with res_id not NULL, thus we may get that
      a company has the location define while in fact it doesn't. Following
      the example above, this means that we incorrectly get property id=528 as
      the one defining the location for the company id=1 here:
      https://github.com/odoo/odoo/blob/c5c47da2e96fd5e37030c70d6bb1bae4c4047fa8/addons/stock/models/res_company.py#L107
      This not only prevents the creation of the correct default property but
      also the default locations
      https://github.com/odoo/odoo/blob/c5c47da2e96fd5e37030c70d6bb1bae4c4047fa8/addons/stock/models/res_company.py#L36-L51
      
      
      
      On this patch we fix the domain search for default property. This allows
      for the correct creation of the default locations and associated
      properties.
      
      This issue was observed during upgrade 40921, where it prevents the
      upgrade to 15.0
      
      closes odoo/odoo#78835
      
      Signed-off-by: default avatarArnold Moyaux <arm@odoo.com>
      17e74b48
  5. Oct 13, 2021
    • Roy Le's avatar
      [FIX] sale: conflicting context content · 3d296572
      Roy Le authored
      
      Most uses (correct ones) of the `partner` context key content expect a `res.partner` recordset as `partner` context value.
      This value is extracted during the pricelist price computation (but not used anyway...).
      
      But in one case, fixed by the current commit, a `res.partner` id is placed in the context, as `partner` value.  In some cases, this may trigger "Comparing Apple and Oranges" errors, since `with_context` calls returns a new or existing environment, verifying whether an environment with the same values (user, context, ...) exists.
      During this comparison, the new context, with an id (int) as `partner` value, is compared with existing contexts, potentially including some with a recordset on the same key.  Such a comparison fails on the lowest `__eq__` level, raising "Comparing apples with oranges" error.
      
      This commit fixes this case, by making sure the value put in the `partner` context value is always a recordset, and not an id.
      
      closes odoo/odoo#78276
      
      Note: In the future, this context key should be dropped because it's still a bad practice to put recordsets in the context.
      Signed-off-by: default avatarVictor Feyens (vfe) <vfe@odoo.com>
      3d296572
  6. Oct 25, 2021
  7. Oct 24, 2021
  8. Oct 23, 2021
  9. Oct 22, 2021
    • Fabio Barbero's avatar
      [IMP] website_event_track: improve event track proposal template · e9f268c3
      Fabio Barbero authored
      
      Purpose
      =======
      Center confirmation text after sending track idea.
      
      Task-2657588
      
      closes odoo/odoo#77477
      
      Signed-off-by: default avatarThibault Delavallee (tde) <tde@openerp.com>
      e9f268c3
    • Fabio Barbero's avatar
      [FIX] event: stop sending confirmation email as public user · 7f0ec1f1
      Fabio Barbero authored
      Purpose
      =======
      Fix guest users receiving confirmation emails for events by "Public User" in 13.0.
      
      Specifications
      ==============
      Confirmation emails for events are sent by:
      
      - Organizer (if set)
      - Company email (if set)
      - The users's email
      - Odoo bot otherwise
      
      Task-2657588
      
      Part-of: odoo/odoo#77477
      7f0ec1f1
    • Nathan Marotte (nama)'s avatar
      [FIX] sale_mrp : wrong delivered quantities on kit return · e90452bf
      Nathan Marotte (nama) authored
      
      Issue: When returning a product sold that is only made of kits and
      validating the return, the delivered quantities of the sales order was
      set back to the full amount delivered
      
      Steps to reproduce :
        1) Install MRP and Sales
        2) Create a BoM Kit for a new product [Nested Kit] that has one or
          more consumable or storable product as component
        3) Create a BoM Kit for a new product [Main Kit] that has
          [Nested Kit] as component
        4) Create a SO for [Main Kit], confirm, validate delivery
        5) Check SO, 1 product is delivered (correct)
        6) Go back to the Delivery, create a return for the delivery
          (don't validate)
        7) Check SO, 0 product is delivered (correct)
        8) Now validate the return for the delivery
        -> Check SO, 1 product is delivered (bug)
      
      Why is that a bug:
       Since the Main Kit was returned, the delivered should be 0 and not
       the full amount initially delivered. It was set back to 1 because we
       didn't look at the type of picking, when computing the quantity
       delivered, the fall back considered that if all the moves were done,
       everything was delivered, but it is the opposite when returning
      
      opw-2542337
      
      closes odoo/odoo#75256
      
      Signed-off-by: default avatarArnold Moyaux <amoyaux@users.noreply.github.com>
      e90452bf
    • thcl-odoo's avatar
      [FIX] pos_restaurant: Order button should go green after unskip orderline · 8159e5ac
      thcl-odoo authored
      
      Expected behavior : The order button should go green and active when you 'unskipped' an orderline
      
      Current behavior : The order button doesn't go green and can't be clicked when an orderline is 'unskipped'
      
      Steps to reproduce the error :
      First of all, you need to setup a PoS Restaurant with these options :
      ~ Bar/Restaurant
      ~ Enable `Table Management`
      ~ Enable and setup `Order Printer` with IP Address and choose Categories to be printed on.
      
      1. Open a restaurant session
      2. Pick a table
      3. Select a product and put it on hold
      4. Select the **same** product and order it
      5. 'Unskipped' the product from step 3
      
      Order button should be green and active but is unactive so the order can't be sent
      
      Previously, the condition was only based on the product_id so error occurs when multiline of the same product are handled
      
      opw-2557518
      
      closes odoo/odoo#78608
      
      Signed-off-by: default avatarpimodoo <pimodoo@users.noreply.github.com>
      8159e5ac
    • Paolo (pgi)'s avatar
      [FIX] sale_quotation_builder: quotation_description sanitize_attributes=False · ee90f6bc
      Paolo (pgi) authored
      quotation_description on the sale order is copied from the
      product template, where it already is sanitize_attributes=False,
      and it has to stay like that because otherwise widgets like
      "tab" or "accordion" cannot be rendered correctly.
      
      This is also linked to a bug in the ORM where the _related_attrs
      weren't copied correctly.
      
      Related ORM PR: https://github.com/odoo/odoo/pull/78687
      Ticket link: https://www.odoo.com/web#id=2487749&model=project.task
      
      
      
      opw-2487749
      
      closes odoo/odoo#78723
      
      Signed-off-by: default avatarPaolo Gatti <lordkrandel@users.noreply.github.com>
      ee90f6bc
    • Mohammed Shekha's avatar
      [FIX] web: support readonly attribute on toggle_button widget · b153ded9
      Mohammed Shekha authored
      
      before this commit: applying readonly attribute on toggle_button doesn't work,
      toggle_button still clickable and value is still changed even though widget is
      readonly, there is no effect of readonly attribute on toggle_button widget.
      
      after this commit: if toggle_button widget has readonly attribute then it will
      not be clickable, button of toggle_button will be disabled so that user can
      easily understand that element is not clickable.
      
      task-2339995
      
      closes odoo/odoo#76426
      
      Signed-off-by: default avatarAaron Bohy (aab) <aab@odoo.com>
      b153ded9
  10. Oct 21, 2021
    • anhe-odoo's avatar
      [FIX] hr_holidays: responsible cant see leave request · 1cf0bfc2
      anhe-odoo authored
      
      Expected behaviour
      
      A time-off responsible should be able to see the leave-request to validate, even if he is only reponsible and not leave-manager, at least as long as the leave validation is set on 'both' or 'time-off responsible'
      
      Observed behaviour
      
      If the leave validation is set on 'both' (and not on 'time-off responsible' only), the time-off responsible cannot see these leave request in the "To Approve" view, and only the leave-manager can see them.
      
      Problem Root Cause
      
      The issue is coming from a wrong domain definition (cf commit diff).
      
      opw-2595054
      
      closes odoo/odoo#78633
      
      Signed-off-by: default avatarKevin Baptiste <kba@odoo.com>
      1cf0bfc2
  11. Oct 20, 2021
    • Jerome (jev)'s avatar
      [FIX] point_of_sale: Show warning when pricelist company missmatches · 6099c366
      Jerome (jev) authored
      
      This commit ensure the pricelists are properly configured before launching a pos session.
      
      Steps to reproduce:
      - Have a V13 with point_of_sale
      - Have minimum 2 companies A & B
      - Select both companies in the company selector
      - Go to Settings / General Settings
        - Point of Sale
          - Check Pricelists
      - Go to Point of Sale
        - Open a pos.config PC
          - Set a Pricelist PL as Default Pricelist
      - Go to Point of Sale / Products / Pricelists
        - Open PL
          - Set a company (must be different than PC)
      - Go to Point of Sale
        - Click "New session" on PC
      --> Traceback
      
      In V13, the traceback shows as "Traceback not available"
      As from V14, the traceback is shown properly
      
      A variant would be to start the session before changing
      the pricelist company then click on "Resume" on PC
      
      closes odoo/odoo#78713
      
      Signed-off-by: default avatarpimodoo <pimodoo@users.noreply.github.com>
      6099c366
    • Nasreddin Boulif (bon)'s avatar
      [FIX] website_sale: Display pricelist price if no price_unit · b0b8f5f5
      Nasreddin Boulif (bon) authored
      
      Steps to reproduce:
      
        - Install website_sale module
        - Enable discount and advanced pricelist in settings
        - Create product with sale price 0$ and set a website in
          eCommerce + publish the product
        - Create pricelist PPP with Discount Policy as
          "Show public price & discount to the customer" and selectable in the website
        - Go to the product and set an extra price of 10$ for the new pricelist
        - Go to the product in the eshop and select the pricelist PPP
        - Add the product to the shop cart
      
      Issue:
      
        The price displayed is 0$ instead of 10$.
      
      Cause:
      
        Since price_unit equal 0$, not possible to calculate the discount and
        therefore using the 0$ value.
      
      Solution:
      
        Use price of pricelist in case 'discount_policy' is 'without_discount'
        and price_unit equal 0$.
      
      opw-2652192
      
      closes odoo/odoo#78570
      
      Signed-off-by: default avatarbon-odoo <nboulif@users.noreply.github.com>
      b0b8f5f5
    • Adrien Widart's avatar
      [FIX] website_sale: compute price with discounts and pricelists · 8d6a2ca0
      Adrien Widart authored
      
      When combining two pricelists, the unit price might be incorrect
      
      To reproduce the error:
      1. In Settings, enable:
          - Pricelists (Advanced)
          - Discounts
      2. Create a product P:
          - Sales Price: $100
          - Available on website
      3. Edit the Public Pricelist:
          - Add a price rule:
              - Apply On product P
              - Min. Quantity: SuperProduct
              - Compute Price: Percentage
              - Percentage Price: 63%
          - Discount Policy: Included in the price
      4. Create a second pricelist:
          - Add a price rule:
              - Apply on product P
              - Compute Price: Formula
              - Based on: Other Pricelist
              - Other Pricelist: Public Pricelist
              - Price Discount: 25%
          - E-commerce Promotional Code: PROMO
          - Discount Policy: Show public price & discount
      5. On the website, add P to the cart
      6. Edit the cart:
          - P's quantity: 500
          - Apply PROMO code
      
      Error: The new price is $75 instead of $27.75
      
      `_website_product_id_change` already returns the correct price value, so
      the latter shouldn't be computed again (moreover,
      `_fix_tax_included_price_company` should use the price with the pricelists
      applied instead of the default product price)
      
      OPW-2605804
      
      closes odoo/odoo#75371
      
      Signed-off-by: default avatarAdrien Widart <adwid@users.noreply.github.com>
      Part-of: odoo/odoo#78570
      8d6a2ca0
  12. Oct 19, 2021
  13. Oct 18, 2021
  14. Oct 17, 2021
  15. Oct 15, 2021
    • Pierre Masereel's avatar
      [FIX] point_of_sale: use correct rate date in test · 83873965
      Pierre Masereel authored
      Since changes made in currency rate default value made in this PR
      https://github.com/odoo/odoo/pull/76513
      
       the date is stored based on user
      timezone, and so doesn't work if the test runs around midnight with the
      belgian timezone on the servers.
      
      closes odoo/odoo#78452
      
      Signed-off-by: default avatarpimodoo <pimodoo@users.noreply.github.com>
      83873965
    • Thibault Libioulle's avatar
      [FIX] sale_timesheet: fix multiple issues in project profitability · ba234ff5
      Thibault Libioulle authored
      
      This commit fixes issues with downpayment and credit notes in project
      profitability report.
      
      Steps to reproduce opw-2596224:
      - Go to sale
      - Make a RFQ for a service product with service_policy set at
      delivered_timesheet (Timesheets on tasks), set quantity as 10
      - Confirm order and create two invoices for 15%, confirm the two
      invoices
      - Create a credit note for one of the invoice and confirm it
      - Go back to the Sale Order and click on Project Overview
      => Inconsistencies (Downpayment reported twice)
      - Add an expense
      => Inconsistencies in expense amount untaxed invoiced
      
      This issue is fixed by :
      - Excluding downpayments which are linked to a reversed invoice line
      - Use expense amount to invoice and expense amount invoiced separetely
      in the project overview.
      - Do not report not invoiced SOLs in the expense amount invoiced.
      - Exclude negative amounts in analytic account which are linked to
      credit notes.
      
      opw-2596224
      
      closes odoo/odoo#78310
      
      Signed-off-by: default avatarLTU-Odoo <IT-Ideas@users.noreply.github.com>
      ba234ff5
    • Florian Damhaut's avatar
      [FIX] stock: Product Search in stock picking · d0090ee0
      Florian Damhaut authored
      
      This commit makes the picking search by product more consistent with
      the general product search as the following case could happen:
      
        - Have a product with two variants;
        - Each variant has the following internal reference:
          - Variant 1: 'SoMething'
          - Variant 2: 'SomethingElse'
        - Create two pickings, each one containing one of the variant;
        - Then filter pickings by product and the result will vary:
          - Searching for 'SoMething' -> Found one picking
          - Searching for 'Something' -> Found two pickings
      
      The expected behavior is to find the two pickings in both cases.
      
      opw-2646214
      
      closes odoo/odoo#78085
      
      Signed-off-by: default avatarSteve Van Essche <svs-odoo@users.noreply.github.com>
      d0090ee0
Loading