Skip to content
Snippets Groups Projects
  1. Feb 11, 2020
    • Raphael Collet's avatar
      [FIX] core: log import traceback in debug mode · 017e3d79
      Raphael Collet authored
      
      This is a followup of 1d553eea.
      
      Systematically logging import tracebacks can fill up log files, and
      waste disk space.  We therefore log those tracebacks in DEBUG mode, so
      that they can be activated only when needed.
      
      closes odoo/odoo#45049
      
      X-original-commit: fbecb15e
      Signed-off-by: default avatarRaphael Collet (rco) <rco@openerp.com>
      017e3d79
    • Wolfgang Taferner's avatar
      [FIX] stock: filtered related product_id field will overwrite on create · 1da687b6
      Wolfgang Taferner authored
      
      Assume a situation where you trigger a method which is going to create a
      nested picking with move_lines included and having a filter set which
      means that your context includes {'default_product_id': 20}
      
      {
       'location_dest_id': 9,
       'location_id': 19,
       'move_lines': [(0,
                       0,
                       {'location_dest_id': 1,
                        'location_id': 2,
                        'name': u'name',
                        'partner_id': 1,
                        'product_id': 10,
                        'product_uom': 1,
                        'product_uom_qty': 1.0})],
       'origin': u'Origin',
       'partner_id': 1,
       'picking_type_id': 59
      }
      
      Before the creation of the objects it will inject the default product in
      the top level of the dict which should create a picking with one or more
      move_lines.
      
      Based on this this injection will overwrite all product_id values of the
      created move lines as the picking is created last and the default value
      will write ALL move lines with this specific product from the context.
      
      closes odoo/odoo#44989
      
      X-original-commit: 05e957f0
      Signed-off-by: default avatarNicolas Martinelli (nim) <nim@odoo.com>
      1da687b6
  2. Feb 10, 2020
    • jvm-odoo's avatar
      [FIX] web_tour: fix too much tips on appswitcher · 5f0451c5
      jvm-odoo authored
      
      Issue
      
      	- Deactivate demo data
      	- Install several modules (e.g. Sales, Helpdesk)
      	- Go on Home
      	- Hard refresh
      
      	All tours' tips are shown
      
      Cause
      
      	In 02dab5dc, we wait the DOM to be ready.
      	The DOM wasn't ready in previous version, this is
      	why it seems to work.
      
      	As the DOM is ready, in check_for_tooltip we
      	have a visible trigger so trigerred = true
      	and the tip is activated.
      
      	If you activate the debug mode, the DOM is
      	not ready too, this is why it works fine
      	in debug mode.
      
      Solution
      
      	I don't think that not waiting the DOM to be
      	ready is good so I think we should keep that
      	and handle the case when we update the tours
      	from the _register method. So that, we use
      	the else part of the update method which
      	will break after a tip has been activated.
      
      OPW-2188525
      
      closes odoo/odoo#44630
      
      Signed-off-by: default avatarAaron Bohy (aab) <aab@odoo.com>
      5f0451c5
    • Goffin Simon's avatar
      [FIX] sale_management: No discount displayed in option products · 6de7d4f0
      Goffin Simon authored
      
      [FIRST ISSUE]
      
      Steps to reproduce the bug:
      
      - Create a pricelist PL with 50% reduction on all products.
      - Create a SO with PL
      - Add an optional product P
      
      Bug:
      
       The price is correct for P  but the discount displayed was 0%.
      
      [SECOND ISSUE]
      
      Steps to reproduce the bug:
      
      - Add the option line to the order
      
      Bug:
      
      A new line was create for P in the SO with the correct price but the discount was not displayed
      
      PS: The discount field on the model sale.order.option has been implemented to add a new discount
      to the displayed price unit of the option. But it has not been implemented to show the discount computed with
      the pricelist.
      
      opw:2186470
      
      closes odoo/odoo#44976
      
      X-original-commit: 21400337
      Signed-off-by: default avatarSimon Goffin (sig) <sig@openerp.com>
      6de7d4f0
  3. Feb 07, 2020
    • Julien Castiaux's avatar
      [FIX] web: attach the trad alert to the form · 2c67da42
      Julien Castiaux authored
      
      The translation alert dialog was attached to the entire view in case no
      status bar was found. This resulted in the following layout on large
      screens:
      
          chrome
          --------------------------------------
          | alert dialog | form view | chatter |
          |              |           |         |
          --------------------------------------
      
      Whereas when a status bar was set on the form view, the rendering was as
      follow:
      
          chrome
          --------------------------------------
          |        status bar        | chatter |
          |       alert dialog       |         |
          |        form view         |         |
          --------------------------------------
      
      The fix make sure the alert dialog is always placed just above the form
      view just like when there is a status bar.
      
      closes odoo/odoo#44860
      
      Task: 2075172
      X-original-commit: dacdc30681510e9c2db23610c5be5285a72a8949
      Signed-off-by: default avatarJulien Castiaux <Julien00859@users.noreply.github.com>
      2c67da42
    • Nicolas Martinelli's avatar
      [FIX] fields, product: search by pricelist · e1d7d790
      Nicolas Martinelli authored
      - Activate variants and pricelists
      - Go to Product > Products Variants
      - Search for anything on the 'Pricelist' filter
      
      A traceback is raised: 'Can only create cache keys from hashable
      values...'.
      
      This comes from the following change:
      
      https://github.com/odoo/odoo/blob/4b06fe19fa68255b7982d15e5847da2f6d6209fd/addons/web/static/src/js/views/control_panel/control_panel_model.js#L962
      
      
      
      It returns a list instead of a string. Since a list is not hashable, it
      causes the issue.
      
      There are not much solutions since the context key `pricelist` can be a
      `list` or an `int` (an ID). We force the cache key conversion to a tuple
      to avoid the `TypeError` and handle the `list` use case (which was
      broken on top of crashing).
      
      opw-2187757
      
      closes odoo/odoo#44775
      
      Signed-off-by: default avatarNicolas Martinelli (nim) <nim@odoo.com>
      e1d7d790
    • Andrea Grazioso (agr-odoo)'s avatar
      [FIX] account: fix invoice report total incorrect · 1558bb2a
      Andrea Grazioso (agr-odoo) authored
      
      Go to Accounting / Reporting / Management / Invoices
      Select Pivot view
      Add "Total" measure
      expand results adding "invoice #" and product
      
      Total will be incorrect because it is summing up the value reported from
      several lines of the query in which the total is taken as the invoice
      total, so it will display total * # lines.
      
      Using the price retrieved from the single lines fix the issue, but it
      needs to be converted according to the currency rate of the invoice.
      
      Moreover the test need to be modified because the amount_total variable
      of the report should NOT be the move amount_total but the amount from
      all the lines converted in company currency
      
      opw-2187369
      
      closes odoo/odoo#44654
      
      Signed-off-by: default avatarNicolas Martinelli (nim) <nim@odoo.com>
      1558bb2a
  4. Feb 10, 2020
    • snd's avatar
      [FIX] google_calendar: synchronization cron timeout · 03e25484
      snd authored
      
      In a database with many users / events to synchronize, the cron
      `ir_cron_sync_all_cals` may time out. Consequently, even if a `commit`
      is performed for each user, some users are never synchronized.
      
      In this commit, we first sort the users by last synchronization date,
      meaning that all users will ultimately be synchronized, even if the cron
      times out. On top of that, we introduce the context key
      `last_sync_hours` to prevent the synchronization in case the cron is
      restarted after timeout.
      
      opw-2158372
      
      closes odoo/odoo#45026
      
      X-original-commit: 2f21def6
      Signed-off-by: default avatarNicolas Martinelli (nim) <nim@odoo.com>
      Co-authored-by: default avatarNicolas Martinelli <nim@odoo.com>
      03e25484
    • Thibault Francois's avatar
      [FIX] mail: Don't create duplicate mail.notification · be06eb47
      Thibault Francois authored
      
      When more than one user are linked to the same res.partner and this user is assigned to a task or a sale.order
      as many email notifications will be created as there are users linked to the same res.partner.
      This won't send more than 1 email, but multiple mail.notification
      records will be created.
      This causes duplicate entries in the mail.notification table, and can
      crash when an old unique constraint is still present in that table (from
      earlier Odoo versions)
      
      To prevent this, we deduplicate the notifications and order by notification
      type to get 'email' first in case the user have different notification
      type ('email', 'inbox').
      
      How to reproduce:
         - Create a first user test1
         - Create a second user test2
         - Merge the contact test1 and test2
         - Create a customer customer
         - Set the user test1 as salesman
         - Create a new sale.order with customer as partner
      
      Add a test to reproduce the pathological scenario
      
      Solution
        add distinct on partner.id and order by partner.id,
      users.notification_type
      
      closes odoo/odoo#43862
      
      Signed-off-by: default avatarOlivier Dony (odo) <odo@openerp.com>
      be06eb47
    • Johan Demaret Rivarola's avatar
      [FIX] base: clear cache before read access check · e0112db4
      Johan Demaret Rivarola authored
      
      When reading binary content such as `image_128` on `res.users`,
      `AccessError` should be raised when necessary.
      
      Steps to reproduce:
        - Populate cache in superuser mode.
        - Access cached field with public user.
        - Read access is allowed but should not.
      
      Concrete example:
        - Unpublish `demo` user.
        - Access `/slides` with `public` user.
        - The template data is generated as `sudo`.
        - The same data is then accessed as `public`.
        - AccessError should be raised when requesting
          `/profile/avatar/<int:user_id>` but is not.
      
      Closes #43826
      
      Signed-off-by: default avatarChristophe Simonis <chs@odoo.com>
      e0112db4
    • Denis Ledoux's avatar
      [FIX] doc: typo in 398a3d7e · ba1acb26
      Denis Ledoux authored
      
      closes odoo/odoo#44969
      
      X-original-commit: eeb66d101ff212dbe0d51952aa7ebcd38546b461
      Signed-off-by: default avatarDenis Ledoux (dle) <dle@odoo.com>
      ba1acb26
    • Richard Mathot's avatar
      [FIX] models: ignore dependencies of fields inherited from custom fields · 2db0787d
      Richard Mathot authored
      
      When adding a custom field, the ORM also adds it to all the inherits'ed
      models, but with the state `base`, because those inherited fields are
      automatic (created by the ORM).  However, dependencies are enforced for
      `base` fields, while they can be ignored for `manual` ones.  This is a
      problem when a custom field is fucked up: its inherited fields will make
      the registry crash.
      
      We fix the issue by not enforcing dependency check on fields inherits'ed
      from custom fields.
      
      opw-2191114
      
      closes odoo/odoo#44966
      
      X-original-commit: 05ad62e4
      Signed-off-by: default avatarRaphael Collet (rco) <rco@openerp.com>
      2db0787d
  5. Jan 23, 2020
    • Gustavo Valverde's avatar
      [FIX] l10n_latam_invoice_document: Do not restrict additional use cases · 3b29b23e
      Gustavo Valverde authored
      
      If the account.move already has a `l10n_latam_document_number` set on it, the post() method should not try to consume a sequence again by any means. The validation filtering is also done with `l10n_latam_document_number` as this is the field which give the `account.move.name` the desired value; this makes a stronger validation while making it more flexible for other localizations which do not depend on the `account.move.name` to post an invoice.
      
      On vendor invoices it allows to manually assign a `l10n_latam_document_number` and posting it without needing an ir.sequence assigned to the specific consuming a sequence from ir.sequence (and it does not even need to have one) as the value is already in the account.move.
      
      **Context**: Not all latam localizations use the `l10n_latam_document_number` as the move `name`. This is basically for auditing purposes, as some countries (like Dominican Republic, Honduras, etc) do not always have **continuity** in their sequences, requiring to keep Odoo's base behavior on the move.name
      
      closes odoo/odoo#43850
      
      Signed-off-by: default avatarJosse Colpaert <jco@openerp.com>
      3b29b23e
  6. Feb 10, 2020
    • Romain Derie's avatar
      [FIX] website: delete page on cascade when deleting a website · ba6206ba
      Romain Derie authored
      
      The user is never able to delete a website, since there is at least one page,
      the homepage, which is bootstraped during website creation.
      From that point, even if nothing was done on that website, it was not possible
      to remove it.
      As website deletion is already a technical thing (debug mode), and since
      website.page do not make sense without their website, removing those on cascade
      will allow the user to remove a non-modified website.
      
      task-2092845
      
      closes odoo/odoo#44957
      
      Signed-off-by: default avatarRomain Derie <rdeodoo@users.noreply.github.com>
      ba6206ba
    • Romain Derie's avatar
      [FIX] website: prevent crash when 'force_website_id' has been deleted · 835d1201
      Romain Derie authored
      As an admin or website publisher, you have the possibility to switch website in
      the navbar. This will force a website in your session*.
      
      If this website is removed at some point, your session will be broken as the
      dispatch will lead to a traceback, trying to read un unexisting website.
      
      * There is other way to have the website forced in the session: theme install,
        go to website from settings, create website from settings..
      
      opw-2092845
      835d1201
  7. Feb 06, 2020
  8. Feb 10, 2020
  9. Feb 08, 2020
  10. Feb 07, 2020
  11. Feb 05, 2020
  12. Feb 09, 2020
  13. Feb 07, 2020
  14. Feb 03, 2020
  15. Feb 07, 2020
  16. Jan 30, 2020
  17. Feb 07, 2020
  18. Feb 06, 2020
Loading