Skip to content
Snippets Groups Projects
  1. Jun 16, 2023
  2. Jun 15, 2023
    • Ali Alfie (alal)'s avatar
      [FIX] account: wrong quick encoding calculation with cash discount · a65dda25
      Ali Alfie (alal) authored
      
      Before: when using the quick encoding feature on an invoice or bill with payment term containing an early payment discount and the company's epd computation is set to "Always (upon invoice)", the calculation was done incorrectly.
      
      Example: if you invoice a 100€ product with a 21% tax with a 2% cash discount, the total of the invoice will be 120.58 (the 21% is calculated on 98€ (100€*2%) which is 20.28€).
      In our case, if you tried to calculate suggestions from a quick encoding value of 120.58, the calculation would calculate the untaxed amount from the 120.58 based on the 21% tax without applying the 2% discount.
      
      After: when calculating the suggestions check if an early discount is set on the payment term and the company's epd computation is set to "mixed" ("Always (upon invoice)") and if so, apply the discount to the tax before calculating the untaxed amount from the total.
      
      task-3339223
      
      closes odoo/odoo#123748
      
      Signed-off-by: default avatarLaurent Smet <las@odoo.com>
      a65dda25
    • Prakash Prajapati's avatar
      [FIX] project: open the Tasks Analysis and customer rating report in project burger menu · 1de6f53e
      Prakash Prajapati authored
      
      task-3345839
      
      closes odoo/odoo#123212
      
      Signed-off-by: default avatarXavier Bol (xbo) <xbo@odoo.com>
      1de6f53e
    • Harsh Bhatt (habh)'s avatar
      [FIX] account: fix traceback on opening bank statement · 12410133
      Harsh Bhatt (habh) authored
      
      When user changes the default_account_id on a journal and tries to open a
      statement line, they will get the traceback.
      
      Note: This is reproduceable by using account_accountant only.
      
      Steps to reproduce:
      1) open configuration of bank journal
      2) change default_account_id (bank account) from bank to cash
      3) open bank statement
      4) open any statement line
      5) by following these steps, traceback occurs.
      
      This commit will prevent the above traceback.
      
      sentry - 4059226840
      
      closes odoo/odoo#122428
      
      Related: odoo/enterprise#42232
      Signed-off-by: default avatarLaurent Smet <las@odoo.com>
      12410133
    • roen-odoo's avatar
      [FIX] pos_loyalty: specific discountable take discount into account · 2d109b8b
      roen-odoo authored
      
      Current behavior:
      When computing the discountable values of an order, the discount of the
      program where not taken into account if you used specific discountable
      products.
      
      Steps to reproduce:
      - Create products A and B with a price of 20$
      - Create a loyalty program
      - Rule:
        - Minimum qty : 2
        - Apply on specific products : Product A and Product B
        - Reward : 5 points per order
      - Reward:
        - 10$ per order
        - In exchange of 2 points
        - Apply on specific products : Product A and Product B
      - Open PoS and add Product A and Product B to the order
      - A reward should be added automatically with a value of -10$
      - Click on the reward button, another reward should be added but it has
        the wrong value. It should be -10$ but it is not.
      
      opw-3232565
      
      closes odoo/odoo#121209
      
      Signed-off-by: default avatarJoseph Caburnay (jcb) <jcb@odoo.com>
      2d109b8b
    • hote's avatar
      [FIX] sale: currency conversions and rates · 66eb732c
      hote authored
      
      Before this commit the reports in sales and associated app suffered from a confusion between
      multiplicative and divisive rates for currency conversion. After this commit this will no longer be
      the case.
      
      There are several models with their own currencies that are involved in computing the amount of a
      sale order:
      - the order's company currency `order.company_id.currency_id`
      - the order's pricelist currency `order.pricelist_id.currency_id`
      - the product's currency for each product in the sale order `product.currency_id`
      
      In the case of a report we need also to take into account the current user's company currency:
      `self.env.company.currency_id`.
      
      The `sale_order.currency_rate` is the **multiplicative <u>rate</u>** to convert from the company
      currency into the SO currency.
      
      Any product added to a sale order follow the next conversion. Let `conversion_rate` be the conversion
      rate between the product's currency and the order's company currency, then:
      ```python
      product_amount_converted = product.list_price / conversion_rate
      
      order.amount_total +=  product_amount_converted * order.currency_rate
      ```
      
      The rates returned by `_get_query_currency_table()`, on the other hand, are computed as the
      **multiplicative <u>ratio</u>** to convert from each company currency into the current user's
      company currency.
      
      Any order that is to be analysed on a *report* follow the next conversion. Let `current_company_currency_rate`
      be the conversion rate between the order's company currency and the current user's company, then:
      ```python
      order_amount_in_cmp_currency = order.amount_total / order.currency_rate
      
      report.order_id.price_total = order_amount_in_cmp_currency * current_company_currency_rate
      ```
      
      What follow is a numerical example. Suppose you have the following multi-company and
      multi-currency environment.
      
      |order.id|order.company  |line.subtotal|order.currency|order.currency_rate|
      | ------ | -----------   | ----------- | ------------ | ----------------- |
      |1      |BE Company (EUR)|1000         |INR           |89.46              |
      |2      |BE Company (EUR)|2000         |USD           |1.09               |
      |3      |BE Company (EUR)|3000         |EUR           |1.0                |
      |4      |US Company (USD)|4000         |USD           |1.0                |
      
      If we try to convert all of this for reporting in the US company, the currency table returned by
      `_get_query_currency_table()` will give this (company currencies vs USD):
      
      |currency_table.company|currency_table.rate|
      | -------------------- | ------------------ |
      |BE Company (EUR)      |1.09                |
      |US Company (USD)      |1.0                 |
      
      Finally, in order to convert each amount into USD, applying the formulae listed above should give
      the following result:
      
      |order.id|order.company|display_price_usd           |
      | ------ | ----------- | -------------------------- |
      |1       |BE Company   |1000 / 89.46 * 1.09 = 12.18 |
      |2       |BE Company   |2000 / 1.09 * 1.09 = 2000.00|
      |3       |BE Company   |3000 / 1.0 * 1.09 = 3270.00 |
      |4       |US Company   |4000 / 1.0 * 1.0 = 4000.00  |
      |Total (USD): 9282.18|
      
      Task - 3277006
      
      closes odoo/odoo#119608
      
      Signed-off-by: default avatarVictor Feyens (vfe) <vfe@odoo.com>
      66eb732c
    • Martin Trigaux's avatar
      [I18N] sale_timesheet: remove duplicated entry · aac4a1e9
      Martin Trigaux authored
      
      closes odoo/odoo#125182
      
      Signed-off-by: default avatarMartin Trigaux (mat) <mat@odoo.com>
      aac4a1e9
    • Kartik Chavda's avatar
      [FIX] web: fix new line in confirmation and alert dialog · 700d41d2
      Kartik Chavda authored
      
      Steps:
      - Install studio.
      - Open studio.
      - Click on reset default view.
      
      Issue:
      - Confirmation dialog body display in single line instead in
      multiple lines same thing happens in pos confirmation dialog
      also in new friendly message task we need to display error
      message in multiple line.
      
      Cause:
      - There is a style missing on body of that dialog to preserve
      white spaces also need to use other tag then <t> to apply
      proper style
      
      Fix:
      - Use <p> tag instead <t> tag and add `white-space:pre-wrap;`
      to preserve space in that dialogs.
      
      task-3356114
      
      closes odoo/odoo#124953
      
      Signed-off-by: default avatarPierre Paridans (app) <app@odoo.com>
      700d41d2
    • Andrea Grazioso (agr-odoo)'s avatar
      [FIX] l10n_eg_edi_eta: rate warning due to float point error · 2867a685
      Andrea Grazioso (agr-odoo) authored
      
      Have an Egyptian company setup
      Go to Currencies > USD
      Add a new entry with Unit per EGP 0.03232062055591467
      
      Issue: Warning will raise
      "Please make sure that the EGP per unit is within 5 decimal accuracy.
      Higher decimal accuracy might lead to inconsistency with the ETA
      invoicing portal!"
      
      Even if the shown EGP per Unit is 30.940000000000 it is actually
      30.940000000000005 and it will fail the equal-to-rounding test
      
      opw-3333395
      
      closes odoo/odoo#124812
      
      Signed-off-by: default avatarJosse Colpaert <jco@odoo.com>
      2867a685
    • Touati Djamel (otd)'s avatar
      [FIX] mrp_account: copy analytic account when duplicating a BoM · 9ee02236
      Touati Djamel (otd) authored
      
      Steps to reproduce the bug:
      - Install mrp_plm
      - Create a BoM with an analytic account
      - Create an ECO
      - Start the revision
      
      Problem:
      The new BoM version doesn't have the analytic account from the original
      one.
      
      opw-3329901
      
      closes odoo/odoo#125094
      
      X-original-commit: 02109800
      Signed-off-by: default avatarWilliam Henrotin (whe) <whe@odoo.com>
      Signed-off-by: default avatarDjamel Touati (otd) <otd@odoo.com>
      9ee02236
    • Merel Geens (mege)'s avatar
      [FIX] stock_account: don't create 0 amount COGS lines · 999451e6
      Merel Geens (mege) authored
      After creating a sales order for a product with cost 0, automatic
      inventory valuation and AVCO, and validating the delivery, no account
      move is created for the stock move. If an invoice is then created from
      the sales order, it will create 0 amount COGS lines. Automatic
      reconciliation of the invoice with the corresponding stock account move
      will fail because no such entry exists, resulting in unreconciled lines
      remaining in the invoices.
      
      This issue can be prevented by either creating a 0 amount journal entry
      for the stock move, or preventing the creation of the 0 amount COGS
      lines on the invoice. Not creating unnecessary COGS lines is preferable
      and this was also the solution used for the same problem with purchase
      order invoices: https://github.com/odoo/odoo/pull/106785
      
       .
      
      So this fix does the same for sales order invoices.
      
      opw-3000320
      
      closes odoo/odoo#125021
      
      Signed-off-by: default avatarBrice Bartoletti (bib) <bib@odoo.com>
      Signed-off-by: default avatarMerel Geens <mege@odoo.com>
      999451e6
    • Jurgen (jugj)'s avatar
      [IMP] web : Display the full text when hovering the search panel · 8512402d
      Jurgen (jugj) authored
      
      Following an FP-Request, this PR aims to ease the life of the user
      by indicating the full name of the elements that are truncated due
      to their length as a tooltip.
      task-3332648
      
      closes odoo/odoo#121963
      
      Signed-off-by: default avatarKevin Baptiste <kba@odoo.com>
      8512402d
    • Benoit Socias's avatar
      [FIX] web_editor: fix border width options on zoomed browser · 9ffe68e5
      Benoit Socias authored
      
      When the browser is zoomed, the value of the `border-width` CSS
      properties obtained through `getComputedStyle` are impacted by the
      zoom. Because of this, entering a "10px" border in a Chrome zoomed at
      125% turns it into "9.6px" when leaving the input field.
      
      This commit neutralizes the zoom effect by rounding the value up.
      The rounding operation was empirically determined by observing values,
      see table below.
      
      When zoomed out this does not always work: e.g. at 50% zoom, a value
      of 11px becomes 10px. But zooming out is an unxpected use case, that
      situation is therefore not handled by this fix.
      
      Observed values of the border-width property:
      Set value => `getComputedStyle`
      ```
      Value  Chrome 125%  Firefox 120%
        1px        0.8px     0.83333px
        2px        1.6px     1.66667px
        3px        2.4px     2.50000px
        4px        4.0px     3.33333px
        5px        4.8px     5.00000px
        6px        5.6px     5.83333px
        7px        6.4px     6.66667px
        8px        8.0px     7.50000px
        9px        8.8px     8.33333px
       10px        9.6px    10.00000px
       11px       10.4px    10.83333px
       12px       12.0px    11.66667px
      ```
      
      Steps to reproduce:
      - Drop a "Text - Image" block.
      - Select the text column.
      - Zoom with ctrl+mouse wheel or ctrl-plus.
      - Set a 10px border.
      - Leave input field.
      
      => Border option field displayed a different size.
      
      task-3172235
      
      closes odoo/odoo#125087
      
      X-original-commit: 6398b0c7
      Signed-off-by: default avatarQuentin Smetz (qsm) <qsm@odoo.com>
      Signed-off-by: default avatarBenoit Socias (bso) <bso@odoo.com>
      9ffe68e5
    • Tom De Caluwé's avatar
      [FIX] core: allow uppercase characters in translatable fields · 5a897a57
      Tom De Caluwé authored
      
      Identifiers (including column names) that are not double-quoted are folded to
      lowercase in PostgreSQL. Before this commit, this resulted in errors when
      updating translations for translatable fields, because the query did not
      correctly quote all identifiers.
      
      opw-3287428
      
      closes odoo/odoo#124500
      
      Signed-off-by: default avatarJulien Castiaux (juc) <juc@odoo.com>
      5a897a57
    • Jay Savaliya's avatar
      [FIX] website_slides: prevent auto-marking videos complete · 488ce254
      Jay Savaliya authored
      When user will open the video in any course, it will be marked as completed
      directly which behaves like any other content(pdf, image). This behavior was
      introduced when 'slide_view' was modified in https://github.com/odoo/odoo/commit/4c291fe30468dab7cef9d2e5a0377c78484f5045
      
      , but in the case of video,
      it must not be marked as completed before the video is watched up until(near)
      the end, as per the previous behavior.
      
      Task-3346507
      
      closes odoo/odoo#124123
      
      Signed-off-by: default avatarThibault Delavallee (tde) <tde@openerp.com>
      488ce254
    • Touati Djamel (otd)'s avatar
      [FIX] stock: avoid traceback when changing operation type · 3db056a8
      Touati Djamel (otd) authored
      Steps to reproduce the bug:
      - create a new transfer
      - Click on new line but leave it empty
      - Change operation type
      
      Problem:
      A traceback is triggered, because the onchange of picking_type is
      triggered, so we try to get the description of each product in each
      move. However, since the move does not have a product set,
      an error is thrown:
      https://github.com/odoo/odoo/blob/16.0/addons/stock/models/product.py#L235-L239
      
      
      
      opw-3349646
      
      closes odoo/odoo#125010
      
      Signed-off-by: default avatarWilliam Henrotin (whe) <whe@odoo.com>
      3db056a8
  3. Jun 14, 2023
    • Julien Carion (juca)'s avatar
      [FIX] account: fix vendor bills tax discard · a7bddfd1
      Julien Carion (juca) authored
      
      This commit fixes the object reference issue which was linked to the
      TaxTotals Component computations. The issue was that discarding changes
      on the tax field of a vendor bill wouldn't roll back the field's value
      visually while the record would still have correctly updated values.
      This issue originates from the fact that operations were made to compute
      the taxes in the component but these would affect the server data as
      well since the object reference between the local data and the server
      data was the same. This means that the discard operation would bring
      the displayed value back to the server data's one which has been
      modified by the computations so it would not work. The reference to the
      server data is now separated from the local one so that the bug won't
      appear anymore.
      
      opw-3285209
      
      closes odoo/odoo#123278
      
      Signed-off-by: default avatarMathieu Duckerts-Antoine <dam@odoo.com>
      a7bddfd1
    • Jurgen (jugj)'s avatar
      [IMP] hr: Add a search panel for company and department on hr_job views · 2ad50424
      Jurgen (jugj) authored
      
      task-3332640
      
      closes odoo/odoo#122436
      
      Signed-off-by: default avatarKevin Baptiste <kba@odoo.com>
      2ad50424
    • Rodolpho Lima's avatar
      [FIX] web_editor: link with @ open new window option · 3f1db239
      Rodolpho Lima authored
      Before this commit, when using the LinkTools (website, mass_mailing),
      if an http URL contained a "@" (ex: https://www.youtube.com/@iRopes
      
      ),
      it got incorrectly recognized as an e-mail URL and the option to open
      the link in a new windown was hidden from the UI.
      
      This commit fixes the issue by making the test for e-mail URL slightly
      more robust than just checking for the presence of a "@".
      
      task-3356685
      opw-3349704
      
      closes odoo/odoo#124110
      
      Signed-off-by: default avatarDavid Monjoie (dmo) <dmo@odoo.com>
      3f1db239
    • pedrambiria's avatar
      [FIX] pos_loyalty: prevent unwanted free product points correction · d96442a7
      pedrambiria authored
      
      Before this commit, purchasing a gift card along with applying a free
      product promotion in the same order resulted in the gift card balance
      being decreased by the free product price.
      
      Steps to reproduce:
      1. Create a buy x get y promo program.
      2. Open the POS and use this program and sell a gift card in the same transaction.
      3. Activate the promo program and complete the transaction.
      The promo program discount will take money of the gift card amount.
      
      Also there is another issue with Loyalty Cards points:
      When the reward's product in not valid of the rule, it will decrease
      the point when you add the reward.
      
      opw-3284636
      
      closes odoo/odoo#121962
      
      Signed-off-by: default avatarJoseph Caburnay (jcb) <jcb@odoo.com>
      d96442a7
    • bve-odoo's avatar
      [FIX] account_edi_ubl_cii: allow none-admin to create xml · 04c2bb02
      bve-odoo authored
      
      Steps to reproduce on fresh 15.0:
      Connected as Admin:
      1. Install l10n_lu_peppol_id,
      2. Modify the field 'edi_format_ids'
      on a journal (here will be on customer invoices)
      to the value 'Peppol BIS Billing 3.0'
      3. Invoice a product using this journal and confirm it.
      > The XML will be generated and attached to the move.
      The mimetype of this attachement will be application/xml
      
      If you do the same step 3 with a user that does not have
      the write access right to the model ir_ui_view
      (see _check_contents in base), the attachment will be
      of type text/plain.
      
      The issue that this trigger, is that the email going out
      will have the wrong Content-Type for the attachments.
      Which will lead to incorrect management on other provider.
      
      We can bypass the security here as the XML is generated
      by Odoo.
      
      opw-3263542
      
      closes odoo/odoo#124709
      
      X-original-commit: 9ae7fdb8
      Signed-off-by: default avatarWilliam André (wan) <wan@odoo.com>
      04c2bb02
    • Chintan Panchal (can)'s avatar
      [FIX] web_editor: fix video size in grid mode · b54b34e6
      Chintan Panchal (can) authored
      
      Before this commit, `o_grid_item_image` was not handling videos but image-only.
      
      This commit adds support for `.media_iframe_video` in addition to `img` to
      ensure consistent styling across both images and videos within the grid items.
      
      task-3103775
      
      closes odoo/odoo#121266
      
      Signed-off-by: default avatarQuentin Smetz (qsm) <qsm@odoo.com>
      b54b34e6
    • Louis (loco)'s avatar
      [FIX] web_editor: enable to translate invisible blocks · c76ff023
      Louis (loco) authored
      
      Steps to reproduce the problem:
      - Drop a popup snippet in a page.
      - On another language, click on translate.
      - Problem -> It is impossible to translate the popup.
      
      To resolve this problem, the function `_updateInvisibleDOM` is called
      even in translation mode. Thanks to this function, the invisible
      snippets are now filled in the edit bar and the user has the opportunity
      to display them or to hide them.
      
      task-3098517
      opw-3268592
      opw-3283140
      
      closes odoo/odoo#121219
      
      X-original-commit: 04409af0
      Signed-off-by: default avatarQuentin Smetz (qsm) <qsm@odoo.com>
      c76ff023
    • Thomas Lefebvre (thle)'s avatar
      [FIX] hr_holidays_attendance: not blocking the refusal of leave · c96684f5
      Thomas Lefebvre (thle) authored
      
      Steps to reproduce:
      -------------------
      - activate "Count Extra Hours" in Attendances settings;
      - create attendances for an employee to create an overtime
      (select one day of the weekend for example);
      - create an Extra Hours type leave for this employee;
      - remove the attendance that creates extra hours;
      
      The extra hours of the employee is negative
      
      - refuse the leave created before;
      
      Issue:
      ------
      A Validation Error occurs with the message:
      "The employee does not have enough extra hours to extend this leave.".
      
      Solution:
      ---------
      Refuse leave based on extra hours
      should not require any control
      because we are not trying to extend leave.
      
      opw-3342778
      
      closes odoo/odoo#124959
      
      X-original-commit: b86afb9f
      Signed-off-by: default avatarKevin Baptiste <kba@odoo.com>
      c96684f5
    • Gauthier Wala (gawa)'s avatar
      [FIX] analytic: view all plans on view subplans · c0bc5aed
      Gauthier Wala (gawa) authored
      
      To reproduce:
      - Activate analytic accounting
      - Create an analytic plan
      - Click on Subplans
      - Create a Subplan
      - Come back to the list view of subplans (with the breadcrumb)
      => The new plan does not appear
      
      The children_ids are not recomputed, so we inverse the logic.
      
      task-3359643
      
      closes odoo/odoo#124404
      
      Signed-off-by: default avatarWilliam André (wan) <wan@odoo.com>
      c0bc5aed
    • nni-odoo's avatar
      [FIX] l10n_id_efaktur: incosistency in price · 4a711c04
      nni-odoo authored
      
      There are some inconsistencies in price between the original record and tax document due to rounding. This issue is now mitigated by having a more accurate decimal place rounding
      
      3019692
      
      closes odoo/odoo#124773
      
      X-original-commit: 4a33669e
      Signed-off-by: default avatarNicolas Viseur (vin) <vin@odoo.com>
      4a711c04
    • Benjamin Vray's avatar
      [FIX] website: fix the scrolling of table of content in website slides · 57e267a2
      Benjamin Vray authored
      
      Steps to reproduce the bug:
      
      - Install the Website Slides module.
      - Got to the /slides page.
      - Click on a course.
      - Click on the "Add Content" button.
      - Choose "Web Page" in the modal.
      - Once in edit mode, drag and drop a "Table of Content" snippet onto the
      page.
      - Save the page.
      - Scroll the page and observe that the navbar items are updated as you
      scroll.
      - Click on the "Fullscreen" button.
      - Bug: When scrolling the page, the navbar items are no longer updated
      as you scroll.
      
      This commit fixes the issue by detecting the scrolling element by
      traversing up the ancestors from the 'table of content' snippet, instead
      of using the 'getScrollingElement' function, which always returned the
      '#wrapwrap' when a Website Slides page is in fullscreen.
      
      opw-3302118
      
      closes odoo/odoo#124913
      
      X-original-commit: 1ac274c3
      Signed-off-by: default avatarRomain Derie (rde) <rde@odoo.com>
      Signed-off-by: default avatarVray Benjamin (bvr) <bvr@odoo.com>
      57e267a2
    • yhu-odoo's avatar
      [FIX] purchase_stock: valuation layer wrong when different currency · fe95fe19
      yhu-odoo authored
      
      To reproduce:
      1. Create a storable product with ordered quantities policy for purchase and with a category set as FIFO automated
      2. Create a purchase order in a different currency and set quantities for partial deliveries
      3. Create a partial delivery
      4. Fully invoice the purchase order
      5. Create the delivery of the complementary units
      6. Check the stock valuation layer
      The valuation of backorder is wrong.
      
      The value on valuation layer is in company's currency, while the value
      on invoice line is in the PO's currency. When create valuation line for
      backorder, we didn't convert them to same currency.
      
      opw-3300266
      
      closes odoo/odoo#123118
      
      Signed-off-by: default avatarArnold Moyaux (arm) <arm@odoo.com>
      fe95fe19
Loading