Skip to content
Snippets Groups Projects
  1. Jan 12, 2021
    • Samuel Degueldre's avatar
      [FIX] web_editor: fix icons losing classes when modifying them · 3bb892cf
      Samuel Degueldre authored
      Previously, when double clicking and image, video, icon, or document in
      the web-editor and replacing it with a different media type, it would
      lose its custom classes. This means among other things, that it would
      lose margins and paddings from bootstrap classes, or in the case of the
      three columns snippet, that the new media would not be properly rounded
      in its top corner, or not show up at all in the case of the video. The
      only exception was when changing any media type to an icon, but in that
      case it would also keep some of the media-specific classes that are
      supposed to be removed (eg img-fluid or media_iframe_video).
      
      This commit fixes that as well as some _clear behaviour that didn't
      remove all classes that had to be removed, eg some fa-classes would
      linger depending on their order, and the o_image class from documents
      would always remain
      
      Part of https://github.com/odoo/odoo/pull/64234
      
      
      task-2282542
      
      closes odoo/odoo#64234
      
      X-original-commit: 99531f5d
      Signed-off-by: default avatarQuentin Smetz (qsm) <qsm@odoo.com>
      3bb892cf
    • Samuel Degueldre's avatar
      [FIX] web_editor: fix replacing media leaving unexpected elements · 398259c9
      Samuel Degueldre authored
      Previously, changing a media from a video/icon/document to a different
      type would leave empty elements in the DOM, this is because summernote's
      range API `range.insertNode` function deletes the content but not the
      structure (HTML elements).
      
      This commit fixes that by using jQuery's replaceWith method instead of
      summernote's insertNode when a media was found, and only using
      summernote in case no media was found (eg. a text range).
      
      Part of https://github.com/odoo/odoo/pull/64234
      
      X-original-commit: 63f80995
      398259c9
  2. Jan 08, 2021
  3. Jan 11, 2021
  4. Jan 08, 2021
    • wan's avatar
      [FIX] account: dashboard view cash statements · d9ab32fe
      wan authored
      
      Fine tuning of 78286851
      
      The link to view Cash Statements on the dashboard openned the wrong
      action.
      Also in some cases, removing the context key `search_default_journal`
      was not enough so we set it to `False` instead.
      
      closes #64118
      
      closes odoo/odoo#64279
      
      X-original-commit: 95ffa9fd
      Signed-off-by: default avataroco-odoo <oco-odoo@users.noreply.github.com>
      Signed-off-by: default avatarwan <william-andre@users.noreply.github.com>
      d9ab32fe
    • Goffin Simon's avatar
      [FIX] account: Bank account not selectable · 1febb882
      Goffin Simon authored
      
      Steps to reproduce the bug:
      
      An account with the type "Credit Card" can not be chosen for the
      creation
      of a journal with the type "Bank" as the domain for bank account filter
      only for accounts with the type "Bank and Cash"
      
      As the filter on the `user_type_id` is too restrictive we remove it in
      case the journal is bank or cash
      
      Bug:
      
      Impossible to select the correct account.
      
      opw-2394959
      
      closes odoo/odoo#64288
      
      X-original-commit: f4e67d8a
      Signed-off-by: default avataroco-odoo <oco-odoo@users.noreply.github.com>
      Signed-off-by: default avatarSimon Goffin (sig) <sig@openerp.com>
      1febb882
    • oco-odoo's avatar
      [FIX] account: reconcile models: create write-offs properly when matching a... · 237574c4
      oco-odoo authored
      [FIX] account: reconcile models: create write-offs properly when matching a statement line with no partner
      
      Before that, write-offs were simply never created in this case ; only an open balance. This was (obviously) wrong.
      
      Also, the partner set on the statement line was not modified, and kept empty. We fix that so that, when a statement line without is reconciled with lines sharing the same partner, this partner is also assigned to the statement line.
      
      Task 2423231
      
      closes odoo/odoo#64253
      
      Signed-off-by: default avatarLaurent Smet <smetl@users.noreply.github.com>
      237574c4
    • oco-odoo's avatar
      [FIX] account: reconciliation models: make auto_reconcile rules work properly with write-offs · d9c5c3e0
      oco-odoo authored
      - Create an invoice for 100
      - Create a bank statement for 95
      - Setup your reconciliation model so that it will match them and create a write-off for the remaining 5. Make it auto_reconciled.
      
      => Doing that, we expect the bank journal move to be created like this:
      
      - 100 on payable/receivable, reconciled with the invoice
      - 95 on the bank account
      - 5 on the write-off account
      
      This wasn't the case. Instead, Odoo created the following (correct from an accounting point of view, but weird):
      
      - 95 on payable/receivable, reconciled with the invoice
      - 5 on payable/receivable, not reconciled
      - 95 on the bank account
      - 5 on the write-off account
      
      => So an open balance of 5 was actually created. This was weird, and also caused an additional bug, as only the first payable/receivable line was reconciled with the invoice, making it only partially paid.
      
      This commit restores the expected behavior.
      d9c5c3e0
  5. Jan 10, 2021
  6. Jan 05, 2021
  7. Jan 08, 2021
    • nie's avatar
      [FIX] website: dynamic snippet products overflows on mobile · 6d64212f
      nie authored
      
      Steps:
      - Install eCommerce
      - Go to "Website" > "Go to Website"
      - Click Edit
      - Add the Dynamic Products block with a template and a category
      - Save
      - Switch to mobile view
      
      Bug:
      The right arrow of the block overflows and makes it possible to scroll
      the entire view sideways.
      
      Explanation:
      This commit puts back prev and next arrows onto the carousel. It also
      changes their design to be more visible over the content. The arrows are
      now smaller and displayed in clickable gray circles.
      
      opw:2415187
      
      closes odoo/odoo#64274
      
      X-original-commit: a5d7a1a6
      Signed-off-by: default avatarNicolas Lempereur (nle) <nle@odoo.com>
      Signed-off-by: default avatarbackspac <backspac@users.noreply.github.com>
      6d64212f
    • Olivier Dony's avatar
      [FIX] website: repair "overwrite" mode for translation wizard · 2ded8292
      Olivier Dony authored
      
      In the context of bug #43365, the fix merged in #48031 introduced an
      override of `ir.translation._load_module_terms()`, which calls `super()`
      then does some extra stuff.
      
      This was forward-ported to later versions, unfortunately the
      forward-ports missed the fact that the method signature changed at some
      point (circa saas-13.2) and the `overwrite` flag which used to be passed
      in the `context` had become an explicit method argument.
      
      As a result, that argument is lost in the `super()` call and the
      `website` module entirely disables the "overwrite" mode for the
      translation loading wizard.
      
      The fwd-port that seems to introduce the issue is odoo/odoo#50477 (998987f8ee148235f4025eb97a424e838ac6fc9f)
      
      closes odoo/odoo#64251
      
      X-original-commit: 26355a6b
      Signed-off-by: default avatarOlivier Dony (odo) <odo@openerp.com>
      2ded8292
    • Aurélien Warnon's avatar
      [IMP] crm[_sms]: align crm list view with "My Activities" view · 1f73a652
      Aurélien Warnon authored
      
      Some of the feature of the "My Activities" list view of the crm app were not
      available on the regular crm tree view.
      
      This commit aligns the 2 views by sharing these features, notably:
      - You can "snooze" your next activity if there is one
      - You can contact the lead by email with a direct button on the row/list header
      - You can contact the lead by sms with a direct button on the row/list header
      
      The "team_id" column is now optional="hide" since not required most of the time
      when you go to check your own leads (and can be activated in a few clicks if
      needed).
      
      Finally, the "Email" action at the end of the tree row is now in "single" mode
      to allow adding contacts on the fly. This implied re-introducing an action that
      was recently removed in 8c65d7c5
      Further demonstrating that R&D is just an eternal loop.
      
      UPG PR odoo/upgrade#2064
      Task-2390500
      
      closes odoo/odoo#62289
      
      Signed-off-by: default avatarThibault Delavallee (tde) <tde@openerp.com>
      1f73a652
    • Raphael Collet's avatar
      [FIX] core: avoid access error when flushing · 1e7659ad
      Raphael Collet authored
      
      This takes a former patch one step further.
      
      Assume you recompute a field on two records, and the computation assigns
      the first record but not the second one.  Before this patch, the
      recomputation process was accessing the field on both records.  When
      accessing the first record, both records are recomputed, and the value
      of the first one is found in cache.  When accessing the second record,
      no recomputation is made (it has been done already), and the cache is
      empty. The field is thus fetched from database, and this crashes because
      of insufficient access rights.
      
      This scenario was causing some obscure nondeterministic crashes in
      tests. The nondeterminism comes from the choice of the environment for
      flushing (it should not be in superuser mode); the order of records in
      the set to compute; the order in which records are assigned in the
      compute method; the fact that the compute method should assign some
      records and some not.
      
      The fix consists in adding a method that processes pending computations,
      without doing anything special for unassigned records.  The method is
      used in field accessors (__get__ and mapped) and in method recompute().
      The access error is gone because the recomputation no longer tries to
      get the value of a field to compute.
      
      closes odoo/odoo#64264
      
      X-original-commit: b7676ec3
      Signed-off-by: default avatarRaphael Collet (rco) <rco@openerp.com>
      1e7659ad
    • nie's avatar
      [FIX] portal: Due in %d days is not translated · ad59eff4
      nie authored
      Steps:
      - Install Invoicing and load French
      - Go to Invoicing
      - Click an invoice due in the future
      - Click Preview
      - Switch the preview to French by modifying the URL like this: example.com/my/invoices/6 -> example.com/fr_FR/my/invoices/6
      
      Bug:
      "Due in %d days" is still displayed in English. The rest of the page is in French.
      
      Explanation:
      This is due to two things:
      1. `mail` and `portal` are both installed and we cannot have more than one `code` translation of a source [1]. Since `mail` is loaded before, alphabetically, `portal` doesn't add the duplicated translations with its own module name. When loading a web page, only the modules returned by `_get_translation_frontend_modules_domain()` are sent to the frontend. `mail` is not one of them and the duplicated translations are not sent. Since sending all the `mail` translations is overkill, this commit is modifying the format string. This won't change the text outcome, but will make the new sources unique and make the backend send these translations to the frontend.
      2. Translations in `portal_sidebar.js` are queried before the translation DB [2] is made. This results in an empty array and `_t()` returns the source. `session.is_bound` will wait until the app is fully loaded before querying.
      
      [1] https://github.com/odoo/odoo/blob/ad2d96db8ad3e1fd7af2edda218fc34c0c1d259a/odoo/addons/base/models/ir_translation.py#L290
      [2] https://github.com/odoo/odoo/blob/0de069b8ca9fb005ba5b076984f5677de25889ee/addons/web/static/src/js/core/translation.js#L51
      
      
      
      opw:2421501
      
      closes odoo/odoo#64263
      
      X-original-commit: 118d79192cf0fc923a121745c78e6dd0da563df0
      Signed-off-by: default avatarbackspac <backspac@users.noreply.github.com>
      ad59eff4
    • Andrea Grazioso (agr-odoo)'s avatar
      [FIX] account: label for internal transfer · afed9f0d
      Andrea Grazioso (agr-odoo) authored
      
      Create two differnt journals for two different bank accounts (A, B).
      Create an Internal Transfer in bank A to send money, then reconcile.
      Create an Internal Transfer in bank B to receive money, then try to
      reconcile
      
      Internal transfers are labeled 'Customer Reimbursement' and 'Customer
      Payment' even if no external partner is involved in the process,
      
      opw-2423161
      
      closes odoo/odoo#64258
      
      X-original-commit: 4fcacfac
      Signed-off-by: default avataroco-odoo <oco-odoo@users.noreply.github.com>
      afed9f0d
  8. Jan 05, 2021
    • Laurent Smet's avatar
      [FIX] account: Allow sharing outstanding accounts on bank journals · 221e6da5
      Laurent Smet authored
      
      In the bank reconciliation widget, allow matching a payment (blue lines) owned by another bank journal as the statement line one if both journal are sharing the same outstanding account.
      It implies to remove the constraint preventing such accounts sharing.
      
      The purpose is the following.
      Suppose you are working with payment acquirers generating payments on a bank journal A.
      At the end of the month, the bank journal B is debited to pay the payment acquirer.
      At this point, you get a statement line on journal B you need to match with payments generated on A.
      
      closes odoo/odoo#64115
      
      X-original-commit: 8d34e160
      Related: odoo/enterprise#15577
      Signed-off-by: default avataroco-odoo <oco-odoo@users.noreply.github.com>
      Signed-off-by: default avatarLaurent Smet <smetl@users.noreply.github.com>
      221e6da5
  9. Jan 07, 2021
  10. Jan 04, 2021
  11. Jan 07, 2021
    • Achraf (abz)'s avatar
      [FIX] mail: send notification mail with right access link when using mail.thread · f5adb5b2
      Achraf (abz) authored
      
      PURPOSE
      
      Notification may be sent using a generic mail.thread record, notably when
      sending user notifications. In that case links to view document are
      incorrect.
      
      HOW TO REPRODUCE
      
      Issue
      
          - Install "Approvals"
          - Submit new approval with you as "Request Owner"
          - Click on "View Approval Request" in your mailbox
      
          The link redirects to a 505 error
      
      Cause
      
          The model is not the correct one and the res_id is undefined
      
      Solution
      
          Specify the model and the res_id to _notify_get_action_link
          when creating the link with kwargs
      
      SPECIFICATIONS
      
      Propagate message value through various notification sub methods. That way
      we can rely on them if model seems void.
      
      Also limit values given as URL parameters to some white listed values.
      
      LINKS
      
      opw-2358846
      Task ID-2379766
      Followup of odoo/odoo#60998
      Followup of odoo/odoo#61545
      Closes odoo/odoo#63292
      Closes odoo/enterprise#15585
      
      closes odoo/odoo#64229
      
      X-original-commit: 58bac5d242d6548d54f0163328fa64b319852e40
      Related: odoo/enterprise#15634
      Signed-off-by: default avatarThibault Delavallee (tde) <tde@openerp.com>
      Co-authored-by: default avatarAchraf Ben Azzouz <abz@odoo.com>
      Co-authored-by: default avatarThibault Delavallée <tde@odoo.com>
      f5adb5b2
  12. Jan 04, 2021
    • Nicolas Galler's avatar
      [FIX] stock: run scheduler actions as super user · f7ccadb3
      Nicolas Galler authored
      
      In `run_scheduler`, we are running certain functions as super user to
      avoid inter company and access rights issues.  This commit adds a
      `sudo()` call to the `action_assign()` call, in case some objects
      related to the retrieved moves are not accessible.
      
      In addition a commit call is moved up to apply after the
      `procure_orderpoint_confirm` call (as it was, it was applied after the
      `_action_assign` loop, but there is in fact already a commit in that
      loop, this lead to a somewhat random behavior where the replenish rules
      were sometimes rolled back and sometimes not, depending on whether the
      first iteration of the loop errored out or not)
      
      opw-2394706
      
      closes odoo/odoo#64041
      
      X-original-commit: 592ee14d
      Signed-off-by: default avatarNicolas Galler <ngaller@users.noreply.github.com>
      f7ccadb3
  13. Jan 07, 2021
    • mir-odoo's avatar
      [IMP] website: Use nolabel on visitor country_flag on tree view. · 57db30ba
      mir-odoo authored
      
      Before, there was no support of nolabel in tree view but now we
      added it.
      
      So in this commit, Replace the empty string with nolabel True.
      
      closes odoo/odoo#64212
      
      Taskid: 2414124
      X-original-commit: 4286f2f90258a5c1f97d42f7c2aee1e964723ca0
      Signed-off-by: default avatarYannick Tivisse (yti) <yti@odoo.com>
      57db30ba
    • qsm-odoo's avatar
      [IMP] web_editor: review image size display · 089ae3d2
      qsm-odoo authored
      
      Now the size is displayed in a badge in a better location.
      
      Also, the size is now always displayed even if the user did not just
      apply a modification (so that if the user saves then reopens edit mode
      and clicks on an image, he can inspect the image size).
      
      task-2424917
      
      closes odoo/odoo#64036
      
      Signed-off-by: default avatarQuentin Smetz (qsm) <qsm@odoo.com>
      089ae3d2
    • Christophe Simonis's avatar
      [FIX] core: check module state inconsistencies after `end` upgrade scripts · 8d5aaaa0
      Christophe Simonis authored
      Some modules may be removed by the upgrade scripts with the help of the
      ORM and are done in `end` scripts.
      This is the case for uninstalling the themes which use the `_theme_remove`
      method [1].
      
      [1] in 12.0: https://github.com/odoo/odoo/blob/e2084a4356f63249920d8c777e92f1710be8b5a6/addons/website_theme_install/models/ir_module_module.py#L337
      
      
      
      closes odoo/odoo#64219
      
      X-original-commit: e5ab5410
      Signed-off-by: default avatarXavier Dollé (xdo) <xdo@odoo.com>
      Signed-off-by: default avatarChristophe Simonis <chs@odoo.com>
      8d5aaaa0
    • Odoo's Mergebot's avatar
      [MERGE] crm: reorganize convert and merge tool methods · 448e0840
      Odoo's Mergebot authored
      
      PURPOSE
      
      Prepare sales team membership and lead assignment improvements by
      reorganizing and cleaning some code bits.
      
      SPECIFICATIONS
      
      Reorganize sales team tests to ease addition and modifications of tests
      when adding multi-membership and lead assignment features.
      
      Separate business methods from tool methods. It eases their discovering and
      their re-use through various other methods and models. Moreover it helps
      reading business oriented methods without being disturbed by tools.
      
      Tools methods should be private by default to indicate those are not part of
      official convert or merge API for leads. In this commit we make convert and
      merge tool methods private, keeping only main API methods public.
      
      LINKS
      
      Task ID-2428882
      Prepares Task ID-2086889
      COM PR odoo/odoo#64196
      ENT PT odoo/enterprise#15610
      
      Signed-off-by: default avatarThibault Delavallee (tde) <tde@openerp.com>
      448e0840
    • Thibault Delavallée's avatar
      [IMP] crm: make some internal methods private · fff19019
      Thibault Delavallée authored
      PURPOSE
      
      Prepare sales team membership and lead assignment improvements by
      reorganizing and cleaning some code bits.
      
      SPECIFICATIONS
      
      Tools methods should be private by default to indicate those are not part of
      official convert or merge API for leads. In this commit we make convert and
      merge tool methods private, keeping only main API methods public.
      
      LINKS
      
      Task ID-2428882
      Prepares Task ID-2086889
      COM PR odoo/odoo#64196
      ENT PT odoo/enterprise#15610
      fff19019
    • Thibault Delavallée's avatar
      [MOV] crm: reorganize convert / merge tool methods · 4819df90
      Thibault Delavallée authored
      PURPOSE
      
      Prepare sales team membership and lead assignment improvements by
      reorganizing and cleaning some code bits.
      
      SPECIFICATIONS
      
      Separate business methods from tool methods. It eases their discovering and
      their re-use through various other methods and models. Moreover it helps
      reading business oriented methods without being disturbed by tools.
      
      LINKS
      
      Task ID-2428882
      Prepares Task ID-2086889
      COM PR odoo/odoo#64196
      ENT PT odoo/enterprise#15610
      4819df90
    • Thibault Delavallée's avatar
      [MOV] sales_team: reorganize tests · 3e287843
      Thibault Delavallée authored
      PURPOSE
      
      Prepare sales team membership and lead assignment improvements by
      reorganizing and cleaning some code bits.
      
      SPECIFICATIONS
      
      Reorganize sales team tests to ease addition and modifications of tests
      when adding multi-membership and lead assignment features.
      
      LINKS
      
      Task ID-2428882
      Prepares Task ID-2086889
      COM PR odoo/odoo#64196
      ENT PT odoo/enterprise#15610
      3e287843
  14. Dec 23, 2020
  15. Jan 07, 2021
Loading