Commit Graph
159622 Commits
Author SHA1 Message Date
pedrambiria f5067bc472 [FIX] point_of_sale: show the promotion line for the refund
Before this commit: if you wanted to refund an order that contains a
promotion line, it did not show the promotion line to refund. The
problem was that, during the initialization of an order from JSON, it
calls `set_partner` and `set_pricelist`. It causes a call to
`_updateRewards()` inside the `pos_loyalty`, which will remove the
promotion line. But it doesn't need to update the rewards when it
creates the order object from JSON.

The solution is to prevent calling `set_partner` and `set_pricelist`
when it creates the order object from the JSON.

opw-3111578

closes odoo/odoo#116236

X-original-commit: a03fa619f1388fb8033128a44eeb5451ef150890
Signed-off-by: Trinh Jacky (trj) <trj@odoo.com>
Signed-off-by: Pedram Bi Ria (pebr) <pebr@odoo.com>
2023-03-23 09:06:59 +01:00
Jorge Pinna Puissant 04d5fb2255 [FIX] *: simplify concrete field API - remove update prop
Since [1], the update props is not used anymore in the field API. Some
utilization were missing in the refactoring.

[1]: https://github.com/odoo-dev/odoo/commit/b5db53b5df6403d2d9b57771854bc36aa5d83583

task-id 3241162

closes odoo/odoo#116229

X-original-commit: d212e46119a187452eb6c6d52b8592f28a633dd0
Related: odoo/enterprise#38579
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2023-03-23 09:06:52 +01:00
Corentin Thaon (thco) f130a37470 [FIX] account: state dependency _compute_amount
Reintroduction of the dependency on the state of the account.move for the _compute_amount method.

Some customers are experiencing problems following the migration to version 16. If they had draft 'account.move' before the migration, the 'amount_residual' field is set to 0 during the migration. When they validate the move after the migration, it goes directly to the paid status because the field is not recomputed.

opw-3182437
opw-3196490
opw-3229872

closes odoo/odoo#116180

X-original-commit: 3c7f6c3e39c05d7dfd24dd1b73f7bb3f19230f72
Signed-off-by: Laurent Smet <las@odoo.com>
2023-03-23 09:06:44 +01:00
Nicolas (vin) 783733cf33 [IMP] hr_expense: avoid adding wrong expense_line_ids
You cannot validate and expense report having expense_line_ids of
different payment mode.
But so far, it was possible to select these lines, and it would
be blocked upon saving.

We will improve this behavior by extending the domain on the
expense_line_ids field and disallowing to add lines that would lead to
an error later in the process.

It will also correctly handle the creation of new line via the expense
report form view, and add the paid by field as optional hidden in the
view in order to allow to find more easily the expense line that are
causing issues.

task id # 3221780

closes odoo/odoo#116077

X-original-commit: ec18bd414c831a9af67802dcd5d7181ef8d43049
Signed-off-by: Florian Gilbert (flg) <flg@odoo.com>
Signed-off-by: Nicolas Viseur (vin) <vin@odoo.com>
2023-03-23 08:01:08 +01:00
niyasraphy 7f2e9b852a [FIX] l10n_fr_pos_cert: 'account.bank.statement' object has no attribute 'state'
before this commit, in the code it is referenced
to non existing field state in account.bank.statement model
and thus it raise exception.

after this commit, the exception wont be raised and
validation error will be done based on the state field
state in account.bank.statement.line

closes odoo/odoo#115888

X-original-commit: ecdc3cb32bd96ecc859f385d3541eb2f5e4bad4d
Signed-off-by: Heinz Robin (rhe) <rhe@odoo.com>
Signed-off-by: Laurent Smet <las@odoo.com>
2023-03-22 23:56:08 +01:00
Alexandre Kühn d07f29613d [FIX] mail: emoji picker category selection should not cut emoji
closes odoo/odoo#116254

Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2023-03-22 21:47:49 +01:00
Alexandre Kühn 9f61697411 [FIX] mail: smaller follower subtype dialog
closes odoo/odoo#116251

Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2023-03-22 21:47:46 +01:00
Alexandre Kühn 8a2a7f2dd4 [FIX] mail: chatter takes whole width in marketing app
closes odoo/odoo#116249

Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2023-03-22 20:46:57 +01:00
Alexandre Kühn 5bc42ddc32 [FIX] mail: no member-list and settings buttons on folded chat window
They make sense when the chat window is unfolded,
as it changes the content. But when folded, the buttons have no
visible affect. Better hide them in that case.

closes odoo/odoo#116242

Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2023-03-22 19:44:44 +01:00
Alexandre Kühn d8c217363a [FIX] hr_holidays: proper im status alignment
closes odoo/odoo#116240

Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2023-03-22 18:09:08 +01:00
Aurélien Warnon baef8dee44 [FIX] survey: fix invite modal layout
This commit fixes a small issue in the survey invite modal layout.

The label and the associated field for the share link did not have a matching
attrs configuration, leading to an extra label which broke the form visually.

Oversight of 220e0271bf

Task-3203875

closes odoo/odoo#116234

X-original-commit: c68b56254005eb94ad90192e6cf8648866aca55d
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
Signed-off-by: Warnon Aurélien (awa) <awa@odoo.com>
2023-03-22 18:09:05 +01:00
Alexandre Kühn e9db06c106 [FIX] mail: use 24-hour format for squashed message timestamp
closes odoo/odoo#116216

Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2023-03-22 18:08:59 +01:00
tsm-odoo 7eab007771 [FIX] mail: do not allow click on message delete dialog
Since the discuss refactoring, clicks are not disabled in the message delete dialog.

This commit fixes the issue.

closes odoo/odoo#116215

Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2023-03-22 17:03:52 +01:00
Alexandre Kühn fb34115b81 [FIX] mail: less spacing in composer suggested recipient
closes odoo/odoo#116213

Signed-off-by: Louis Wicket (wil) <wil@odoo.com>
2023-03-22 17:03:49 +01:00
Audric Onockx (auon) fb59fa279a [MOV] project_{mrp,purchase,sms,hr_expense}: update files per model
In previous commit, we just copy/move the files.
In this commit, delete the part of each file
that is not related to its model, and some style.

task-3244226

closes odoo/odoo#116165

Signed-off-by: Xavier Bol (xbo) <xbo@odoo.com>
2023-03-22 17:03:46 +01:00
Audric Onockx (auon) 978037a74b [MOV] project_{mrp,purchase,sms,hr_expense}: copy/move files per model
In this commit, we just copy/move the files.
In next commit, delete the part of each file
that is not related to its model.

task-3244226

Part-of: odoo/odoo#116165
2023-03-22 17:03:46 +01:00
Alexandre Kühn 64f9693407 [IMP] mail: recent emoji in emoji picker
Task-2982627

closes odoo/odoo#116067

Signed-off-by: Louis Wicket (wil) <wil@odoo.com>
2023-03-22 17:03:42 +01:00
Joseph Caburnay 5460c87c7b [FIX] point_of_sale: remove unnecessary step in tour
The last step of PaymentScreenTotalDueWithOverPayment tour is not
really needed and it randomly breaks in runbot. Better to remove it.

closes odoo/odoo#115802

Signed-off-by: Trinh Jacky (trj) <trj@odoo.com>
2023-03-22 17:03:39 +01:00
Julien Banken c721e29acc [FIX] web: add safe check when reading parent property definition
When loading a view, the system will populate the related property field
with the values stored in the datapoint of the record. Currently, the
system does not do any safe check when reading those values. The system
can hence raise an error if the view does not load the record storing
the property definition of the current record.

This commit will fix that issue by adding a safe check when populating
the related property field with the values of the datapoint.

task-3218435

closes odoo/odoo#115100

Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2023-03-22 17:03:36 +01:00
Odoo's Mergebot 90ad9c46d4 [MOV] website_forum(_*): lint and reorganize module
PURPOSE

Reorganize website_forum module. This allows to better locate code, understand
organization, and prepare future changes.

SPECIFICATIONS

Split python files / model. It is easier to have a global view of a module
organization and content when looking at the models directory. Each model
now belongs to a single file.

Do the same with data, views.

Split templates by main usage. Files have been duplicated previously, they
are now cleaned to keep only content relevant to their usage. Split is done
according to
  * base file: layouts for main actions not specifically managed in other
    sub-files: display a forum, manage tags, post a new question or edit
    a question;
  * '_forum_all': 'all' page in multi-forum display, displaying the list of
    available forum;
  * '_layout': layouting templates. Modifications to global layout and forum
    specific page header used through all main templates;
  * '_moderation': moderation tools;
  * '_post': display a forum post;
  * '_tools': tooling and utility blocks, used as black boxes in various
    main templates;

Rename other files according to guidelines.

Reorganize main content of python code
  * group compute fields on top, order them following fields definition;
  * add section separators, to separate compute methods / CRUD methods /
    business methods / Mail methods / Tooling in file and have a way to
    sort a bit the code out;
  * rename compute methods to start with '_compute', to match guidelines
    and be coherent with global odoo naming;
  * perform some relining in fields definition, don't enforce any char
    length but try to stay aligned with Odoo apps;

Finally, provide some fixes or code improvements (batch, performance,
poorly written or named code) that are quick-wins.

LINKS

Task-3240082 (Forum: Reorganize and lint module)

closes odoo/odoo#114841

Related: odoo/upgrade#4456
Related: odoo/enterprise#38469
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2023-03-22 17:03:30 +01:00
Thibault Delavallée e33f28de85 [FIX] website_forum: fix website/forum count synchronization, rename field
Currently 'forums_count' field on website is not correctly updated. Test
introduced recently show that

  * at website create, counter is not computed;
  * at forum create, counter is not computed;

Only updating a forum active flag, website value, or unlinking it recomputes
the counters.

Note that manually updating counters is required as forum with False website
are global forum, valid for all websites.

Finally rename 'forums_count' into 'forum_count'. Fields in Odoo are rarely
plural (more like 'forum_ids' / 'forum_count' for example, even if in our
case the 2many does not exist due to shared behavior).

Task-3240082 (Forum: Reorganize and lint module)

Part-of: odoo/odoo#114841
2023-03-22 17:03:29 +01:00
Thibault Delavallée 64d5cc3899 [IMP] website_forum: add tests for website/forum count
Add tests for website.forums_count field that should be synchronized manually
with the actual number of forum. Seems it is not working as expected, as
the manual update is not done at forum creation, and the default seems not
correctly computed.

Those tests are therefore red without the upcoming fix.

Task-3240082 (Forum: Reorganize and lint module)

Part-of: odoo/odoo#114841
2023-03-22 17:03:29 +01:00
Thibault Delavallée 86dec3b0d2 [FIX] website_forum: fix missing translation
Gamification data used in some emails to add links and shortcuts is not
correctly translated. Let us fix it.

Task-3240082 (Forum: Reorganize and lint module)

Part-of: odoo/odoo#114841
2023-03-22 17:03:29 +01:00
Thibault Delavallée 24cb6d2caf [FIX] website_forum: use read_group to compute user statistics
Instead of doing 1 search_count / user in the loop, use read_group to fetch
data in batch.

Also remove an unnecessary import.

Task-3240082 (Forum: Reorganize and lint module)

Part-of: odoo/odoo#114841
2023-03-22 17:03:28 +01:00
Thibault Delavallée 0e089316cb [REF] website_forum: rename views according to guidelines
PURPOSE

Reorganize website_forum module. This allows to better locate code, understand
organization, and prepare future changes.

SPECIFICATIONS

Rename main views and actions according to guidelines. Having standardized
names eases process of finding and updating views.

Task-3240082 (Forum: Reorganize and lint module)

Part-of: odoo/odoo#114841
2023-03-22 17:03:28 +01:00
Thibault Delavallée 870a5d12e3 [FIX] website_forum: correctly translate default welcome message
Default value is currently not translated, which is sad. We therefore move
it into its own default method, use translation marks, and Markupize the
whole result.

Task-3240082 (Forum: Reorganize and lint module)

Part-of: odoo/odoo#114841
2023-03-22 17:03:28 +01:00
Thibault Delavallée 97929d53c8 [FIX] website_forum: improve forum FAQ display
Better have a correctly formatted content looking like all other HTML fields.
This is achieved by using sanitize parameter which cleans up html content
according to our standards.

Task-3240082 (Forum: Reorganize and lint module)

Part-of: odoo/odoo#114841
2023-03-22 17:03:26 +01:00
Thibault Delavallée 639f6195c2 [FIX] website_forum: avoid mutable as default method parameters
That is how you end up with funny results.

Task-3240082 (Forum: Reorganize and lint module)

Part-of: odoo/odoo#114841
2023-03-22 17:03:25 +01:00
Thibault Delavallée f8c2d84024 [FIX] website_forum: better string manipulation for tags
A strange manipulation is performed when trying to create tags. In this
commit we simply make styling happy by trying to first prepare data
(strip, content) then use it. Feature is untouched currently.

Task-3240082 (Forum: Reorganize and lint module)

Part-of: odoo/odoo#114841
2023-03-22 17:03:24 +01:00
Thibault Delavallée 112622db70 [FIX] website_forum: improve / cleanup computed fields
Notably add missing triggers for unstored fields depending on 'uid'.

Task-3240082 (Forum: Reorganize and lint module)

Part-of: odoo/odoo#114841
2023-03-22 17:03:24 +01:00
Thibault Delavallée 264f0dcb4e [REF] website_forum: reorganize tests
Mainly reorganize them alphabetically so that execution order matches the
definition order. It helps when debugging.

Also clean some tests from odoo/odoo@f9c2716b3e because they either test nothing
either are not understandable by standard humans. Other tests are left
untouched.

Task-3240082 (Forum: Reorganize and lint module)

Part-of: odoo/odoo#114841
2023-03-22 17:03:24 +01:00
Thibault Delavallée 45a5ecd08f [REF] website_forum: reorganize main python code, lint it quickly
PURPOSE

Reorganize website_forum module. This allows to better locate code, understand
organization, and prepare future changes.

SPECIFICATION

Reorganize main content of python code

  * group compute fields on top, order them following fields definition;
  * add section separators, to separate compute methods / CRUD methods /
    business methods / Mail methods / Tooling in file and have a way to
    sort a bit the code out;
  * rename compute methods to start with '_compute', to match guidelines
    and be coherent with global odoo naming;
  * perform some relining in fields definition, don't enforce any char
    length but try to stay aligned with Odoo apps;

Task-3240082 (Forum: Reorganize and lint module)

Part-of: odoo/odoo#114841
2023-03-22 17:03:24 +01:00
Thibault Delavallée 20565afc46 [REM] website_forum: remove dead view
'post_reply' template seems not used anywhere.

Task-3240082 (Forum: Reorganize and lint module)

Part-of: odoo/odoo#114841
2023-03-22 17:03:23 +01:00
Thibault Delavallée 11df1af102 [MOV] website_forum: rename remaining files
PURPOSE

Reorganize website_forum module. This allows to better locate code, understand
organization, and prepare future changes.

SPECIFICATIONS

Rename remaining files: controllers, sub-modules, tests, ...

Task-3240082 (Forum: Reorganize and lint module)

Part-of: odoo/odoo#114841
2023-03-22 17:03:23 +01:00
Thibault Delavallée 232f1dba23 [MOV] website_forum: split templates per main usage
PURPOSE

Reorganize website_forum module. This allows to better locate code, understand
organization, and prepare future changes.

SPECIFICATIONS

Split templates by main usage. Files have been duplicated previously, they
are now cleaned to keep only content relevant to their usage. Split is done
according to

  * base file: layouts for main actions not specifically managed in other
    sub-files: display a forum, manage tags, post a new question or edit
    a question;
  * '_forum_all': 'all' page in multi-forum display, displaying the list of
    available forum;
  * '_layout': layouting templates. Modifications to global layout and forum
    specific page header used through all main templates;
  * '_moderation': moderation tools;
  * '_post': display a forum post;
  * '_tools': tooling and utility blocks, used as black boxes in various
    main templates;

Task-3240082 (Forum: Reorganize and lint module)

Part-of: odoo/odoo#114841
2023-03-22 17:03:23 +01:00
Thibault Delavallée a66f6aae7a [MOV] website_forum: duplicate 'forum_forum_templates.xml', prepare split
Purpose is to try to keep history before splitting frontend templates into
separate files. We first copy the file, then remove extra content in each
of them. Let us see if this works.

Task-3240082 (Forum: Reorganize and lint module)

Part-of: odoo/odoo#114841
2023-03-22 17:03:23 +01:00
Thibault Delavallée 2ad0ed3add [MOV] website_forum: move, split and rename (backend) views
PURPOSE

Reorganize website_forum module. This allows to better locate code, understand
organization, and prepare future changes.

SPECIFICATIONS

Rename and split backend views / model. It allows an easier manipulation and
management.

Templates (frontend) files are renamed but not split. It requires a more
in-depth check of their content before splitting into sub-files (to have
tool templates separated from main templates notably). This will be done
in the next few commits.

Task-3240082 (Forum: Reorganize and lint module)

Part-of: odoo/odoo#114841
2023-03-22 17:03:22 +01:00
Thibault Delavallée 00a626deb8 [MOV] website_forum: move, split and rename data files
PURPOSE

Reorganize website_forum module. This allows to better locate code, understand
organization, and prepare future changes.

SPECIFICATIONS

Split data files / model. It is easier to have a global view of a module
organization and content. It also allows to see technical data impacted
by the module installation (like ir_actions, mail_message_subtypes, ...)

Task-3240082 (Forum: Reorganize and lint module)

Part-of: odoo/odoo#114841
2023-03-22 17:03:22 +01:00
Thibault Delavallée b7d8df8ff1 [MOV] website_forum: split models per model
PURPOSE

Reorganize website_forum module. This allows to better locate code, understand
organization, and prepare future changes.

SPECIFICATIONS

Split python files / model. It is easier to have a global view of a module
organization and content when looking at the models directory. Each model
now belongs to a single file.

Task-3240082 (Forum: Reorganize and lint module)

Part-of: odoo/odoo#114841
2023-03-22 17:03:22 +01:00
Thibault Delavallée 38bf03b255 [MOV] website_forum: duplicate 'forum.py', prepare models split
Purpose is to try to keep history before splitting models into separate files.
We first copy a file, then remove extra content in each of them. Let us see
if this works.

Task-3240082 (Forum: Reorganize and lint module)

Part-of: odoo/odoo#114841
2023-03-22 17:03:22 +01:00
Alexandre Kühn b84ee02e01 [FIX] mail: more readable placeholder in activity popopver
closes odoo/odoo#116210

Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2023-03-22 15:59:18 +01:00
Touati Djamel (otd) fe1443885a [FIX] mrp: print structure & cost BOM's of archived products
Steps to reproduce the bug:
- Create a storable Product “p1” with BoM:
    - Add a component and a byproduct:
- Archive “P1”
- Go to BOM Overview
- Filter -> see archived BoM
- Print BOM Structure

Problem:
A traceback is triggered,`ValueError:
Expected singleton:product.product()`

The `_match_all_variant_values` function is called but without the
product, while it takes at least one:
https://github.com/odoo/odoo/blob/15.0/addons/mrp/models/mrp_bom.py#L456
https://github.com/odoo/odoo/blob/15.0/addons/mrp/models/product.py#L286

The product must be set in the `_get_pdf_line` function, in our case,
the function does not receive it as an argument, so we have to get it
from the BOM, but as the `product variant` field has not been set in
the BOM, we should get it from the product_template:

https://github.com/odoo/odoo/blob/02cd750da6a79e6aa7104473fff2ab986b6e607c/addons/mrp/report/mrp_report_bom_structure.py#L378

The `product_variant_id` field is a non-stored compute field:
https://github.com/odoo/odoo/blob/34a2948d3d6e0f597c1b5d65f9f118e891c07cc4/addons/product/models/product_template.py#L133

And in the compute function, we use the first element of the
`product_variant_ids`: https://github.com/odoo/odoo/blob/34a2948d3d6e0f597c1b5d65f9f118e891c07cc4/addons/product/models/product_template.py#L177-L179

But it is a `Many2one` field, and for this type of field we have to add
`with_context(active_test=False)` to the ORM returns all records,
active or archived.

opw-3236421

closes odoo/odoo#116207

X-original-commit: fa10dd50397f83ad88380995a65c7d722825aee1
Signed-off-by: William Henrotin (whe) <whe@odoo.com>
2023-03-22 15:59:15 +01:00
Jinjiu Liu bdcf5b6c2a [FIX] account: don’t compute journal id if default value is set
Reproduction:
1. Go to settings -> Technical -> user-defined defaults, create a
default for sales type Journal for an account.move
2. Go to Accounting-> Customer -> payment, create a payment, and select
Bank for jounal
3. The payment method is not changed to Manual, in V15 it does

Reason: from Odoo 16.0, the method new is added to account_payment, and
we compute the journal id when it’s not set. However, this doesn’t
consider the case where we have a default value for journal_id.
Currently, when there’s a default value, we still compute the journal id
This causes the onchange, which uses record created by method new, is
not triggered when we select the journal id as the computed journal id,
e.g bank.

Fix: don’t compute journal id when there’s a default value for it

PR of adding the new method (big PR for 16): https://github.com/odoo/odoo/pull/96134

opw-3148919

closes odoo/odoo#116082

X-original-commit: 05aa0726529132df5733a3db61e4c3da1c037c1d
Signed-off-by: Cedric Snauwaert <csn@odoo.com>
Signed-off-by: Liu Jinjiu (jili) <jili@odoo.com>
2023-03-22 15:59:06 +01:00
Florian Charlier 02fb94aafb [FIX] gamification: set a working default user domain for challenges
Fix applied to ease user experience after the user_id field removal
for performance in 509b4cad.

This is a simple fix to allow users to have ready filters available
instead of having to enter them. This is especially helpful because,
for performance reason, when no domain is selected, no user will be
added, even though the widget on the webclient shows that all user
records are matched and will be added.

This is why [("active", "=", True)] is also added, allowing to simply
remove the "internal user" rule to really have all users if desired.

Task-3214005

closes odoo/odoo#116044

X-original-commit: 5a6e585e3294430126a9da3c7392942c91a9fffd
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2023-03-22 15:59:03 +01:00
Walid HANNICHE (waha) 5e54ac4ecc [FIX] stock: refresh forecast page
Steps to reproduce:
1. Inventory / Configuration / Warehouse Management / Warehouses
2. Need at least 2 warehouses
3. Inventory / Products / Products
4. Click forecasted quantity on a product that has some on hand
5. Click warehouse and select any option
6. Refresh the page
7. Error

Bug:
when refreshing the page the context gets cleared and productID lost
which leads to an error when looking for its bomIDS

Fix:
when refreshing the page get the productID from the url
also set the default title to "Forcasted Report"

opw-3217987

closes odoo/odoo#116198

X-original-commit: d49c73f95033472f1417ee05793d5f100f641dd0
Signed-off-by: William Henrotin (whe) <whe@odoo.com>
Signed-off-by: Walid Hanniche (waha) <waha@odoo.com>
2023-03-22 14:52:47 +01:00
Louis Wicket (wil) 10716e4837 [FIX] mail: allow accurate translation by providing full context
closes odoo/odoo#116195

Signed-off-by: Louis Wicket (wil) <wil@odoo.com>
2023-03-22 14:52:44 +01:00
Adrien Widart (awt) 02cdb9f754 [FIX] sale_stock: move never executed tests
Commit [1] adds some tests on Odoo 14.0 in a file named
`test_report`. However, from 15.0 on, the file has became
`test_sale_stock_report` but the tests of [1] have not been moved in
that new file . Instead, a new file `test_report` has been created
and did not have been added in `__init__` (see [2]). Therefore, the
tests are never executed

[1] 012e25f27ffc0bc51682c06896c9116944661011
[2] 15194cec233332e787b9f546e39c6127301ff9aa

closes odoo/odoo#116193

X-original-commit: 37f4e6fd596e9d180a1638e0b68b0393b7c817ff
Signed-off-by: William Henrotin (whe) <whe@odoo.com>
Signed-off-by: Adrien Widart <awt@odoo.com>
2023-03-22 14:52:42 +01:00
Alexandre Kühn 24c7cc856f [FIX] mail: no crash on call from another device
Before this commit, when in a call on another device
and then calling from another device, there might be
the following traceback:

```
TypeError: Cannot read properties of undefined (reading 'lastObservedRecords')
at ModelManager.removeListener
at RelationSet.delete
at RelationSet.clear
at ModelField._setRelationReplace
at ModelField.parseAndExecuteCommands
at ModelManager._update
at Listener.onChange
at ModelManager._notifyListenersInUpdateCycle
at ModelManager._flushUpdateCycle
at ModelManager.update
```

This is caused by removing a non-existent listener on a field, very
likely related to a relational field from the call being terminated.

This commit fixes the issue by silently skipping removal of listener
when it's undefined.

Task-3241562

closes odoo/odoo#116192

X-original-commit: 24af22187ce8401d925edb1dda02652f993c7394
Signed-off-by: Louis Wicket (wil) <wil@odoo.com>
2023-03-22 14:52:39 +01:00
std-odoo f42cdf1e23 [FIX] im_livechat: fix the session duration
Bug
===
The session duration added in the KPI have the wrong
value because of a typo in the SQL query.

Task-2827996

closes odoo/odoo#116169

X-original-commit: 1709c82f33e77f7482f323c4f86b2a8c4b6c5c0d
Signed-off-by: Warnon Aurélien (awa) <awa@odoo.com>
Signed-off-by: Stéphane Debauche (std) <std@odoo.com>
2023-03-22 14:52:33 +01:00
Joseph Caburnay 1adff226b7 [FIX] pos_hr: restore barcode scanning when multi employee is active
When refactoring the SelectCashierMixin into a hook, the "exclusive"
parameter was hardcoded to true, this makes it so that when
multi-employee per session is active, the cashier selector button in the
navbar takes exclusive control of the barcode reader and prevents
scanning products. The exclusive mode should only be active in the login
screen.

This commit fixes that by making "exclusive" configurable in the
useCashierSelector hook and making it non-exclusive in the navbar's
cashier selector.

closes odoo/odoo#116159

X-original-commit: d78e0b840a3fbcbe43bf2a4938977a63fbeec1e9
Signed-off-by: Samuel Degueldre <sad@odoo.com>
2023-03-22 14:52:30 +01:00