Skip to content
Snippets Groups Projects
  1. Apr 15, 2022
    • Thibault Delavallée's avatar
      [FIX] mail: limit reply-to name part · 9a54278e
      Thibault Delavallée authored
      Python library currently holds a limitation when we use a formatted email
      that is longer than 78 characters (e.g. "Long Company Name With Long Record
      Name <email@domain.com>"). Python folds address if is longer than 78 chars
      and a bad management of quotes breaks the reply-to. Even if anything should
      technically be ok with the RFC python seems to incorrectly handle it (please
      refer to [1] for more details and discussions).
      
      Until this is finally sorted out we decided to avoid issues by shortening
      reply-to. To avoid that issue when formataddr would return more than 78 chars
      we return a simplified name/email to try to stay under 78 chars. If not
      possible we return only the email and skip the formataddr which causes the
      issue in python. We do not use hacks like crop the name part as encoding and
      quoting would be error prone.
      
      Task-2602862
      OPW-2733513
      
      [1] See https://bugs.python.org/issue44637
      
      
      
      closes odoo/odoo#88912
      
      X-original-commit: 5353ce3b
      Signed-off-by: default avatarThibault Delavallee (tde) <tde@openerp.com>
      9a54278e
    • Adrien Widart's avatar
      [FIX] purchase_stock: create new POL if different RR · 0802d4c6
      Adrien Widart authored
      If the user triggers several orderpoints one by one, some purchase order
      lines may be merged while they shouldn't.
      
      To reproduce the issue:
      1. In Settings, enable "Storage Locations"
      2. Create a product P:
          - Type: Storable
          - With a vendor V
          - Route: Buy
      3. Add two reordering rules to P:
          - Min=Max=1 at WH/Stock
          - Min=Max=2 at WH/Stock/Shelf 1
      4. Inventory > Operations > Replenishment, trigger the orderpoints of P
      (one by one)
      5. Open the generated PO
      
      Error: There is only one line with 3 x P, there should be two lines (1 x
      P + 2 x P, one for each orderpoint). If the user confirms the PO and
      receives the products, the destination location will be Stock or Shelf 1
      (depending on the last orderpoint triggered)
      
      Running the orderpoint leads to `_run_buy`, where we try to find an
      existing PO line so we can update it (else we will create a new one):
      https://github.com/odoo/odoo/blob/5b34adb51eda978aa9ef1a434ab77257d73b9594/addons/purchase_stock/models/stock_rule.py#L122-L129
      
      
      
      Here is the issue: the filter in `_find_candidate` contains an `or True`
      that makes a whole condition useless.
      
      Considering [1], the condition on `move_dest_ids` is only relevant when
      an orderpoint is defined. Therefore, we can remove the `or True` and
      improve the condition
      
      [1] 63fffa0b
      
      OPW-2720868
      
      closes odoo/odoo#88870
      
      Signed-off-by: default avatarArnold Moyaux <arm@odoo.com>
      0802d4c6
    • Andrea Grazioso (agr-odoo)'s avatar
      [FIX] account,purchase_stock: caba entry not fully registered for bill · 41d1adb4
      Andrea Grazioso (agr-odoo) authored
      
      Have a purchase tax with cash basis payment enabled
      Have a product with said tax
      Create a bill with the product, save and confirm
      Register a payment
      
      Check CABA entries
      There should be 4 entries, but only 2 have been generated
      
      opw-2782561
      
      closes odoo/odoo#88321
      
      Signed-off-by: default avatarOlivier Colson <oco@odoo.com>
      Co-authored-by: default avataroco-odoo <oco@odoo.com>
      41d1adb4
    • Adrien Widart's avatar
      [FIX] {mrp_,}account,sale_{stock,mrp}: display lots in invoice · 7c02358a
      Adrien Widart authored
      
      When invoicing a tracked product, the lots/SN delivered (or the related
      quantities) are not always the correct ones displayed on the printed
      invoice
      
      To reproduce the issues:
      1. In Settings, enable "Display Lots & Serial Numbers on Invoices"
      2. Create a product P:
          - Storable
          - Tracked by lot
      3. Update its quantity > 5 with lot L
      
      Use case 01:
      
      4. Create and confirm a SO with 5 x P
      5. Process the delivery
      6. Create an invoice
      7. Edit the invoice line:
          - Quantity: 1
      8. Post and print the invoice
      Error: The quantity related to lot L is 5, it should be 1
      
      Use case 02:
      
      4. Edit P:
          - Invoicing Policy: Ordered quantities
      5. Create and confirm a SO with 1 x P
      6. Create and post the invoice
      7. Process the delivery
      8. Print the invoice
      Error: There isn't any information about delivered lot L
      
      Use case 03:
      
      4. Create and confirm a SO with 3 x P
      5. Deliver 1 x P (with backorder)
      6. Invoice 1 x P + Post the invoice (-> INV01)
      7. Deliver 2 x P
      8. Reset, post INV01 again and print it
      Error: The quantity related to L is 3, it should be 1. Moreover, if the
      user then invoices the 2 others P, posts and prints this second invoice,
      it won't contain any information about L
      
      OPW-2730270
      closes #81444
      
      closes odoo/odoo#88815
      
      X-original-commit: 7a030f61
      Signed-off-by: default avatarWilliam Henrotin (whe) <whe@odoo.com>
      Signed-off-by: default avatarAdrien Widart <awt@odoo.com>
      Co-authored-by: default avatarAdrien Widart <awt@odoo.com>
      Co-authored-by: default avatarFlorent de Labarre <florent.mirieu@gmail.com>
      7c02358a
    • Arnold Moyaux's avatar
      [FIX] mrp: orderpoint for manufacture not trigger twice · a4f857d9
      Arnold Moyaux authored
      
      Usecase to reproduce:
      With BoM structure
      - Product A (RR 1-20)
      	|
      	Product B (MTO)
      		|
      		Product C (RR 5-50)
      			|
      			Product D (Buy)
      
      Launch the RR. The MO are:
      Current Behavior
      - Product A 20
      - Product B 20
      - Product C 50
      - Product C 70
      
      Expected Behavior
      - Product A 20
      - Product B 20
      - Product C 50
      
      It happens because the MO are created as draft during the
      `_run_manufacture` and are confirm at the end of
      `_procure_orderpoint_confirm` in '_post_process_scheduler`.
      
      However at the first MO for product A, it creates a MO for product B
      and since it consumes product c, it checks if the orderpoint should be
      trigger. MO for product C still "draft" and the orderpoint forecast is
      now -20, so it will create a new procurement for product C with 70 units
      
      To fix it we take the MO draft linked to the orderpoint for the
      forecasted quantity.
      
      closes odoo/odoo#88590
      
      Signed-off-by: default avatarWilliam Henrotin (whe) <whe@odoo.com>
      a4f857d9
    • Aurélien (avd)'s avatar
      [REV] expression: revert performance search one2many commit · 43165dc3
      Aurélien (avd) authored
      
      Revert commit 54cd73a4f4 as it prevents customers from closing
      their pos sessions without timeouting.
      
      closes odoo/odoo#88882
      
      Signed-off-by: default avatarJulien Castiaux <juc@odoo.com>
      43165dc3
    • Touati Djamel (otd)'s avatar
      [FIX] mrp: use the fastest workcenter · e872d74a
      Touati Djamel (otd) authored
      
      Steps to reproduce the bug:
      - Create the workcenter_1:
          - Time Efficiency: 100%
          - Capacity: 2
          - Setup Time: 1
          - Cleanup Time: 1
      
      - Create the workcenter_2:
          - Time Efficiency: 100%
           - Capacity: 4
          - Setup Time: 10
          - Cleanup Time: 5
          - Alternative Work centers: workcenter_1
      
      - Create a storable product “P1” with BOM:
          - Add any product as component
          - Add operation:
              - Duration: 60
              - Work center: Workcenter_2
      
      - Create a MO:
          - select “P1” as Product
          - Qty to produce: 4
          - Confirm and Plan
      
      Problem:
      The workcenter_1 is chosen while work_center_2 is faster it can manufacture the 4 units at the same time
      while workcenter_1 must do two cycles
      
      As the Time Efficiency = 100%, so:
      Total duration = (Setup Time + Cleanup Time) + duration_by_unit * nb_cycle
      Work_center_1 = (1 + 1) + 60 * 2 = 122
      Work_center_2 = (10 + 5) + 60 = 75
      
      The calculation is bad because we use the number of cycles necessary for the work_center defined in the BOM
      in the calculation for the alternative work center
      
      opw-2821749
      
      closes odoo/odoo#88808
      
      Signed-off-by: default avatarArnold Moyaux <arm@odoo.com>
      e872d74a
    • Adrien Schoffeniels's avatar
      [FIX] survey: Fix cropped out timer on mobile devices. · 6c7f8eeb
      Adrien Schoffeniels authored
      
      This commit fixes the timer that was cropped out when taking a
      survey having a time limit on mobile devices.
      
      Task-2810299
      
      closes odoo/odoo#88193
      
      Signed-off-by: default avatarThibault Delavallee (tde) <tde@openerp.com>
      6c7f8eeb
  2. Apr 14, 2022
  3. Apr 13, 2022
    • Nicolas (vin)'s avatar
      [FIX] account,*: Ensure tests using TestInvoicingCommon runs · 81aac30d
      Nicolas (vin) authored
      
      Add a check in 'AccountTestInvoicingCommon' to ensure that all
      tests using it are run in post_install.
      These tests cannot be run at install, thus they would be ignored
      and wouldn't run on the Runbot.
      
      closes odoo/odoo#87677
      
      Related: odoo/enterprise#25779
      Signed-off-by: default avatarFlorian Gilbert <flg@odoo.com>
      81aac30d
    • Guillaume (guva)'s avatar
      [FIX] purchase_stock: price diff on vendor bill · 643d91ef
      Guillaume (guva) authored
      
      Steps to reproduce:
      
      • Create Record: Product Category
      - Costing Method: Average
      - Inventory Valuation: Automated
      - Specify a price difference account (may create new account).
      - Ensure Stock Interim (Received) account is reconcilable.
      
      • Create Record: Product
      - Product Type: Storable
      - Cost Price: 1.01
      - Product Category: New Product Category
      
      • Create bill with this product, for a quantity of 10.5
      
      -> The is price difference of 0.1
      
      Issue comes from this commit 286ea6b6
      which doesn't round if there is a discount.
      
      With this commit we isolate the latter case in order to keep the
      price unit rounded if there is no discount.
      
      closes odoo/odoo#87666
      
      Signed-off-by: default avatarFlorian Gilbert <flg@odoo.com>
      643d91ef
    • Guillaume (guva)'s avatar
      [FIX] l10n_nl: traceback on purchase journal creation · 782c43c1
      Guillaume (guva) authored
      
      With l10n_nl, create a purchase journal -> traceback
      Ids was appended to ORM command list, instead of the ids list.
      Moreover, it was filled even if there were no missing value.
      
      opw-2801012
      
      closes odoo/odoo#87445
      
      Signed-off-by: default avatarFlorian Gilbert <flg@odoo.com>
      782c43c1
    • Benoit Socias's avatar
      [FIX] website_blog: remove negative word spacing in blog snippet · a63bb179
      Benoit Socias authored
      Since [1] when the blog layout was refactored between 12.0 and 13.0, a
      negative word spacing was introduced in the blog post snippet with the
      big pictures layout.
      
      This commit removes this negative word spacing.
      
      [1]: https://github.com/odoo/odoo/commit/bb0cdec4594fab8c22265ed8af0c2d431a263b72
      
      
      
      task-2822436
      
      closes odoo/odoo#88601
      
      X-original-commit: 6c4e6137
      Signed-off-by: default avatarQuentin Smetz (qsm) <qsm@odoo.com>
      Signed-off-by: default avatarBenoit Socias (bso) <bso@odoo.com>
      a63bb179
    • Laurent Desausoi (lade)'s avatar
      [FIX] product: Wrong variants filtering · 4c7ef567
      Laurent Desausoi (lade) authored
      
      Supplier pricelists doesn't restrict the choice of the variant to the
      variants of the current product template (in the view).
      
      To reproduce the issue:
      1. Create a product with different variant
      2. Install 'purchase' and go to the 'purchase' page on a product form.
      3. Create a new Supplier Pricelist (a new line).
      4. In the 'product_variant' the user can select any product of the company.
      We should only see the variants of the current product.
      
      Solution: Since 14.0, the Supplier Pricelist can be edited directly from the
      tree view (while in 13.0 a form was used). In this tree view, there are no filtering/domain
      on the 'product_tmpl_id'. This filtering is however present in the form in 13.0
      which is why the problem is present only as from 14.0. Similarly to the 13.0 form,
      the 'product_variant' field doesn't allow the quick creation. A restriction has
      also been created to illustrate what happens in the UI.
      
      opw-2792060
      
      closes odoo/odoo#87096
      
      Signed-off-by: default avatarTiffany Chang <tic@odoo.com>
      4c7ef567
  4. Apr 12, 2022
    • Hubert Van de Walle (huvw)'s avatar
      [REV][FIX] web: radio widget ignores required attribute · d263b6c4
      Hubert Van de Walle (huvw) authored
      This reverts https://github.com/odoo/odoo/pull/87375
      
      
      
      `auth_signup_uninvited` is be set as required in the
      settings view but a value is missing in the case where the current
      company has no website.
      This then prevents the settings from being saved.
      This could also be an issue with other settings in custom code.
      We should revert this fix in stable.
      
      opw-2819061
      
      closes odoo/odoo#88589
      
      X-original-commit: 3fd991f6
      Signed-off-by: default avatarNicolas Lempereur (nle) <nle@odoo.com>
      d263b6c4
    • Yolann Sabaux's avatar
      [FIX] stock_account: compute new price with correct rounding · 2d6f4213
      Yolann Sabaux authored
      
      Steps to reproduce:
      
      Decimal Accuracy - Product Price = 2
      - create a product `alc 50%` with BOM (10 unites = 1 unit Water [cost=0.14]; 1 unit Alc [cost=0.08])
      - Set `quantity on hands` = 10,000
      - Trigger `Compute Price from BoM`
      
      -> In Reporting > Inventory Valuation; click on the layer; in Other Info: You will see "Product value manually modified (from 0.0 to 0.022000000000000002)"
      => It can cause computing mistakes as we changed the costs
      
      Cause:
      
      The value is calculated as the difference between the New Price (cost) and and the current Product Standard Price (cost).
      But, on one hand the Product Standard Price is rounded to the number of digits defined in the Decimal Accuracy for the Product Price.
      On the other hand, the New Price is used as is with no rounding.
      
      If we add an extra step and modify the cost of the Water to 0.45 and trigger again the `Compute Price from BoM` we will have:
      "Product value manually modified (from 0.02 to 0.053000000000000005)"
      
      Solution:
      
      Use for the New Price the same rounding precision as we use for the Standard Price.
      
      Example:
      
      Product		Price/unit
      --------------------------
      Water		0.14
      Alc. 100%	0.08
      
      BoM: Alc. 50%
      Product		Quantity Needed
      --------------------------
      Water		0.1
      Alc. 100%	0.1
      
      Cost/unit of Alc. 50%: 0.022 => 0.02 (standard_price is rounded)
      Set Quantity on Hand: 10,000
      
      Stock Valuation: 200 = 10,000 * 0.02
      => The standard_price is rounded to the second digit when intialized
      
      Product         Price/unit
      --------------------------
      Water           0.45
      Alc. 100%       0.08
      
      BoM: Alc. 50%
      Product         Quantity Needed
      --------------------------
      Water           0.1
      Alc. 100%       0.1
      
      Cost/unit of Alc. 50%: 0.053
      Set Quantity on Hand: 10,000
      
      Stock Valuation WITHOUT FIX: 530 = 200 (first layer) + 330 (second layer) = 0.02 * 10,000 + (0.053-0.02) * 10,000
      Stock Valuation WITH FIX: 500 = 200 (first layer) + 300 (second layer) = 0.02 * 10,000 + (0.05-0.02) * 10,000
      
      => Without fix, the value is computed with the rounded standard_price and the not rounded new_price.
      => With fix, the new_price is rounded the same way as the standard_price
      
      opw-2724975
      
      closes odoo/odoo#87600
      
      Signed-off-by: default avatarWilliam Henrotin (whe) <whe@odoo.com>
      2d6f4213
    • Hubert Van de Walle (huvw)'s avatar
      [FIX] web: multi edit in custom groupby list view · 52ab8af5
      Hubert Van de Walle (huvw) authored
      
      Steps to follow
      
        - Go to Accounting > Accounting > Sales (account.move.line model)
        - Remove any existing group by
        - Group by Products
        - Select multiples lines of the same product
        - Try to modify the account of the select line
        -> `this.localData[value] is undefined
      
      Cause of the issue
      
        When grouping by a field not in the view, `list.__data` contains the
        groupedBy field value because we fetched the group through a web_read_group
      
      Solution
      
        Filter out absent fields before creating the group datapoint
      
      opw-2784995
      
      closes odoo/odoo#88569
      
      X-original-commit: 36c17664
      Signed-off-by: default avatarAaron Bohy (aab) <aab@odoo.com>
      Signed-off-by: default avatarHubert Van De Walle <huvw@odoo.com>
      52ab8af5
    • Hiral Bhavsar's avatar
      [FIX] mail: counter on mailing channel when user handle notification with emails · 0a04b1f0
      Hiral Bhavsar authored
      
      Before this commit:
      
      Message from mailing channel make a notification in Odoo for users
      with notification "Handled by Email" when user is not log-in. this is happening
      because mailing channel is marked as seen from
      "messaging_notification_handler.js" which is not executed when user is not
      log-in and receive message so message counter is increase when user log-in.
      
      After this commit:
      
      Hide the counter for mailing channel when user handles notification with emails.
      
      Task-2541660
      
      closes odoo/odoo#82015
      
      Signed-off-by: default avatarAlexandre Kühn (aku) <aku@odoo.com>
      0a04b1f0
    • Adrien Widart's avatar
      [FIX] mrp: compute state thanks to float_compare · 12ca332b
      Adrien Widart authored
      
      In some cases, due to rounding errors, the state of a MO is incorrect
      
      OPW-2753598
      
      closes odoo/odoo#88530
      
      X-original-commit: 976eee1d
      Signed-off-by: default avatarArnold Moyaux <arm@odoo.com>
      Signed-off-by: default avatarAdrien Widart <awt@odoo.com>
      12ca332b
    • Audric Onockx (auon)'s avatar
      [FIX] account_payment : limit token acquirers to invoice's partner · 613b8f23
      Audric Onockx (auon) authored
      
      Steps:
      Log in with admin.
      Configure Stripe for direct payment (from Odoo).
      Create an invoice for portal.
      Click on Preview, then Pay Now.
      Select Stripe, enter your credentials and pay.
      
      Issue:
      Error message: Invalid token found!
      
      Cause:
      Paying this way creates a token for admin.
      Yet, later, we check that invoice's partner == token's.
      Using acquirers with a token-based payment method
      should not be allowed when the current user's partner
      is not the invoice's customer.
      
      Fix:
      Clarify the error message to indicate how to resolve it :
      log in as the good partner.
      
      opw-2730967
      
      closes odoo/odoo#88523
      
      X-original-commit: f871483a
      Signed-off-by: default avatarAntoine Vandevenne (anv) <anv@odoo.com>
      Signed-off-by: default avatarOnockx Audric (auon) <auon@odoo.com>
      613b8f23
    • anhe-odoo's avatar
      [FIX] website_event_sale: use event_ticket_id to get event ticket · 76ec42e1
      anhe-odoo authored
      
      Expected Behaviour
      
      When buying multiple tickets for an event on the website, we should
      have the correct number of tickets in our cart
      
      Obeserved Behaviour
      
      When buying multiple tickets from an event B where the associated product
      has already been associated to another event A , the maximum number of
      tickets from the event A is used instead of the correct one (from B),
      leading the client not to be able to buy as much ticket as he want in
      case the limit of A is lower than the limit of B.
      
      Reproducibility
      
      This issue can be reproduced using the following steps :
      1. Create an event A with a maximum number of 1 tickets and a product P
      2. Buy and confirm 1 ticket
      3. Copy the event A to an event B
      4. Set the maximum number of tickets to 3 (keeping product P)
      5. Go to the website page of event B and try to buy 3 tickets
      6. On the checkout page you should have only 1 ticket for event B
      
      Fix Description
      
      The issue was coming from the fact we use the associated product to get
      the event's ticket ID in the _cart_update mathod. This fix propose to use
      the event_ticket_id value, already set in the sale_order context, to find
      the correct ticket.
      
      Related Issue(s)/PR
      
      opw-2761303
      
      closes odoo/odoo#88481
      
      X-original-commit: db674e33
      Signed-off-by: default avatarNicolas Lempereur (nle) <nle@odoo.com>
      Signed-off-by: default avatarHendrickx Anthony (anhe) <anhe@odoo.com>
      76ec42e1
  5. Apr 11, 2022
  6. Apr 10, 2022
  7. Apr 08, 2022
Loading