Skip to content
Snippets Groups Projects
  1. Oct 14, 2020
    • Xavier Morel's avatar
      [FIX] core: PyPDF2 suppresses warnings · 6b04dbcd
      Xavier Morel authored
      
      By default, PdfFileReader will monkeypatch the `warnings` module even
      if it has no reason whatsoever to do so and suppress the
      `captureWarnings` behavior.
      
      This means as soon as we've loaded a PDF file, `warnings.warn` don't
      trigger `logging` warnings anymore, and become invisible.
      
      This can lead to non-deterministic behaviors depending as warnings may
      or may not be suppressed depending when they occur relative to loading
      a PDF e.g. load a module which runs a test which loads a PDF before a
      module triggering a warning and the warning won't be visible, other
      way around it will.
      
      Except ofc while we have an override to PdfFileReader it's not
      used *everywhere*, so need to monkeypatch the init.
      
      closes odoo/odoo#60002
      
      Signed-off-by: default avatarXavier Morel (xmo) <xmo@odoo.com>
      6b04dbcd
  2. Oct 13, 2020
  3. Oct 15, 2020
    • Nasreddin (bon)'s avatar
      [FIX] mail: mail not sent because partner not find in chatter + unit test · 8f12c025
      Nasreddin (bon) authored
      
      Issue
      
      	- Install "Project" module
      	- Go to the chatter of any Task
      	- Log the following message (by selecting the partner) then send:
      	"test@test.com
      	@marc Demo "
      
      	Message is not sent.
      
      Cause
      
      	When parsing the content, the match result is "@test.com\n@Marc Demo" due
      	to no space between the two mentions
      
      Solution
      
      	Add space after line break (only when parsing selection).
      	In this case, it will match with 2 mentions instead:
      	"@test.com\n" and "@marc Demo "
      
      	For _generateMentionsLinks step, add a space after '</br>',
      	it will match 2 mentions but we remove the ones that end
      	with '</br>'. This last fix is to avoid having a non-mention
      	string containing '</br>' (for example), and therefore not
      	having them escaped in final message content.
      
      opw-2322577
      
      closes odoo/odoo#59648
      
      Signed-off-by: default avatarAlexandre Kühn (aku) <aku@odoo.com>
      8f12c025
  4. Sep 28, 2020
  5. Oct 15, 2020
    • Laurent Smet's avatar
      [FIX] account: Fix price_unit with fiscal position to price included tax · f2a5476c
      Laurent Smet authored
      
      Suppose two price_included taxes: 10%, 20%, a product having a sale price of 110.0 and a fiscal position tax 10% => tax 20%:
      
      When onchange_product_id is called, the price_unit is computed as follow:
      110 / 1.1 = 100
      100 * 1.2 = 120
      So price_unit = 120 and balance = 100.0
      
      But in onchange_uom_id, we do the same thing and we call _get_fields_onchange_balance_model with balance=100.0.
      However, in this method, an empty dictionary is returned because price_subtotal == balance.
      Then, {}.get('price_unit', price_unit) will return the original price_unit (110.0) instead of the new computed one (120.0).
      
      closes odoo/odoo#59888
      
      X-original-commit: 2324599b
      Signed-off-by: default avataroco-odoo <oco-odoo@users.noreply.github.com>
      Signed-off-by: default avatarLaurent Smet <smetl@users.noreply.github.com>
      f2a5476c
  6. Oct 02, 2020
  7. Oct 15, 2020
    • Dominik Rubo's avatar
      [IMP] project: enable config-selected features in projects · 8dd0edae
      Dominik Rubo authored
      
      This change ensures that when the user activates optional features of the
      project app, they are enabled in existing projects as well as newly created
      projects automatically, which is likely what the user expects.
      
      For most optional features, this behavior was already in place. It was not in
      place yet for the sub-tasks and timesheets features, which this change fixes.
      
      Two added tests check the behavior described above for features that are
      activated through a `group_*` field on `res.config.settings` (sub-tasks,
      recurring tasks and ratings). The tests do not cover features that are
      activated through a `module_*` field, as such fields require the installation
      of further modules and we cannot simulate this.
      
      Task 2297054
      
      closes odoo/odoo#58692
      
      Related: odoo/enterprise#13641
      Signed-off-by: default avatarYannick Tivisse (yti) <yti@odoo.com>
      Co-authored-by: default avatarKevin Baptiste <50135801+kba-odoo@users.noreply.github.com>
      8dd0edae
  8. Sep 24, 2020
  9. Oct 15, 2020
    • Kairis's avatar
      [FIX] expense: fix generated QRCode · a1307841
      Kairis authored
      When there is no expense, a messages is shown: "Did you try the mobile app?"
      When clicking on the "Download on the App Store"
      or on the "Get it on Google Play" buttons, generated QR codes have some invalid data before it:
      - 002
      - 1
      - <the url>
      
      This commit removes datas that are before the url so only the url is displayed.
      
      closes odoo/odoo#58097
      
      Taskid: 2326303
      Signed-off-by: default avatarYannick Tivisse (yti) <yti@odoo.com>
      a1307841
    • Paul Morelle's avatar
      [FIX] point_of_sale: avoid Gui undefined when connection failed · 063e617a
      Paul Morelle authored
      
      Since odoo/odoo@c6397ab3b3654da336a4269a81d5d91016baf520, the printer.js
      file has been refactored, and if the connection to the IoTBox failed,
      the error popup could not be displayed because Gui was undefined.
      
      Steps to reproduce on the runbot:
      - Configure your POS session with an IoTBox with receipt printer and
        cashdrawer
      - Open your POS session
      - Skip the connection to the IoTBox
      - Proceed to payment
      - Open the cashbox
      - Error: Gui is not defined
      
      This commit fixes the behavior by displaying the error properly.
      
      In line with this fix, we are also putting the printing assets back in
      the point_of_sale.assets because pos printing in the backend is no
      longer needed.
      
      closes odoo/odoo#60006
      
      Signed-off-by: default avatarpimodoo <pimodoo@users.noreply.github.com>
      063e617a
  10. Oct 13, 2020
    • Arnaud Joset's avatar
      [FIX] sale_product_configurator,website_sale,website_sale_product_configurator: tests were failing · f7ca48e9
      Arnaud Joset authored
      
      Before this commit,
       * the website_sale tests used the field optional_product_ids on product_template even if it is defined on sale_product_configurator.
       * the website_sale_product_configurator test added some steps to the website_sale tour.
      
      This commit removes the faulty fields in the website_sale test and fix the website_sale_product_configurator tests.
      After this commit, sale_product_configurator and website_sale_product_configurator have a test classes to setup all the parameters needed during the flow.
      This prevent duplicated code for similar workflow.
      
      closes odoo/odoo#59201
      
      Taskid: 2340918
      Signed-off-by: default avatarYannick Tivisse (yti) <yti@odoo.com>
      f7ca48e9
  11. Oct 14, 2020
  12. Oct 15, 2020
    • Rémy Voet (ryv)'s avatar
      [FIX] sale_stock: fix color forecasted popover · 94c10df7
      Rémy Voet (ryv) authored
      
      Before, the `virtual_available_at_date` was used to
      describe the `free_qty_today` when the forecasted is calculated
      via the forecasted of stock move. This issue
      create a difference of color when SO become confirmed
      (if the `free_qty_today < 0`).
      
      To fix this, use the `free_qty_today` to compute the `will_be_fulfilled`
      (in the js widget) and fill `free_qty_today` instead
      of `virtual_available_at_date` when SO is confirmed.
      
      opw-2360024
      
      closes odoo/odoo#60054
      
      Signed-off-by: default avatarArnold Moyaux <amoyaux@users.noreply.github.com>
      94c10df7
    • Nicolas Galler's avatar
      [FIX] base: correct unit test for compatibility with PIL 7.0 · 99b3f0be
      Nicolas Galler authored
      
      The unit test in `test_base_document_layout` does not pass with
      version 7.0.0 of PIL, which is loaded by default on Ubuntu 20.04.
      The reason is that the color obtained from the image is slightly
      different.  This fix slightly relaxes the test (in fact we don't care
      about the exact color obtained in this test, we just want to make sure
      that it doesn't crash)
      
      opw-2342394 (original ticket)
      
      closes odoo/odoo#59912
      
      X-original-commit: 3028c814
      Signed-off-by: default avatarThomas Dieuzeide <tdi-odoo@users.noreply.github.com>
      99b3f0be
  13. Oct 14, 2020
  14. Oct 08, 2020
    • William Henrotin's avatar
      [FIX] purchase(_stock): track qty_received changes · 3d592649
      William Henrotin authored
      
      Commit 0f80e69b tracked all changes on
      qty_received on the purchase order. But did that wrongly by calling
      `write` inside a compute.
      Commit b7cc3b06 fixed this `write`
      by an `=` to avoid error when the compute is called on virtual records.
      This fix result on forgetting to track the quantity delivered.
      
      This commit sends a message to post in `write` AND in the
      `compute_qty_received` to be sure it is posted. This way, we do not call
      write in compute anymore.
      
      closes odoo/odoo#59482
      
      Signed-off-by: default avatarWilliam Henrotin <Whenrow@users.noreply.github.com>
      3d592649
  15. Oct 14, 2020
    • Xavier Morel's avatar
      [FIX] account: don't call deprecated method · 5bc6eb9b
      Xavier Morel authored
      
      Introduced in 5a031e64, issue got
      caught and fixed in the master version of the PR (odoo/odoo#59798) but
      because of an other issue the warning was non-deterministic, and the
      14.0 PR (odoo/odoo#59794) was successfully merged without needing the
      change, and has been breaking stagings ever since.
      
      Also updated the warning stacklevel so that it reports the *caller* of
      AccountMove.post instead of reporting AccountMove.post itself, that's
      more useful.
      
      closes odoo/odoo#59996
      
      Signed-off-by: default avatarXavier Morel (xmo) <xmo@odoo.com>
      5bc6eb9b
    • Xavier Morel's avatar
      [IMP] core: make post-install tests deterministic · ce953a89
      Xavier Morel authored
      
      `registry._init_modules` is a set so its iteration order is
      non-deterministic (it's randomised on interpreter initialisation
      unless PYTHONHASHSEED is provide through the environment). This can
      lead to annoying non-deterministic behavior: while the non-determinism
      is only at the module level, it's easy enough for modules to have
      python-level side-effects (e.g. patch methods, update globals, ...),
      which may only be surfaced by an other module executing after them,
      but not if said module executes before.
      
      By sorting the modules we should make this much more reliable one way
      or another.
      
      closes odoo/odoo#60023
      
      X-original-commit: f9169a46
      Signed-off-by: default avatarXavier Dollé (xdo) <xdo@odoo.com>
      ce953a89
    • Nicolas Martinelli's avatar
      [FIX] account: wrong rounding with multi-currency · dad5e2a5
      Nicolas Martinelli authored
      
      - Create a tax:
        5%
        Included in price
      - Set the company currency to USD
      - Set the currency rounding of CHF to 0.05
      - Set the rate for CHF to 0.654065014
      - Create the following invoice in CHF:
        Set a payment term
        Prod 1, 1 unit,  5.0 CHF, tax 5%
        Prod 2, 1 unit, 10.0 CHF, tax 5%
        Prod 3, 1 unit, 50.0 CHF, tax 5%
      
      It is not possible to save the invoice because of an unbalanced journal
      entry.
      
      Indeed, the Receivable line is $99.30 while it should be $99.29. This
      happens because we round the `total_balance` with the rounding precision
      of the invoice currency while it is in the company currency.
      
      closes odoo/odoo#58798
      
      closes odoo/odoo#59978
      
      Signed-off-by: default avatarNicolas Martinelli (nim) <nim@odoo.com>
      dad5e2a5
    • Nicolas Martinelli's avatar
      [FIX] account: wrong computation with currency rounding 0.05 · 94353ebd
      Nicolas Martinelli authored
      - Create a tax:
        5%
        Included in price
      - Set the currency rounding of the company to 0.05 (e.g. CHF)
      - Create the following invoice
        Prod 1, 1 unit,  5.0 CHF, tax 5%
        Prod 2, 1 unit, 10.0 CHF, tax 5%
        Prod 3, 1 unit, 50.0 CHF, tax 5%
      
      The total amount of the invoice is 64.95 CHF instead of 65.00 CHF, even
      in a 'Round per line' configuration.
      
      It happens because `compute_all` rounds the amounts following the number
      of digits of the currency instead of using the `rounding` field.
      
      Note that there is a discrepancy between the POS computation and the
      Account computation: the POS already uses the `rounding` field instead
      of the number of digits:
      
      https://github.com/odoo/odoo/blob/80073c5430f0ab562dfc27572c108114161ebb25/addons/point_of_sale/static/src/js/models.js#L1855-L1991
      
      opw-2341566
      94353ebd
    • qsm-odoo's avatar
      [FIX] website: show the correct value for hoverable dropdown option · e1f8d549
      qsm-odoo authored
      Before this commit, the hoverable dropdown option was broken because
      we changed the option selector to the navbar element instead of the
      header element. But we forgot to care about the data-select-class
      which adds a class on the header. This commit fixes the issues by
      changing the $target back to the header element for the related option
      as the fact it is linked to the navbar element is only so that the
      options appear in a different section, on navbar click.
      
      Part of https://github.com/odoo/odoo/pull/59842
      
      
      task-2312878
      
      closes odoo/odoo#59842
      
      Signed-off-by: default avatarQuentin Smetz (qsm) <qsm@odoo.com>
      e1f8d549
    • qsm-odoo's avatar
      [FIX] website, *: restore navbar options for 'Boxed' header · 6a458702
      qsm-odoo authored
      *: web_editor
      
      The selector targeting the navbar for the related editor options was
      not correct to target the navbar of the 'Boxed' version of the header.
      
      Part of https://github.com/odoo/odoo/pull/59842
      task-2312878
      6a458702
  16. Oct 13, 2020
    • xO-Tx's avatar
      [FIX] website: fix invisible parallax snippet issue · f019cd67
      xO-Tx authored
      
      When the height not forced (50% or 100% screen's height), the snippet
      simply disappear if there is no content inside (default).
      
      The 4e220bf commit makes parallax snippet empty by default and the
      main goal of a8f0cee was to make "DRAG BUILDING BLOCK HERE" placeholders
      appear only on drag, that's why we need to add a "min-height" for parallax
      to keep it visible when the "Height" selected is auto.
      
      task-2327025
      
      closes odoo/odoo#57075
      
      Signed-off-by: default avatarQuentin Smetz (qsm) <qsm@odoo.com>
      f019cd67
  17. Oct 14, 2020
  18. Oct 13, 2020
  19. Oct 14, 2020
Loading