Skip to content
Snippets Groups Projects
  1. May 18, 2021
    • Alvaro Fuentes's avatar
      [FIX] base/ir_model: fix materialized views columns listing · b8867220
      Alvaro Fuentes authored
      
      When there is a materialized view that has not been populated any select
      on it will fail.
      
      Example of traceback:
      ```
      Traceback (most recent call last):
        File "/home/odoo/src/odoo/12.0/odoo/service/server.py", line 1162, in preload_registries
          registry = Registry.new(dbname, update_module=update_module)
        File "/home/odoo/src/odoo/12.0/odoo/modules/registry.py", line 86, in new
          odoo.modules.load_modules(registry._db, force_demo, status, update_module)
        File "/home/odoo/src/odoo/12.0/odoo/modules/loading.py", line 367, in load_modules
          registry.setup_models(cr)
        File "/home/odoo/src/odoo/12.0/odoo/modules/registry.py", line 262, in setup_models
          env['ir.model']._add_manual_models()
        File "/home/odoo/src/odoo/12.0/odoo/addons/base/models/ir_model.py", line 321, in _add_manual_models
          cr.execute('SELECT * FROM %s LIMIT 0' % Model._table)
        File "/home/odoo/src/odoo/12.0/odoo/sql_db.py", line 148, in wrapper
          return f(self, *args, **kwargs)
        File "/home/odoo/src/odoo/12.0/odoo/sql_db.py", line 225, in execute
          res = self._obj.execute(query, params)
      psycopg2.errors.ObjectNotInPrerequisiteState: materialized view "x_bi_sql_view_report_copy" has not been populated
      HINT:  Use the REFRESH MATERIALIZED VIEW command.
      ```
      
      Several upgrade requests have or had had this error which has been
      solved with specific scripts.
      
      Related to #40930
      
      closes odoo/odoo#71002
      
      X-original-commit: b208570c
      Signed-off-by: default avatarRaphael Collet (rco) <rco@openerp.com>
      b8867220
  2. Mar 24, 2021
  3. May 18, 2021
  4. Mar 25, 2021
    • yhu-odoo's avatar
      [IMP] mrp: no register number check after duplicate MO · 6aaf3375
      yhu-odoo authored
      
      To reproduce:
      1. create and confirm a MO with register number checks on operations
      2. duplicate the MO
      The register number checks won't show up in the new MO
      
      We didn't set copy=False for workorder_id on stock.move, when copy a
      confirmed MO, the new moves are linked to old WOs on old MO. New WO
      didn't link to any moves.
      When create quality checks, we only create "register ..." checks for WOs
      with move_id. As a result, new WOs without move_id won't have those
      checks.
      To fix, set copy=False on workorder_id of stock.move
      
      Task 2484939
      
      closes odoo/odoo#68348
      
      Signed-off-by: default avatarArnold Moyaux <amoyaux@users.noreply.github.com>
      6aaf3375
  5. May 18, 2021
  6. May 12, 2021
  7. May 18, 2021
  8. May 17, 2021
    • std-odoo's avatar
      [IMP] mail: allow to force the FROM headers of the outgoing mail server · 13ff118d
      std-odoo authored
      
      Purpose
      =======
      We want to be able to force the FROM headers when we sent email in
      SMTP. So we can avoid the emails to be considered as spam.
      
      Specifications
      ==============
      This is done with 2 system parameters.
      
      If the system parameter `mail.force.smtp.from` is set we encapsulate all
      outgoing email from with the given value.
      
      If the previous system parameter is not set and if both
      `mail.dynamic.smtp.from` and `mail.catchall.domain` are set, we
      encapsulate the FROM only if the domain of the email is not the same as
      the domain of the catchall parameter.
      
      Otherwise we do not encapsulate the email (same behavior as before this
      commit).
      
      Task 2367946
      See odoo/odoo/pull/61853
      
      closes odoo/odoo#70854
      
      X-original-commit: 044532ae
      Signed-off-by: default avatarThibault Delavallee (tde) <tde@openerp.com>
      Signed-off-by: default avatarOlivier Dony (odo) <odo@openerp.com>
      13ff118d
    • Aaron Bohy's avatar
      [FIX] web: domain: (=)(i)like operators · 44e185db
      Aaron Bohy authored
      
      Before this commit, evaluating a domain containing a like/ilike
      operator with an evaluation context in which the value was false
      crashed.
      
      Moreover, those operators were wrong w.r.t. the case sensitivity:
      like was case insensitive, whereas ilike was case sensitive, and
      both =like and =ilike were case insensitive.
      
      This commit fixes thoses issues.
      
      The first issue was spotted on our prod, as we tried to add an
      invisible attrs in a form view, using the ilike operator (it thus
      crashed in create mode).
      
      The second issue was spotted while writting the test cases.
      
      To the best of our knowledge, those operators aren't used in attrs
      (for now), explaining why those issues haven't been found before.
      
      closes odoo/odoo#70876
      
      Signed-off-by: default avatarGéry Debongnie (ged) <ged@openerp.com>
      44e185db
    • Xavier BOL (xbo)'s avatar
      [FIX] pad_project: copy the content in the pad when use_pad=False · 7873144a
      Xavier BOL (xbo) authored
      
      Before this commit, when the user edits the description of a task with
      use_pad=True and then change the project of this task to one with
      use_pads=False. The description written in the pad server is not copied
      in the description field of the task.
      
      This commit copies the content of the pad for this case when the use_pad
      changes to become False and description_pad is set.
      
      Step to reproduce:
      -----------------
      
      1. Go to Settings of the Project App and enable the Collaborative Pads
      2. Go to the Project App, in the Projects dashboard (kanban view of projects)
      3. Create two Projects (one called "Project A" and the other called "Project B")
      4. Edit the Project B to activate the pad, that is, check the Use
      collaborative pads checkbox.
      5. Go to the view list of tasks in the "Project B"
      6. Click on "Create" button to create a task in the task form view.
      7. Write a description for this task.
      8. Change the project of this task by the "Project A". With this change,
      the collaborative pad is disabled for this task since the Project A has
      not the pad, and then the description field is empty rather than have
      the content that we have just written.
      
      task-2515150
      
      closes #70401
      
      closes odoo/odoo#70901
      
      X-original-commit: 32a8f598
      Signed-off-by: default avatarLTU-Odoo <IT-Ideas@users.noreply.github.com>
      7873144a
    • Xavier BOL (xbo)'s avatar
      [FIX] pad: copy the pad_content_field content in pad when genrate pad url · 7d49c251
      Xavier BOL (xbo) authored
      Before this commit, in Project App, when the "Collaborative Pads" is
      enabled in the Settings of this app, if the user create a task without
      project or in a project that has not the pad enabled and he writes a
      description for his new task and select (another) project in which the
      pads is enabled then the description field in the form view changed to
      have the collaborative pad and the problem is the description is not
      copied in the pad and seems erase/delete for the user.
      
      This commit checks if the pad_content_field is not empty after
      generating the pad url for the new task/record, if it is the case then
      we copy the content in the pad and the user can continue his edition
      before saving the task/record.
      
      Step to reproduce:
      -----------------
      
      1. Go to Settings of the Project App and enable the Collaborative Pads
      2. Go to the Project App, in the Projects dashboard (kanban view of projects)
      3. Create two Projects (one called "Project A" and the other called "Project B")
      4. Edit the Project B to activate the pad, that is, check the Use
      collaborative pads checkbox.
      5. Go to the view list of tasks in the "Project A"
      6. Click on "Create" button to create a task in the task form view.
      7. Write a description for this task.
      8. Change the project of this task by the Project B. With this change,
      the collaborative pad is actived for this task since the Project B has
      the pad, and then the description in the pad is empty rather than have
      the content that we have just written.
      
      task-2515150
      
      closes #70401
      
      X-original-commit: d2b55c77
      7d49c251
    • Nicolas Lempereur's avatar
      [FIX] point_of_sale: rounding down near 0 · 23dd2ea5
      Nicolas Lempereur authored
      
      Before 03025520 rounding applied was eg. for these numbers and UP and
      DOWN rounding methods to multiple of 10:
      
      ```
      Numbers | -8 | -2 |  2 |  8 | 12
      DOWN    | -2 | -8 | -2 | -8 | -2
      UP      |  8 |  2 |  8 |  2 |  8
      ```
      
      which is correct for positive numbers but UP and DOWN are inversed for
      negatives numbers.
      
      After 03025520 this became:
      
      ```
      Numbers | -8 | -2 |  2 |  8 | 12
      DOWN    |  8 |  2 |  8 | -8 | -2
      UP      | -2 | -8 | -2 |  2 |  8
      ```
      
      which is correct for all cases except for positive numbers that are
      before HALF of the precision (eg. number 2) for which UP and DOWN are
      inversed.
      
      This is happening because 03025520 uses the sign of the rounded value
      => this does not work for 0 so number 2 is broken (and if fixed number
      -2 would be broken).
      
      With this commit, the adjustement of sign is done based on original
      number, so we get the equivalent of python equivalent methods:
      
      ```
      Numbers | -8 | -2 |  2 |  8 | 12
      DOWN    |  8 |  2 | -2 | -8 | -2
      UP      | -2 | -8 |  8 |  2 |  8
      ```
      
      opw-2451841
      
      closes odoo/odoo#70910
      
      Signed-off-by: default avatarNicolas Lempereur (nle) <nle@odoo.com>
      23dd2ea5
    • Laurent Smet's avatar
      [REVERT] sale: Fix fiscal pos. mapping taxes to price included · def7d7bb
      Laurent Smet authored
      This reverts commit d89562e8fe473692296cb209651beb2ce7a715e4.
      
      Since this commit, the taxes mapped by fiscal position wasn't managed by the _fix_tax_included_price_company method anymore.
      Otherwise, some customizations exist on this method that are no longer called.
      The 2527940 issue is also due to a remaining bug: the total_excluded price should be divided by the quantity but:
      - what if the quantity & price_unit are both signed?
      - what if the number of digits for price_unit and the currency are different? Should we skip the rounding of taxes?
      Since this commit is not perfect and has a lot of dependencies in others modules, we decided to revert it.
      
      Original PR: https://github.com/odoo/odoo/pull/68997
      Revert PR: https://github.com/odoo/odoo/pull/70858
      
      
      
      closes odoo/odoo#70883
      
      Issue: 2527940
      X-original-commit: c9330e4a
      Signed-off-by: default avatarVictor Feyens (vfe) <vfe@odoo.com>
      Signed-off-by: default avatarLaurent Smet <smetl@users.noreply.github.com>
      def7d7bb
    • Ivan Yelizariev's avatar
      [FIX] purchase: speed up search for purchase_vendor_bill_id · 09da295f
      Ivan Yelizariev authored
      
      When partner is not selected, Odoo sends name_search request
      `[..., ('partner_id', 'child_of', [False])]`. It's not obvious what does such
      domain mean ( see #70584 ). This commit clarifies what do we expect to get:
      we want all records without restrictions on `partner_id` value.
      
      This also fixes performance issue because domain leaf `('partner_id',
      'child_of', [False])` is converted to where-clause `<table>.partner_id in <all
      or almost all ids>`
      
      ---
      
      opw-2524010
      
      closes odoo/odoo#70842
      
      X-original-commit: 39e0f1fb
      Signed-off-by: default avatarRémy Voet <ryv-odoo@users.noreply.github.com>
      Signed-off-by: default avatarIvan Yelizariev // IEL <yelizariev@users.noreply.github.com>
      09da295f
    • Djamel (otd)'s avatar
      [FIX]sale_timesheet : Convert the project overview values to the current currency · 7f9cacd4
      Djamel (otd) authored
      
      Steps to reproduce the bug:
      - Go to Project app
      - See the overview of any project
      - Select at the top right another company with a different currency. But keep the company assigned to the current project selected
      
      Problem:
      The new currency is changed in the project overview, but the values are not converted to this currency.
      
      opw-2479364
      
      closes odoo/odoo#70597
      
      X-original-commit: eeeb18a2
      Signed-off-by: default avatarNicolas Lempereur (nle) <nle@odoo.com>
      7f9cacd4
    • Nasreddin (bon)'s avatar
      [FIX] payment: enable pay button when clicking back button · aa1e0711
      Nasreddin (bon) authored
      Issue
      
          Use Safari (or equivalent) browser
      
          - Install e-commerce
          - Go to Website -> Configuration -> Payment Acquirers
          - Activate Ingenico in test mode
              (write aaa in required fields)
          - Go to shop, and add product to card
          - Go to checkout
          - Select Ingenico payment mode
          - Click on Pay button
          - When on the ingenico page, press back
      
          The page is blocked and the button is disabled.
      
      Cause
      
          When clicking on Pay button, the page is locked and
          the button is disabled.
          With Chrome, when coming back to previous page,
          this one is regenerated and therefore adapt the button.
          In Safari, it is not the case.
      
      Solution
      
          On `pageshow` event, if event have `persisted` attribute set to
          to true, meaning using cache, then reload page.
      
      Fixes https://github.com/odoo/odoo/issues/69453
      
      
      
      opw-2510281
      
      closes odoo/odoo#70834
      
      X-original-commit: f2eb6d3c
      Signed-off-by: default avatarRomain Derie <rdeodoo@users.noreply.github.com>
      Signed-off-by: default avatarJérémy Kersten (jke) <jke@openerp.com>
      Signed-off-by: default avatarbon-odoo <nboulif@users.noreply.github.com>
      aa1e0711
  9. May 16, 2021
    • Nasreddin Boulif (bon)'s avatar
      [FIX] base_address_extended: split 'correctly' street name · 74116c98
      Nasreddin Boulif (bon) authored
      
      Issue
      
      	- Install "Contacts" & 'base_address_extended' modules
      	- Go to contacts and create a contact with value:
      	  - street name : Chaussee de Namur
      	  - House : 40
      	- Save and edit again
      	- Set country to 'Netherlands' then save.
      
      	Address not splited well (wrong values for street name and house).
      	The issue is not present in UI but is in tests.
      	(Issue in UI from odoo 14.0+)
      
      Cause
      
      	There is 2 '_split_street_with_params'
      	(inverse function that set street fields):
      	- partner_autocomplete_address_extended (removed in 14.0)
      	- base_address_extended
      
      	The 'spliting' logic is not the same in both function.
      
      	In UI, looks like it does not call '_split_street_with_params'
      	from 'base_address_extended' since no super(Partner, self)...
      
      	However in testing, it does call it from module
      	'base_address_extended' and therefore trigger the issue.
      
      Solution
      
      	Adapt _split_street_with_params function
      	(in 'base_address_extended' module):
      	If previous field (from 'street_format') to parse
      	in 'street_raw' is 'street_name', then:
      	- set `tmp` to: splitted (max 1 split) street_raw
      	  with current field seperator
      	- set `append_previous, sep, tmp[0]` to:
      	  splitted tmp[0] (first part of splited street_raw) with `rpartition(' ')`
      	- add 'append_previous' to 'street_name' value
      	- join 'tmp' values and set it to street
      	  (should equal to what left from `rpartition(' ')` split
      	  + seconf part of first normal split)
      	- continue normal parsing flow
      
      opw-2476096
      
      closes odoo/odoo#70783
      
      X-original-commit: d094d264
      Signed-off-by: default avatarbon-odoo <nboulif@users.noreply.github.com>
      74116c98
  10. May 17, 2021
    • Victor Feyens's avatar
      [FIX] *: update documentation links Following the recent reorganisation of the... · 598dda32
      Victor Feyens authored
      [FIX] *: update documentation links Following the recent reorganisation of the documentation in 12.0+, the majority of the documents have been moved and their old links are no longer valid. Some redirection rules will soon be deployed, but those rules might be dropped in some years and we want the links to still work, which is why we still replace the links to the new ones.
      
      FW-Port of odoo/odoo#70675 (13.0)
      
      closes odoo/odoo#70728
      
      X-original-commit: 85c24961
      Related: odoo/enterprise#18283
      Signed-off-by: default avatarVictor Feyens (vfe) <vfe@odoo.com>
      598dda32
  11. May 14, 2021
    • Laurent Smet's avatar
      [FIX] account: Fix corner cases of https://github.com/odoo/odoo/pull/70303 · 87f6a2fd
      Laurent Smet authored
      
      Original issue:
      Create a payment like follow:
      
      Payment type: receive money
      Partner type: customer
      Destination account: whatever receivable
      Amount: define an amount (i.e. 90.00)
      On Save, open the draft jounral entry created.
      Lower the liquidity or counterpart amount and add a writeoff
      Go back to the payment, change the amount and save.
      The journal entry writeoff will swap from debit to credit at every
      change made to the amount. This occur also when changing currency on the
      payment
      
      opw-2475223
      
      Otherwise, this fix is not covering all cases:
      inbound with write-off in debit
      inbound with write-off in credit
      outbound with write-off in debit
      outbound with write-off in credit
      
      closes odoo/odoo#70807
      
      Signed-off-by: default avatarLaurent Smet <smetl@users.noreply.github.com>
      87f6a2fd
  12. May 12, 2021
    • Adrien Widart's avatar
      [FIX] web: remove bottom border of first table raw · dc296afa
      Adrien Widart authored
      
      When using the boxed layout, if the business document has a table, its
      first row (after the table head) will have a bottom border and the last
      cell in the row has a white background.
      
      To reproduce the error:
      (Need timesheet_grid. Use demo data)
      1. In Settings > General Settings, Change Document Template:
          - Select the second template
      2. In Timesheets, select list view
      3. Select several lines
      4. Print > Timesheet Entries
      
      Error: In PDF, the first timesheet line has a bottom line and its last
      cell has a white background (instead of grey).
      
      The bottom line should only be applied on row in table header. The
      background color should also be applied on first row in table body.
      
      OPW-2478311
      
      closes odoo/odoo#70746
      
      X-original-commit: 88a10bdd
      Signed-off-by: default avatarAdrien Widart <adwid@users.noreply.github.com>
      dc296afa
    • Raphael Collet's avatar
      [FIX] base: error when no field to reflect · 5145c97f
      Raphael Collet authored
      
      We have observed that in some circumstances, there is no field to
      reflect on a given model.  Avoid an exception in that case.
      
      closes odoo/odoo#70774
      
      Signed-off-by: default avatarRaphael Collet (rco) <rco@openerp.com>
      5145c97f
  13. Apr 08, 2021
  14. May 14, 2021
  15. May 16, 2021
    • Pierre Masereel's avatar
      [FIX] point_of_sale: rounding issue with cash rounding · af5a88e8
      Pierre Masereel authored
      
      The method that computs what is due and the change of an order is based
      on the selected payment line which is wrong, because if you add and
      remove a payment line, none will be seleced, that lead to issue in this
      case because a change is computed, and it won't match the invoices
      because an amount_return is sent to server.
      
      To reproduce you can follow this simply procedure:
          - set rounding half-up to 0.05
          - create a product at 0.98
          - open POS and create an order with the product
          - go to payment screen
          - add cash payment (1€ auto filled)
          - add bank payment (It'll autofill -0.02 not really a problem)
          - remove the bank payment => It'll show 0.02 due (it is caused because of no payment method is selected)
          - Set a customer and check the invoice => unbalanced (0.02 probably because it is set in amount_return of the request)
      
      closes odoo/odoo#70825
      
      Signed-off-by: default avatarpimodoo <pimodoo@users.noreply.github.com>
      af5a88e8
    • Odoo Translation Bot's avatar
  16. May 14, 2021
  17. May 12, 2021
  18. May 11, 2021
  19. May 12, 2021
    • Romain Derie's avatar
      [FIX] product: correctly consider context key for display_name · 045c6ad3
      Romain Derie authored
      
      Regarding of the `display_default_code` context value, `display_name` is
      supposed to return the product code or not, eg:
      > product.display_name
      > '[FURN_6666] Acoustic Bloc Screens'
      > product.with_context(display_default_code=False).display_name
      > 'Acoustic Bloc Screens'
      
      But since the context was not considered when accessing this field, it would
      always return the cached value, which was set from the first time that field
      was read, with the `display_default_code` value used at that time.
      
      tl;dr: `display_name` was ignoring the context once cached.
      
      One of the critical issue was that internal code were displayed on the eshop
      cart (not the eshop itself), see `name_short`.
      
      task-2517830
      
      closes odoo/odoo#70727
      
      X-original-commit: b5b4d38a
      Signed-off-by: default avatarRaphael Collet (rco) <rco@openerp.com>
      Signed-off-by: default avatarRomain Derie <rdeodoo@users.noreply.github.com>
      045c6ad3
  20. Apr 27, 2021
  21. May 11, 2021
  22. May 12, 2021
Loading