Skip to content
Snippets Groups Projects
  1. Oct 01, 2021
  2. Sep 30, 2021
  3. Sep 29, 2021
    • Yenthe Van Ginneken's avatar
      [FIX] account: allow overriding portal domain · b7effc44
      Yenthe Van Ginneken authored
      
      Before this commit the only way to modify the domain is to completely override portal_my_invoices.
      Since this function is so big this is not clean/easy to do.
      By creating a separate function we can simply override it and we can reuse the function on two places.
      
      closes odoo/odoo#77272
      
      Signed-off-by: default avatarFlorian Gilbert <FlorianGilbert@users.noreply.github.com>
      b7effc44
    • Adrien Widart's avatar
      [FIX] stock_landed_costs: round using the currency rounding · c2750517
      Adrien Widart authored
      In some cases, it is impossible to validate some landed costs ("Cost and
      adjustments lines do not match.[...]")
      
      To reproduce the issue:
      (Enable debug mode)
      1. Set the Decimal Accuracy of Product Price to 4
      2. Create a Product Category PC:
          - Costing Method: FIFO
      3. Create 4 storable products (category PC)
      4. Create a service product (landed cost)
      5. Create a PO with the 4 products:
          - 6 x $0.92
          - 6 x $0.92
          - 3 x $75.17
          - 6 x $20.54
      6. Process the delivery D
      7. Create a Landed Cost:
          - Delivery: D
          - Product: the service product
              - Split Method: By Quantity
              - Cost: $1000
      8. Compute the landed costs + Validate
      
      Error: a User Error is raised "Cost and adjustments lines do not match.
      You should maybe recompute the landed costs.". The sum of the additional
      landed cost equals $999.99 instead of $1000
      
      From version 14, `additional_landed_cost` is a Monetary field and its
      rounding property is no more based on "Product Price":
      https://github.com/odoo/odoo/blob/800433bde03a36ead40a78bc6d53cbb95c24f97b/addons/stock_landed_costs/models/stock_landed_cost.py#L371-L372
      
      
      Therefore, we should use the rounding of the associated currency to
      round its value
      
      OPW-2637701
      OPW-2631718
      OPW-2649348
      
      closes odoo/odoo#77155
      
      Signed-off-by: default avatarWilliam Henrotin <Whenrow@users.noreply.github.com>
      c2750517
    • xO-Tx's avatar
      [FIX] web_editor: fix Theme tab infinite loading · 606dbc79
      xO-Tx authored
      
      ISSUE:
      
      The click on "THEME" tab in editor panel triggers the
      '_onThemeTabClick' method which:
      
      1- Starts the loader ('_execWithLoadingEffect' method).
      2- Runs '_activateSnippet' which uses the same mutex as the
      loader.
      
      Execution order:
      
      A1- '_execWithLoadingEffect' with promise: adds the loader in
      the DOM immediately.
      A2- '_activateSnippet' sets a second loader to be added after
      a delay = 500.
      A3- 'releaseLoader' removes the first loader.
      A4- '_activateSnippet' ends : (before adding the second
      loader: t(4) - t(2) < 500) and timeout is cleared.
      
      In some cases we get t(4) - t(2) > 500 which adds a second
      loader to the DOM, and the new flow will be:
      
      B1- Same as A1.
      B2- Same as A2.
      B3- Second loader added to the DOM / replaces the first one
      in 'loadingElements'.
      B4- 'releaseLoader' removes the second loader (from the DOM
      & 'this.loadingElements').
      B5- Same as A4 but the first loader still in the DOM.
      
      The goal of this commit is to fix this behaviour by preventing
      more than one loader on the target element.
      
      task-2656308
      
      closes odoo/odoo#77226
      
      Signed-off-by: default avatarQuentin Smetz (qsm) <qsm@odoo.com>
      606dbc79
    • Nasreddin Boulif (bon)'s avatar
      [FIX] base,l10n_ch,account_qr_code_sepa,payment,websitesale: Display all QR codes in QR bill · 73ca102e
      Nasreddin Boulif (bon) authored
      Issue:
      
        When trying to print a Suisse QR bill, if multiple images are presents
        in document and they have a url as src, some pictures will not be
        displayed.
        (Same issue may occur with simple QR code)
      
      Cause:
      
        It's a known issue with wkhtmltopdf: https://github.com/odoo/odoo/commit/2949138a7d84cd6c925ea1745d62f25ef077bb8b
      
      
        Also, adding css class to body by js break wkhtmltopdf.
      
      Solution:
      
        Replace link by base64 image value (use a function to retrieve base64
        image instead of image_url).
        Remove class 'l10n_ch_qr' added by js (no need since CSS file didacted
        to this report).
      
        Move `_get_qr_code_base64` and `_get_qr_code_url` logic/flow
        (since generic) to account module.
        Move specific logic like `_get_qr_vals` and
        `_get_qr_code_generation_params` to specific module (ex: l10n_ch).
      
        extra: Alter some css for better rendering.
      
      opw-2620082
      
      closes odoo/odoo#76404
      
      X-original-commit: 684f0c44
      Signed-off-by: default avataroco-odoo <oco-odoo@users.noreply.github.com>
      73ca102e
    • dht-odoo's avatar
      [FIX] sale: allow internal users to access UTM campaings · fc6b8c0a
      dht-odoo authored
      
      Before this commit:
      UTM campaigns are accessible to all internal users. But with sale module
      installed, few of the fields are added into the `utm.campaign` model and
      it's views. Those fields contain information related to quotations and
      invoices. So if the internal user who does not have the basic sales rights
      tries to access the campaing, an AccessError is raised.
      
      With this commit:
      We only show those fields in the views to the users having enough rights
      ("sales_team.group_sale_salesman") and thus allow other internal users
      to access the UTM campaings without AccessError.
      
      Task-2417993
      
      closes odoo/odoo#77374
      
      X-original-commit: 4b899e50
      Related: odoo/enterprise#21244
      Signed-off-by: default avatarThibault Delavallee (tde) <tde@openerp.com>
      fc6b8c0a
    • Audric Onockx (auon)'s avatar
      [FIX] lunch: Fixed e-mail sent at supplier's timezone · d4acc448
      Audric Onockx (auon) authored
      
      Steps:
      - Set a supplier's 'Timezone' at a different timezone from user.
      - Set 'Send Order By: Email' and set any 'Order Time'.
      
      Result:
        E-mail will be sent at the set time, but in supplier's timezone. It is the desired behavior, but it is not intuitive for user.
      
      Solution:
        Timezone displayed right below order time, so the relationship between both is more obvious.
      
      opw-2541132
      
      closes odoo/odoo#75429
      
      Signed-off-by: default avatarKevin Baptiste <kba@odoo.com>
      d4acc448
    • Juan Jose Scarafia's avatar
      [FIX] l10n_ar: fix l10n_ar_currency_rate · af75bd6b
      Juan Jose Scarafia authored
      If an invoice is posted, sended back to draft and the rate was change on res.currency, we preserve the value already existing on l10n_ar_currency_rate
      
      closes odoo/odoo#77175
      
      X-original-commit: 820df9ee
      Signed-off-by: default avatarJosse Colpaert <jco@openerp.com>
      af75bd6b
    • Noe Antoine's avatar
      [FIX] survey: allow partial scores to answers almost correct. · 2cdfb780
      Noe Antoine authored
      
      BEFORE THIS COMMIT / How to reproduce :
      
      Consider a multiple choice question with single answer.
      
      A. 2 points
      B. 1 point
      C. -1 point
      
      Here, the user can only select one answer. He picks A. He only obtains 2/3 points.
      This is because the maximum score was computed as the sum of all positive scores
      for the question. It does not make sense, as the student can only pick one answer.
      Therefore, the formula does not allow giving partial scores (here, answer B, close
      to the correct answer) while maintaining correct score percentages.
      
      AFTER THIS COMMIT:
      
      The sum of positive scores is still used as maximum score for multiple choice
      with multiple answers, as we want the student to pick all good answers for max score.
      
      However, for multiple choice with single answer, we use the maximum positive score
      (or 0, if none) among answers, as it the maximum score one can get while selecting
      a single answer.
      
      -> example above : I pick A, I obtain 2 points out of max(2, 1, (0)) = 2
      -> I obtain max score for the question. 2/2.
      
      ps: As the sum only uses striclty positive values, the negative points are still
      operational and the flow is not changed.
      
      TESTS:
      
      A test test_partial_scores_simple_choice is added to make sure the simple_choice
      is repaired and always gives 100% of points if the best answer is picked.
      
      Task-2533836
      
      closes odoo/odoo#76326
      
      Signed-off-by: default avatarThibault Delavallee (tde) <tde@openerp.com>
      2cdfb780
    • svs-odoo's avatar
      [FIX] product_expiry: lot expiration_date · 4cffec7b
      svs-odoo authored
      
      This commit adresses to two issues:
      
      Since 0c83542a93dde8dcaead04fadb7db95cf627a8b4, the move line's `expiration_date`
      set by the user is always overrided at the creation of the move which
      means the user has to modify it after the move was created.
      
      To fix that, the compute doesn't override the `expiration_date` if there
      is already one set.
      Therefore, the onchange on the product who was removed is re-added to
      force to recompute the `expiration_date` if the move line's product is
      changed and it has already an `expiration_date` set.
      
      closes odoo/odoo#76847
      
      Signed-off-by: default avatarWilliam Henrotin <Whenrow@users.noreply.github.com>
      4cffec7b
    • svs-odoo's avatar
      [FIX] stock: avoid attempt to create the same lot · a1e540fb
      svs-odoo authored
      How to reproduce:
        - Create a product tracked by lot;
        - Create two receipts for this product;
        - Use the same lot name in the two receipts;
        - Try to validate the two receipts in the same time
          => `ValidationError` will trigger in the `_check_unique_lot`
              constrain of the production lot.
      
      task-2646107
      
      Part-of: odoo/odoo#76847
      a1e540fb
    • dht-odoo's avatar
      [FIX] survey: display the absolute counter in time limited survey · 9e9cd045
      dht-odoo authored
      
      Before this commit:
      Let's consider the following two scenarios while answering time limited survey:
      
      1) attendee's system clock is de-synchronized compared to the real time
      2) Odoo server clock is de-synchronized compared to the real time
      
      In any/both of the above cases, it will lead to a wrong timer display, and will
      confuse the user and/or make him fail the test because he will think he still has
      more time to submit when he does not.
      
      With this commit:
      To fix this, we simply get the offset of server UTC time and moment time, and apply
      the offset while calculating the time remaining.
      
      Task-2612972
      
      closes odoo/odoo#75814
      
      Signed-off-by: default avatarThibault Delavallee (tde) <tde@openerp.com>
      9e9cd045
    • Benjamin Vray's avatar
      [FIX] website_sale: fix create a new ribbon · 10867860
      Benjamin Vray authored
      
      Before this commit, when creating a new ribbon after selecting an
      existing ribbon, the style of the selected ribbon was added to the new
      ribbon in addition to the default style.
      
      task-2501515
      
      closes odoo/odoo#76025
      
      Signed-off-by: default avatarRomain Derie (rde) <rde@odoo.com>
      10867860
    • Benjamin Vray's avatar
      [FIX] website_sale: fix text color preview of ribbons · 19252137
      Benjamin Vray authored
      Before this commit, the text color preview of the ribbons in the
      ribbon selector was wrong. But also, if we selected another ribbon
      just after changing the text color of a ribbon. This color was applied
      to the selected ribbon.
      
      task-2501515
      
      Part-of: odoo/odoo#76025
      19252137
    • Swapnesh Shah's avatar
      [IMP] hr: Make timezone required on saved record · e6863bbd
      Swapnesh Shah authored
      
      `tz` field is technical field related to `resource_id`, which is required field on that model.
      
      However it is possible to try to write a void value, which leads to an issue as it is technically required.
      With this commit we make the tz field required at write.
      
      closes odoo/odoo#77339
      
      X-original-commit: 7cda3632
      Signed-off-by: default avatarYannick Tivisse (yti) <yti@odoo.com>
      e6863bbd
  4. Sep 28, 2021
    • prro-odoo's avatar
      [FIX] project: send created tasks to following portal user · b3680931
      prro-odoo authored
      
      How to reproduce the problem:
      - Go to General Settings
      - Check Custom Email Servers and create an Alias Domain
      - Go to the Project app
      - Create a new project and put an alias email for it
      - In another (private) window), create a new portal user
      - Send an email from that user's address to the created project's mail
      
      A task is created, and the portal user is set as a follower.
      BUT the portal user doesn't receive the task in his "Documents".
      
      Cause of the problem : only the recipients of the mail are correctly
      subscribed to the followers list, not the sender (which skips a step).
      
      This commit adds the sender in the process of subscribing followers to a task.
      
      opw-2619370
      
      closes odoo/odoo#76836
      
      Signed-off-by: default avatarLTU-Odoo <IT-Ideas@users.noreply.github.com>
      b3680931
    • Hubert Van de Walle (huvw)'s avatar
      [FIX] web: Select the correct record when there is an html table in a line · a8a0f38f
      Hubert Van de Walle (huvw) authored
      
      Steps to follow
      
        - Add an HTML field in the sales order line view
        - Create a sales order
        - Add a product
        - Add a table with multiple rows in the HTML widget
        - Add a new product
        -> The new product isn't selected
      
      Cause of the issue
      
        The CSS selector used for finding the record to edit was taking all tr
        element into account
      
      Solution
      
        Only select direct descendants of the tbody
      
      opw-2632817
      
      closes odoo/odoo#77355
      
      X-original-commit: 05fedd20
      Signed-off-by: default avatarLucas Perais (lpe) <lpe@odoo.com>
      Signed-off-by: default avatarHubert Van De Walle <hubvd@users.noreply.github.com>
      a8a0f38f
    • Achraf (abz)'s avatar
      [FIX] account_edi_ubl: Make UBL template EFFF-compatible · c52f7c8f
      Achraf (abz) authored
      Since https://github.com/odoo/odoo/pull/69124,the UBL template is wrong because of the order of the elements in `PaymentMeans` because it is a sequence
      `PaymentDueDate` must be in second position (before `InstructionId`)
      
      https://www.w3schools.com/xml/el_sequence.asp
      https://docs.oasis-open.org/ubl/prd1-UBL-2.1/xsd/common/UBL-CommonAggregateComponents-2.1.xsd
      
      
      see `<xsd: complexType name = "PaymentMeansType">`
      
      OPW-2468492
      
      closes odoo/odoo#77317
      
      Signed-off-by: default avatarWilliam André (wan) <wan@odoo.com>
      c52f7c8f
    • Raphael Collet's avatar
      [FIX] expression: avoid ORDER BY clause in subqueries · 947c3bd7
      Raphael Collet authored
      
      This fixes a performance issue: ORDER BY clauses in subqueries can make
      the query unexpectedly slow.  We should avoid this situation, since
      ORM-generated queries have an ORDER BY clause which is not relevant in
      the context of a subquery.
      
      The following example was found:
      
          SELECT "pos_payment"."id" AS "id"
            FROM "pos_payment"
           WHERE ("pos_payment"."pos_order_id" in
                    (SELECT "pos_order".id
                       FROM "pos_order"
                      WHERE ("pos_order"."company_id" in (1))
                   ORDER BY "pos_order"."id"))
             AND "pos_payment".id IN (1285508)
      
      Here are the query plans made by PostgreSQL on this query with and
      without the ORDER BY clause.  The query time went from 1240ms to
      0.402ms, which is 3000 times faster!
      
      EXPLAIN ANALYZE SELECT "pos_payment"."id" as "id" FROM "pos_payment" WHERE ("pos_payment"."pos_order_id" in (SELECT "pos_order".id FROM "pos_order" WHERE ("pos_order"."company_id" in (1)) ORDER BY  "pos_order"."id"  )) AND "pos_payment".id IN (1285508);
                                                                          QUERY PLAN
      ---------------------------------------------------------------------------------------------------------------------------------------------------
       Merge Semi Join  (cost=2.88..82726.85 rows=1 width=4) (actual time=1239.361..1239.364 rows=1 loops=1)
         Merge Cond: (pos_payment.pos_order_id = pos_order.id)
         ->  Sort  (cost=2.46..2.46 rows=1 width=8) (actual time=0.021..0.022 rows=1 loops=1)
               Sort Key: pos_payment.pos_order_id
               Sort Method: quicksort  Memory: 25kB
               ->  Index Scan using pos_payment_pkey on pos_payment  (cost=0.43..2.45 rows=1 width=8) (actual time=0.014..0.015 rows=1 loops=1)
                     Index Cond: (id = 1285508)
         ->  Index Scan using pos_order_pkey on pos_order  (cost=0.43..66770.53 rows=1282120 width=4) (actual time=0.013..1148.194 rows=1182463 loops=1)
               Filter: (company_id = 1)
       Planning time: 0.272 ms
       Execution time: 1239.396 ms
      (11 rows)
      
      EXPLAIN ANALYZE SELECT "pos_payment"."id" as "id" FROM "pos_payment" WHERE ("pos_payment"."pos_order_id" in (SELECT "pos_order".id FROM "pos_order" WHERE ("pos_order
      "."company_id" in (1)) )) AND "pos_payment".id IN (1285508);
                                                                   QUERY PLAN
      ------------------------------------------------------------------------------------------------------------------------------------
       Nested Loop  (cost=0.85..4.89 rows=1 width=4) (actual time=0.047..0.049 rows=1 loops=1)
         ->  Index Scan using pos_payment_pkey on pos_payment  (cost=0.43..2.45 rows=1 width=8) (actual time=0.027..0.028 rows=1 loops=1)
               Index Cond: (id = 1285508)
         ->  Index Scan using pos_order_pkey on pos_order  (cost=0.43..2.45 rows=1 width=4) (actual time=0.018..0.018 rows=1 loops=1)
               Index Cond: (id = pos_payment.pos_order_id)
               Filter: (company_id = 1)
       Planning time: 0.322 ms
       Execution time: 0.080 ms
      (8 rows)
      
      closes odoo/odoo#77234
      
      Signed-off-by: default avatarRaphael Collet (rco) <rco@openerp.com>
      Co-authored-by: default avatarStanislas Sobieski <(sts@odoo.com)>
      947c3bd7
    • Dharmraj Jhala's avatar
      [IMP] website_crm_partner_assign: fix multi datepickers on portal · c9009bde
      Dharmraj Jhala authored
      When a portal user is editing opportunity from front-end, there are
      two date inputs, 'Expected Cloing' and 'Next Activity Date'. But both
      of them have two pickers for selecting date, a native one and a
      bootstrap one, which was probably side effect of commit[1].
      
      With this commit, we only keep the bootstrap picker so that it
      respects the date format based on language, and for the check,
      to make sure it doesnt break the backend (see ticket from commit[1]
      for more details), we simply consider the date with year less than
      1900 as invalid.
      
      We also provide a bit more space for bootstrap datpicker to open while
      setting the closing date, so that the scrollbar is not introduced on
      the modal. And for the next activity date, we make sure that the
      picker is opened always on top of the input (which is not the case
      currenlty in some screensizes, sometimes it is opened below the input
      so it is hidden under the extra scroll introduced with picker).
      
      commit[1] - https://github.com/odoo/odoo/commit/b2b639b693dd7215e3ee501ac89c35f3a6b88bb5
      
      
      
      TaskID-2624728
      
      closes odoo/odoo#77267
      
      X-original-commit: da7cac9b
      Signed-off-by: default avatarawa-odoo <awa-odoo@users.noreply.github.com>
      c9009bde
  5. Sep 27, 2021
  6. Sep 26, 2021
  7. Sep 24, 2021
Loading