Skip to content
Snippets Groups Projects
  1. Feb 09, 2023
  2. Feb 08, 2023
    • qsm-odoo's avatar
      [FIX] website, *: fix some components in case of contrasted boxed layout · 14c985af
      qsm-odoo authored
      *: website_slides
      
      In some cases, components had dark text over dark background (or light
      text over light background) by mistake.
      
      Example:
      - Enter edit mode.
      - In the theme tab, choose "boxed" as page layout.
      - A color picker appears below to control the color behind the box.
      - Set it to a dark color (if your box main color is light)
      - Go to a course page (install website_slides)
      - Check the mobile version
      => The bootstrap tab and its section uses the dark color you set up as
         body color instead of the expected boxed layout color.
      
      Another example:
      - Do the same thing (set up a dark color behind a boxed layout).
      - Go to a shop / product page.
      => The inputs are dark with dark text.
      
      This is because of bootstrap which uses `$body-bg` as default value for
      other variables, such as `$nav-tabs-link-active-bg` in the first case
      described above. It also uses the variable in the creation of CSS rules
      not controlled by explicit variables.
      
      In 16.0, bootstrap was updated to 5.1.3 with [1] and this actually
      increased the problem: input backgrounds now default to `$body-bg`,
      amongst other things. Since [2], `$body-bg` is also used as the default
      color for range thumbs.
      
      In previous versions, this fix focused on fixing a critical component:
      nav-tabs, for which the fix was straightforward.
      Starting from 16.0, this commit will fix everything at the small risk of
      changing the `$body-bg` variable meaning in the case of boxed layouts.
      Before this commit, its meaning was "the color used for the background
      behind the boxed layout (the <body> background color)", so equal to the
      Odoo value `o-color('body')`. After this commit, its meaning will be
      "the color used for the background of the box itself", so equal to
      `o-color('o-cc1-bg')`. The `<body>` background color will be forced by
      using `o-color('body')` as the value for the related *CSS* variable
      defined by bootstrap. This allows to have a correct CSS generation for
      all components in case of boxed layouts: indeed, the components mix
      their own color with `$body-bg` (or use it as it is) relying on the fact
      this is the color which appears behind them... which was not right in
      case of boxed layouts.
      
      This commit actually fixes another bug that was found during adaptation.
      It is 2-fold, and unfortunately, it does not make sense to fix one part
      without the other as it would increase the problem without the other
      part. The website_slides pages customize their default background color
      to not be the one chosen by the user, but a mix of it with some
      lightgray. Odoo default for the body being white, this makes it a
      lightgray for website_slides pages. This is totally ok... but only in
      "full" layout. In boxed layout, we have the 2-fold problem:
      
      A. The mixed color is not applied to the boxed layout but on the
         background behind the box. So if you have a white box above a black
         background, in website_slides pages you won't have the black
         background you expected to keep but a lighter version of it and the
         website_slides box will not use the lightgray but stay white
         (creating other inconsistencies as the lightgray would also be used
         by other components like tabs, for that app only).
      
      B. The mixed color is actually not mixing the right colors: it mixes
         the hardcoded lightgray with the color of the background behind the
         box, while it was intended to be the one of the content (the one of
         the box), like in "full" layout.
      
      The changes explained above about `$body-bg` naturally fixes (B). Not
      fixing (A) at the same time would result in a big change for the color
      which is behind the box. This commit fixes it at the same time by now
      applying the color to the right element. In previous version, this could
      be fixed as well but would require a different fix (not relying on
      `$body-bg`). So it makes sense to merge this first and backport+adapt.
      
      [1]: https://github.com/odoo/odoo/commit/971e5a91aab96d36129a823e03f1f9f1b1293968
      [2]: https://github.com/odoo/odoo/commit/46e53879749be7ba3d30338d0f25c0a68a88eb3c
      
      
      
      opw-3151962
      
      closes odoo/odoo#112136
      
      X-original-commit: 03f238aa
      Signed-off-by: default avatarRomain Derie (rde) <rde@odoo.com>
      Signed-off-by: default avatarQuentin Smetz (qsm) <qsm@odoo.com>
      14c985af
    • Nicolas Bayet's avatar
      [REF] web_editor: prevent concurrency issue in resetEditor · 02900593
      Nicolas Bayet authored
      
      The PR #105579 introduce the call of `setupCollaboration` in
      `resetEditor` but did not remove the instructions in `resetEditor`
      that will be called in `setupCollaboration`.
      
      `this._getNewPtp` should be called by `setupCollaboration` as it is
      called after an asynchronous call.
      
      Additionally, `this._peerToPeerLoading` has to be awaited to prevent
      concurrency issues.
      
      closes odoo/odoo#110150
      
      Signed-off-by: default avatarDavid Monjoie (dmo) <dmo@odoo.com>
      02900593
    • Guillaume (gdi)'s avatar
      [FIX] web_editor: prevent having wrong connectors when an icon change · 93eeaf53
      Guillaume (gdi) authored
      Steps to reproduce the bug:
      - Drop a block steps on a page
      - Change one of the icons
      - Change the color of the icon
      
      => The connectors are not correct anymore.
      
      This is due to [this commit] changing the tag `<i class="fa...` to a
      `<span class="fa...` when the user replaces an icon. The steps options
      assume that `<i/>` tags will remain `<i/>` tags (as it was before
      [this commit]). We should not change the tagName when changing the icon
      of an `<i/>` tag. This is likely to break (s)css, options, public
      widgets, ... This commit fixes this bug by ensuring that `<i/>` tags do
      not become `<span>` tags when replacing the icon. Moreover it allows not
      to recreate an editor when you change the icon.
      
      [this commit]: https://github.com/odoo/odoo/commit/7fd0698cf765a79959566b51e33cb76bff83d344
      
      
      
      task-3068834
      opw-3123850
      
      closes odoo/odoo#106316
      
      Signed-off-by: default avatarOutagant Mehdi (mou) <mou@odoo.com>
      93eeaf53
    • Nicolas Bayet's avatar
      [REM] web_editor: remove useless _shouldDelayBlur fix · 0dd9da02
      Nicolas Bayet authored
      
      The fix that introduced `this._shouldDelayBlur = true` in
      `openMediaDialog` was wrong as it was fixing a symptom rather than
      the source of the problem. Later fix probably fixed the source of the
      problem as the problem is not reproducible at the time of this commit.
      If the symptom comes back, it ought to be fixed at it's source.
      
      closes odoo/odoo#112216
      
      Signed-off-by: default avatarDavid Monjoie (dmo) <dmo@odoo.com>
      0dd9da02
    • Alvaro Fuentes's avatar
      [FIX] base: don't fail on empty groups attribute · 4379dce9
      Alvaro Fuentes authored
      
      In 15.0 this was supported. It may be also handy when editing views to
      momentarily set the groups to `""`.
      
      Steps to reproduce:
      1. Install Odoo 15 locally
      2. Edit or create a view with `groups=""` for some component
      3. Upgrade to 16.
      It fails.
      
      Empty groups was allowed in 15.0 we want to ensure this is not broken
      unintentionally anymore, such a new test was added.
      
      Muted logged to hide the warning (also present in 15.0):
      ```
      2023-02-08 11:09:18,697 506777 WARNING test_16_gr odoo.addons.base.models.ir_ui_view: The group '' defined in view does not exist!
      View error context:
      {'file': None,
       'line': 3,
       'name': 'foo',
       'view': ir.ui.view(242,),
       'view.model': 'res.partner',
       'view.parent': ir.ui.view(),
       'xmlid': ''}
       ```
      
      closes odoo/odoo#112062
      
      Signed-off-by: default avatarDenis Ledoux (dle) <dle@odoo.com>
      4379dce9
    • Laurent Smet's avatar
      [IMP] account: Remove 'move_id.state' dependency of _compute_amount_residual · 00aadcb6
      Laurent Smet authored
      
      The reconciliation fields of account.move.line should be independent of the move's state.
      
      closes odoo/odoo#111962
      
      Co-author: Habib (ayh) <ayh@odoo.com>
      Related: odoo/enterprise#36815
      Signed-off-by: default avatarBrice Bartoletti (bib) <bib@odoo.com>
      00aadcb6
    • Laurent Smet's avatar
      [FIX] account: revert commit f607572d · 63c9e9cf
      Laurent Smet authored
      This case of amls having a zero balance but an amount in foreign currency left is already managed by the new reconciliation in 16.0.
      Furthermore:
      -the test in POS is passing even with the revert
      -the reverted commit introduces a performance issue on amount_residual by forcing the orm to fetch the whole m2m debit/credit_matched_ids.
      -there is no test accounting-side depicting the issue (if there is really an issue fixed by the commit).
      
      Part-of: odoo/odoo#111962
      63c9e9cf
    • Gabriel de Paula Felix (gdpf)'s avatar
      [IMP] google calendar: auto accept meeting when only creator is attendee · 3fcadfd9
      Gabriel de Paula Felix (gdpf) authored
      
      Before this commit, when an event containing only the creator was created in Google Calendar, the creator's attendee status in Odoo was marked as 'needsAction'. Now, when an event like this is created (in Google Calendar), the event is automatically accepted in Odoo.
      
      A test was added to make sure that new events with only the creator are automatically accepted.
      
      closes odoo/odoo#112179
      
      Task: 2782961
      Related-to: #68700
      X-original-commit: 6d0ead3d73477614dc1bd97a95b695f80925fdd3
      Signed-off-by: default avatarArnaud Joset <arj@odoo.com>
      3fcadfd9
    • Florian Vranckx's avatar
      [FIX] http: no rotate sid for unidentified user · d5d80d17
      Florian Vranckx authored
      This commit fixes a change in behavior between 15.2 and 15.3.
      
      Previously, if an unidentified user tried to reach a route that had auth='user', it would simply redirect to the login page.
      
      Currently, it redirects and invalidates the session_id.
      
      This is an issue in the latest version of master after this PR https://github.com/odoo/enterprise/pull/36521
      
      
      This commit changes the route of service-worker.js to auth='user'.
      
      This route is called on the login page, which rotates the sid and therefore invalidates the csrf token. Making it impossible for a user to log in.
      
      This is a race condition, meaning it would only appear if the user stayed on the login page for a few seconds, hence why the automated testing did not block the commit.
      
      closes odoo/odoo#112169
      
      Signed-off-by: default avatarJulien Castiaux (juc) <juc@odoo.com>
      Co-authored-by: default avatarJulien Castiaux <juc@odoo.com>
      d5d80d17
    • niyasraphy's avatar
      [FIX] account: show inactive warning only when currency is set · 1937e495
      niyasraphy authored
      
      before this commit, in active currency warning is shown in the account move form when the currency_field is empty.
      
      after this commit, the inactive currency warning will be shown only if the currency is set and it is inactive.
      
      forwardported manually
      
      closes odoo/odoo#111863
      
      X-original-commit: 0bb74026
      Signed-off-by: default avatarBrice Bartoletti (bib) <bib@odoo.com>
      1937e495
    • pedrambiria's avatar
      [FIX] point_of_sale: skip synchronize journal entries in PoS · 890b685e
      pedrambiria authored
      The problem happens when the company is Angelo Saxon, and
      `l10n_eg_edi_eta` is installed. Also, the product should have a cost and
      automatic inventory valuation.
      https://github.com/odoo/odoo/commit/4b430f8e30efb15f06982e4673cd73531a2119b3
      
      
      The problem is that with this commit, after calling the
      `_set_next_sequence` function, it calls `flush_recordset`. It would cause
      a write to be triggered and add an Automatic Balancing Line. While in
      `_create_account_move` of PoS the stock output line will add later to it,
      and make it unbalanced. The first Automatic Balancing Line is incorrect as
      it will call `_create_stock_output_lines` later and it adds a line which
      makes it balance. But with that Automatic Balancing Line as it's
      unbalanced at the end it will call `_close_session_action` in PoS and
      shows a pop-up to add another line to make it balance.
      
      The solution is skip synchronize of journal entries.
      
      opw-3137723
      
      closes odoo/odoo#110956
      
      Signed-off-by: default avatarTrinh Jacky (trj) <trj@odoo.com>
      890b685e
    • Jorge Pinna Puissant's avatar
      [FIX] web: kanban view's quick create flickering · fa20b8de
      Jorge Pinna Puissant authored
      
      Before this commit, when creating a new record using the quick create on
      a kanban view, a flickering was visible. We can see the quick create
      form disappear, the record list goes up, the quick create form re-appear
      and the record list goes down again.
      
      This occurs because, the record list contains an empty record that is
      used on the quick create form. When clicking on the add button on the
      quick create form, this record is directly saved, and as is already on
      the list (the quick create form disappear and the record list goes up),
      only after this action, a new empty record is created and added to the
      list (the quick create form re-appear and the record list goes down
      again).
      
      Now, an empty record is created independently of the list, so when we
      click on the add button on the quick create form, the record is saved,
      a new empty record is created (the quick create form is emptied), and
      the saved record is added to the list (the record list got the new saved
      record), avoiding the flickering.
      
      task-id=3085247
      
      closes odoo/odoo#111818
      
      Signed-off-by: default avatarAaron Bohy (aab) <aab@odoo.com>
      fa20b8de
    • Nicolas Bayet's avatar
      [FIX] web_editor: set recovery connection to 3s · 43f6ea6c
      Nicolas Bayet authored
      When trying to recover peer to peer connection, the timeout of 500ms or
      1000ms might be too short and 15000ms in unnecessary too long.
      
      If the timeout is too short, it could remove the connection before the
      peer to peer had the time to reconnect to it. When we call
      `_recoverConnection` on `disconnect` in `oniceconnectionstatechange`
      or `onconnectionstatechange`, the signal `disconnect` does not
      necessarily mean that it will remain disconnected. Doing nothing could
      be enough to reconnect.
      (see: https://w3c.github.io/webrtc-pc/#dom-rtcicetransportstate-disconnected
      
      )
      
      closes odoo/odoo#112170
      
      X-original-commit: 3647374c
      Signed-off-by: default avatarDavid Monjoie (dmo) <dmo@odoo.com>
      43f6ea6c
    • Nicolas Bayet's avatar
      [FIX] web_editor: properly add iceCandidateBuffer · 376bc44b
      Nicolas Bayet authored
      Before this commit, the iceCandidateBuffer was emptied before finishing
      the loop. This is wrong as we must add all candidates from the buffer.
      
      X-original-commit: 520a8805
      Part-of: odoo/odoo#112170
      376bc44b
    • Chong Wang (cwg)'s avatar
      [FIX] core: avoid losing translations during module upgrade · 1e6e482a
      Chong Wang (cwg) authored
      
      Consider field F in module X with parameter translate=False, and F is
      overridden in module Y with parameter translate=True.  During the
      upgrade of module X, module Y hasn't been loaded yet, and the ORM
      considers the field to be `translate=False`.  Therefore it converts its
      database column from type jsonb to varchar, and accidentally drops
      non-en_US values:
      
          {"en_US": "English value", "fr_FR": "French value"} (jsonb)
              -> 'English value' (varchar)
      
      As a result, translations are lost after upgrade.
      
      This commit fixes the bug by checking whether the field is translated in
      database and patches the field accordingly when loading the registry.
      This avoids the ORM considering the field as non-translated while
      upgrading modules.
      
      In order to "force" translated fields to become non-translated ones, at
      the end of the loading process the patch above is discarded, and fields
      are checked again.  We then adapt the schema of models that have such
      fields.  This extra step handles the uninstallation of modules like
      module Y in the example above.
      
      The patching of the fields has one potential issue.  While upgrading
      module X, field F is patched with translate=True.  If module Y actually
      overrides F with translate=xml_translate or so, this may cause the
      behavior of the upgrade to be slightly incorrect.  Because of the
      complexity, we have chosen to not support this case.
      
      closes odoo/odoo#110572
      
      Signed-off-by: default avatarRaphael Collet <rco@odoo.com>
      Co-authored-by: default avatarRaphael Collet <rco@odoo.com>
      1e6e482a
    • Romain Derie's avatar
      [FIX] website: add website field in ir_asset list view · aa9805d4
      Romain Derie authored
      For some reason the `website_id` field was added in the form view of the
      `ir.asset` model in a website module overide but it was not done for the
      list view where it matters equally (if not most regarding the flow).
      
      Indeed, those views / this model is mainly accessed for debugging
      purpose in which case you are most likely looking for a specific asset.
      In the website case, it's most of the time to find the custom asset
      that was created following a scss customization in the right panel of
      the website builder.
      In such a case, it will have a website_id and will be easy to find in
      the list view.
      
      It's also the case for all the records having a `website_id`, we show
      that field in both form and list view, it's always important when
      managing / debugging DBs in multi-website environment.
      
      See [1] for introduction of `ir.asset`.
      
      [1]: https://github.com/odoo/odoo/commit/8cc066173dfb61bd95b8e1f0716f71f4e251810a
      
      
      
      closes odoo/odoo#112139
      
      X-original-commit: 1e6ea1a1
      Signed-off-by: default avatarQuentin Smetz (qsm) <qsm@odoo.com>
      aa9805d4
    • David Monnom (moda)'s avatar
      [FIX] pos_restaurant: giftcard and rewards · d5a64bb6
      David Monnom (moda) authored
      
      Previously, order lines containing gift cards or rewards disappeared when the order was closed and reopened in the pos_restaurant module
      
      The following adaptations have been applied:
      
      - Added a backend function in the pos_loyalty module to return active coupons (gift cards) to the frontend
      - Added a frontend function in the pos_loyalty module to remap coupon_id to couponPointChanges and order lines
      - Added this.partner in the init_from_json function in the pos_loyalty module to avoid deleting reward order lines
      
      Now, command lines don't disappear when switching from one command to another.
      
      closes odoo/odoo#111864
      
      Signed-off-by: default avatarTrinh Jacky (trj) <trj@odoo.com>
      d5a64bb6
    • Rob Coekaerts's avatar
      [IMP] hr: simplify and correct the default data · dcc8bbf0
      Rob Coekaerts authored
      
      Some changes were made to the default/demo/test data to be more
      consistent:
        - Duplicates of "Paid Time Off" time off types are consolidated into
          one type (inluding year specific versions, ig "Paid Time Off 2019"
        - Annual Time Off is renamed back to Paid Time Off (both for the
          work entry type as the time off type) to be consistent everywhere.
        - All mentions of years in work entry types and time off types have
          been removed, as this is no longer relevant with the new allocation
          rules.
        - Time off types in the default data have been explicitely made
          company agnostic, in order for them to be available to all companies
          and not just the one company that was select when installing
          hr_holidays. This was already the case for the be_payroll data, but
          not for the standard hr_holidays ones.
        - Various small cosmetic / functional fixes and simplifications
          (eg deduplication of data)
        - expense_other_input has been made country agnostic, in order for it
          to be available in all countries.
      
      task-2978513
      
      closes odoo/odoo#112173
      
      Related: odoo/enterprise#36796
      Signed-off-by: default avatarKevin Baptiste <kba@odoo.com>
      dcc8bbf0
    • MerlinGuillaume's avatar
      [FIX] spreadsheet,web: use dot or comma in date format · 5f17d897
      MerlinGuillaume authored
      
      Date fields are changing format if you type it in instead of using the
      date selector calendar popup
      
      Steps to reproduce:
      1. Install Time Off
      2. Open the current language and change the date format to `%d.%m.%Y`
      3. Go to Time Off > Approvals > Allocations
      4. Create a new allocation
      5. Change the validity period to 10.03.2023 (by typing it in, not using
         the datepicker) and click out of the field
      6. The date displayed is changed to 2010/03/20 or 20.03.2010 (if the
         datepicker was opened)
      
      Solution:
      Add dot and comma as a possible character for static format
      Also deduplicated function isValidStaticFormat so we have a single
      definition
      
      Problem:
      Formats using dots were not considered as valid static format so the
      value entered was parsed with the format `yyyy/MM/dd` instead
      
      opw-3081268
      
      closes odoo/odoo#111862
      
      Signed-off-by: default avatarRémi Rahir (rar) <rar@odoo.com>
      5f17d897
    • Pierre Paridans's avatar
      [FIX] web: oe_title + oe_avatar alignment in Form view · 45ebcbf3
      Pierre Paridans authored
      
      This commit fixes a broken selector when an avatar image (`.oe_avatar`)
      is used next to a title element (`.oe_title`) to put them side-by-side.
      
      Also it goes beyond that by ensuring the `.oe_title` element doesn't
      take the whole width (cf. max 75%) to make a visual distinction between
      it and the other form's fields, both in editable and non-editable form.
      
      In small screen, as space is limited, the whole width is kept to make it
      more userfriendly, only allowing a thin gap between the `.oe_title` and
      the `.oe_avatar`.
      
      Steps to reproduce:
      - Open Apps
      - Choose an App and, in the dropdown, click on Module Info
      => there is a huge gap at the top of the title
      
      closes odoo/odoo#110431
      
      Signed-off-by: default avatarAdrien Dieudonné (adr) <adr@odoo.com>
      45ebcbf3
    • Nicolas Bayet's avatar
      [FIX] web_editor: join peer to peer on focus in resetEditor · 12a4fbe1
      Nicolas Bayet authored
      
      The PR #110241 inadvertently re-introduce the attempt to connect
      in collaboration when the editor was reset. The attempt should only
      be made when the user focus on the editable.
      
      The line
      `this.$editable[0].addEventListener('focus', this._joinPeerToPeer);`
      in `resetEditor` will handle that case.
      
      closes odoo/odoo#112167
      
      Signed-off-by: default avatarDavid Monjoie (dmo) <dmo@odoo.com>
      12a4fbe1
    • Audric Onockx (auon)'s avatar
      [FIX] web: display "invite" button label on one line · fa258ab9
      Audric Onockx (auon) authored
      
      Settings > General Settings > Section Users:
      Button Invite behaves in a weird way.
      
      In dutch, e.g., "Nodig uit" splits into 2 lines,
      whereas it could expand, eating out a little bit of the
      input's space.
      
      closes odoo/odoo#112161
      
      Signed-off-by: default avatarJorge Pinna Puissant (jpp) <jpp@odoo.com>
      fa258ab9
    • Touati Djamel (otd)'s avatar
      [FIX] repair: prevent cancelling a completed repair order · d8fa6d0c
      Touati Djamel (otd) authored
      
      Steps to reproduce the bug:
      - Create a repair:
          - Add any product to repair
          - Add any other product as part of the repair
          - Confirm the repair
          - Start the repair
          - End repair
      
      Problem:
      The cancel button becomes visible and clicking on it won't cancel the
      moves, so it doesn't make sense to cancel a finished repair.
      
      opw-3146606
      
      closes odoo/odoo#112119
      
      X-original-commit: b21bbcef
      Signed-off-by: default avatarWilliam Henrotin (whe) <whe@odoo.com>
      Signed-off-by: default avatarDjamel Touati (otd) <otd@odoo.com>
      d8fa6d0c
    • lejeune quentin's avatar
      [FIX] hw_*: Modify the default user for iot in windows · 36c03128
      lejeune quentin authored
      
      currently there is an error in the configuration
      of the default user for the iot windows
      it is configured for "local service"
      which is the French version of the local user.
      Except if the pc window is not in French,
      the user is not configured correctly.
      We have to use the default local user name
      of windows which is "LOCALSERVICE"
      
      closes odoo/odoo#112129
      
      Signed-off-by: default avatarQuentin Lejeune (qle) <qle@odoo.com>
      36c03128
Loading