Commit Graph
165124 Commits
Author SHA1 Message Date
Sébastien Theys 7ea370fce7 [REF] mail, *: tests: refactor contains to further remove jQuery
* = account, base_iban, bus, calendar, crm_livechat, hr, hr_holidays,
    im_livechat, mrp, project, sms, snailmail, test_mail,
    test_mail_full, web, website_livechat, website_slides

Add support in `contains` for most operations that we use in tests.
Remove return value from `contains`.
Move into `web` module.
Remove import/export chains, directly import from correct module.

closes odoo/odoo#134652

Related: odoo/enterprise#47064
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2023-09-14 11:22:47 +00:00
Pierre Paridans ed7f4eb7db [IMP] web: remove unused legacy_dialog_mapping
task-3439226

closes odoo/odoo#134258

Related: odoo/enterprise#47349
Signed-off-by: Adrien Dieudonné (adr) <adr@odoo.com>
2023-09-14 11:22:43 +00:00
Chong Wang (cwg) 13957b6281 [FIX] core: support cr.execute_values
psycopg2.extras.execute_values was introduced in PR #101237
however it pypasses the override logic for cr.execute. As a result
1. --log-sql cannot log these queries
2. assertQueryCount cannot notice these queries
...

This commit create a new api cr.execute_values to support the same SQL feature
without losing the override logic for cr.execute

closes odoo/odoo#131190

Related: odoo/enterprise#47374
Signed-off-by: Rémy Voet (ryv) <ryv@odoo.com>
2023-09-14 11:22:42 +00:00
Adrien Widart (awt) 7ed1c1a074 [FIX] mrp: prevent from merging other products' SM
To reproduce the issue:
1. In Settings, enable:
   - Multi-Routes
2. Unarchive the route MTO
3. Create three storable product P1, P2, P3:
   - P2:
     - With route MTO
4. Create and confirm a MO:
   - Product: P1
   - Components:
     - 1 x P2
     - 1 x P3
     - 1 x P3
5. Set the produced/consumed quantities:
   - For P2, set 1.5
6. Mark the MO as done

Error: an error message is displayed: "Record does not exist or has
been deleted."

In `SM._action_done`, we create some extra moves:
https://github.com/odoo/odoo/blob/e029abe649573350e633999e42ab040c57b8fe4e/addons/stock/models/stock_move.py#L1705-L1710
Because of the exceed quantity on the first components line, we
create a new SM (qty 0.5). There is a difference between both SM:
the `procure_method` (MTO for the initial SM, MTS for the new one).
Because of that difference, when confirming the new SM, we don't
provide any `merge_into` (the `else` block):
https://github.com/odoo/odoo/blob/e029abe649573350e633999e42ab040c57b8fe4e/addons/stock/models/stock_move.py#L1684-L1690
Confirming the new SM leads to the `_merge_moves` method. In this
method, because we didn't provide any `merge_into`, we first try to
get some candidates:
https://github.com/odoo/odoo/blob/e029abe649573350e633999e42ab040c57b8fe4e/addons/stock/models/stock_move.py#L866-L868
And at that point, we will provide with all components SMs:
https://github.com/odoo/odoo/blob/e029abe649573350e633999e42ab040c57b8fe4e/addons/mrp/models/stock_move.py#L494-L497
So, we will also provide the two SM of C02. Therefore, the method
will merge these SMs and unlink the second one. Then, back to the
extra moves creation in `SM._action_done`, the for loop will iterate
on the deleted record, hence the error.

OPW-3454899

closes odoo/odoo#135305

X-original-commit: 2674851f66253efea19b86eb9d428dd6e85fa06d
Signed-off-by: William Henrotin (whe) <whe@odoo.com>
Signed-off-by: Adrien Widart (awt) <awt@odoo.com>
2023-09-14 09:57:50 +00:00
oco-odoo 3c55228015 [IMP] account: reports: auto-compute filter fields for single-purposed sections
When creating a new report and assigning a root report, the filter fields are recomputed to take the same values as the root report by default. This is done to avoid silly mistakes from the user ; for example, when configuring a tax report, forgetting to set the only_tax_exigible field.

However, nothing similar was done with the sections, and that was very error-prone. Indeed, when a report is created as a section of some other report, and not to be used in any other case, it would be convenient that the report's maker (be it a a developer or a UI user) does not have to care about all the nitty-gritty details of the default values assigned to filters. Taking the same example, what was there before this commit makes it so we could very easily face the situation where a tax report is made with multiple sections for its different annexes, and one of them is missing  a True value in the only_tax_exigible field (spoiler: this mistake happened on some development branch of ours).

To solve that, when we see a report only belongs to one single composite report, and if it's not callable alone (for this, we check the existent of an action opening it directly, or the presence of a root report fot it), then we compute a default value for the filter fields, using the composite report as source.

closes odoo/odoo#135259

Signed-off-by: John Laterre (jol) <jol@odoo.com>
2023-09-14 08:41:47 +00:00
Anh Thao Pham (pta) 1f26dd8222 [FIX] account: fix recompute of account_id on aml when changing partner
Steps to reproduce:
- Create an invoice
- Select a partner
- Add an invoice line (without a product): a default account will be computed
- Change the account
- Add a second invoice line (with a product)
- Change the account
- Select another partner
The account for the invoice line without a product will be recomputed, while
the account for the invoice line with a product will not.

The computation of the account should happen when the line is added.
If the account has been changed, it should not be recomputed to a default one
when changing the partner.
The behavior for aml without product should be the same than aml with a product.

opw-3474469

closes odoo/odoo#135411

X-original-commit: 2d5b4998e2b1c9111e7997b6174abf41dc2af02d
Signed-off-by: William André (wan) <wan@odoo.com>
Signed-off-by: Anh Thao Pham (pta) <pta@odoo.com>
2023-09-14 06:44:39 +00:00
Thomas Lefebvre (thle) 497e2296c7 [FIX] hr_holidays: create activity if leave has to be validated
Issue:
------
When a leave is created, a notification is only sent
if a "Time Off Officer" is defined (`responsible_ids`).

However, if we choose the approval option with
the value: "By Employee's Approver",
the leave manager must be notified even if
there is no "Time Off Officer".

Solution:
---------
Give the option of creating notifications in all cases where validation
is required for the leave type.

opw-3412841

closes odoo/odoo#135310

X-original-commit: 1428505b0aaf6a1d3cf778bdb6137bea9ec6283e
Signed-off-by: Sofie Gvaladze (sgv) <sgv@odoo.com>
Signed-off-by: Thomas Lefebvre (thle) <thle@odoo.com>
2023-09-14 05:38:52 +00:00
Saurabh Choraria efe41244b6 [FIX] auth_signup: update log while SignupError occurs
When a user tries to signup in odoo and enters an invalid email address
a logger error occurs which creates noise in sentry.

Error: SignupError('Login must be a valid email address : tme')

The logger is updated to use the 'warning' level instead of the 'error' level.
This change reflects a less severe logging level for cases when SignupError
occurs while signup.

sentry-3933777844

closes odoo/odoo#135343

X-original-commit: b59d0ef1568adc3296534f2dc5542afc02e04b1b
Signed-off-by: Achraf Ben Azzouz (abz) <abz@odoo.com>
Signed-off-by: Saurabh Choraria (sauc) <sauc@odoo.com>
2023-09-14 04:42:43 +00:00
Laurent Smet 4e74693384 [FIX] account: Fix typo in variable name
closes odoo/odoo#135401

X-original-commit: 8c3c1b05eb8663c02926beee6c321e37c96d820b
Signed-off-by: Habib Ayob (ayh) <ayh@odoo.com>
2023-09-13 18:42:34 +00:00
Didier (did) 023461cd06 [FIX] mail: fix composer render when switching chatter record
To reproduce this bug:

- Open a record with a chatter
- Open a composer (send message or log note)
- Change record using the pager
- Now, you cannot mention anyone

This is because the chatter component is reused and the `useComponent` hook isn't
refreshed with the new data.
This PR fix the issue by forcing a re-render of the composer when the `threadId`
changes. This refresh the `useComponent` hook used inside the `useSuggestion`
hook.

task-3502720

closes odoo/odoo#135331

X-original-commit: 28dd108294606499799e1fd2a7b24de23730d098
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2023-09-13 18:42:32 +00:00
tsm-odoo ed020e9889 [FIX] im_livechat: fix livechat service thread getter
The livechat service thread getter relies on the thread type to find
the current livechat thread. Since guest could have many channels it
is incomplete, the id should also be checked. This PR fixes this issue.

closes odoo/odoo#135378

Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2023-09-13 17:43:11 +00:00
Maryam Kia de8e25ce6c [FIX] mail: call hasAuthorClickable function since it's not a getter
closes odoo/odoo#135373

X-original-commit: f3d2fc33961a93d186a66f84f53cea8ce0c312b5
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2023-09-13 17:43:10 +00:00
Antoine (ande) 0a5bfb32d1 [FIX] website_sale: sale ribbon not saving
Current behaviour:
When editing a product, try to add a ribbon,
it will not save.

Steps to reproduce:
1. Go to website
2. Go to Shop
3. Click on Edit (top right)
4. Select any product
5. At Badge: Select Sale
6. (badge is visible)
7. Click on Save
8. (badge is gone)

Cause of the issue:
The element was not considered "dirty"

opw-3487397

closes odoo/odoo#135351

X-original-commit: 5d13fa522e7d06b03a098ada5fa6be15ddc49618
Signed-off-by: Antoine Vandevenne (anv) <anv@odoo.com>
Signed-off-by: Antoine Demany (ande) <ande@odoo.com>
2023-09-13 16:39:48 +00:00
tsm-odoo 0c84c4f36d [REV] im_livechat, mail: remove cors from discuss route overrides
This PR removes the livechat's discuss route overrides
that added `cors="*"` since they are not safe (different databases on our
cloud are considered as SameSite).

In the meantime, embed livechats won't work as expected since cors is
prevented and will be fixed in a following PR.

closes odoo/odoo#135260

Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2023-09-13 16:39:47 +00:00
niyasraphy 4c0d9c0b18 [FIX] l10n_in: remove duplicated function definition
before this commit, _compute_amount_total_words function
is defined twice in account and l10n_in module with a
difference of ',' in the generated amount word

after this commit, _compute_amount_total_words function
from l10n_in module is removed as there is no legal
need in india of having ',' in it

closes odoo/odoo#134892

Signed-off-by: Olivier Colson (oco) <oco@odoo.com>
2023-09-13 16:39:46 +00:00
hmai 573c59cad2 [FIX] web editor: animation triggered on every backspace
This commit fixes the issue of animations that got trigger by backspacing, pressing enter
and other causes

The cause of the issue was a custom historyRevert event that was only used to
trigger a widgets_start_request event which ended up restarting the options,
which lead to the animation option replaying the animation.

We were not able to pinpoint the use of this particular trigger_up as it does
not seem to serve any purpose anymore. Since its presence does create a bug, we
decided that the best course of action was to remove it. If this commit creates
a regression and the original bug comes back, we will reassess the situation.

Task-2752421

closes odoo/odoo#135332

X-original-commit: cef24b89405205ee0484555209e59a8599d9deb2
Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
2023-09-13 15:34:42 +00:00
Andrea Grazioso (agr-odoo) a7751c59db [FIX] base: traceback on pdf read error
Create a vendor bill with a specific attachment (on ticket)
Go to vendor bill list view
Select the created bill and another one
Print > Original Bills

Traceback due to unhandled ValueError on pdf read

opw-3498898

closes odoo/odoo#135320

X-original-commit: adf4c91f3f696ee849577e345d40e24d59d452f4
Signed-off-by: Julien Castiaux (juc) <juc@odoo.com>
Signed-off-by: Andrea Grazioso (agr) <agr@odoo.com>
2023-09-13 15:34:41 +00:00
FrancoisGe 2ee329f6ca [FIX] web: close button in form view dialog discard
The goal of this commit is to ensure that the form view dialog close
button performs the same behaviour as the discard button.

To enable this, we had to add the dialogData.dismiss, which lets you add
a callBack that will only be executed when a dialog is closed because of
the "x" or the "escape" shortcut.

closes odoo/odoo#135116

Related: odoo/enterprise#47283
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2023-09-13 15:34:40 +00:00
stefanorigano (SRI) 9aa16f4072 [FIX] web: o_search_panel margins
Slightly increase the component size and adapt its margin/padding in
order to accommodate more text.

Also, this commit addresses an issue that made [1] necessary.
Indeed `o_cursor_pointer` has been replaced by `cursor-pointer` in
commit [2], but the change wasn't applied on `o_search_panel`.

[1] https://github.com/odoo/odoo/commit/223b9e9
[2] https://github.com/odoo/odoo/commit/bd2a111

part of task-3326263
task-3476147

closes odoo/odoo#134817

X-original-commit: 4e82f72b481f69cde546bc6acfe22582b64b6bad
Signed-off-by: Pierre Paridans (app) <app@odoo.com>
2023-09-13 15:34:38 +00:00
Romeo Fragomeli 49aa4dcf30 [IMP] web: add target=download act_url action
This commit adds `target=download`, as `target=self` adds some unwanted
visual effect. In other words, the "block UI" is never unblocked when
some actions are triggered. This is specific for "Download" actions as
the download is correctly executed, but the page is never `unload`.
e.g.:
```python
action = {
    'type': 'ir.actions.act_url',
    'url': '/web_enterprise/partner/%d/vcard' % record.id,
    'target': 'self',
}
```

Note:
We can't use "'target': 'new'" as it creates a bug in Mobile Apps.
When The Mobile Apps create a new "Tab/Page", they do it in a new
sandboxed browsing environment, so the user isn't logged in and the
resource isn't accessible anymore.

Task ID: 3435131

closes odoo/odoo#134436

X-original-commit: 08db3deb3336f0c1ff9fe2703ebeb8ea5b5aeb3d
Related: odoo/documentation#5822
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2023-09-13 15:34:37 +00:00
Julien Carion (juca) 830206e894 [IMP] web: notification close delay improvement
This commit adds the functionality to refresh notifications when the user
hovers on them to reinitialize the close delay.

task-3444667

closes odoo/odoo#132713

Signed-off-by: Mathieu Duckerts-Antoine (dam) <dam@odoo.com>
2023-09-13 15:34:33 +00:00
Julien Carion (juca) ace86c47ed [IMP] web, mail: command palette improvements
This commit applies several modifications to the command palette:
- The list of menus for the current app is now hidden in the command
palette
- The assign user commands of the palette are now available in list
view when multi-edit is supported and a mechanism to avoid command
duplication has been implemented so that if several fields use the same
command, it will be displayed with an identifier in the palette and the
commands won't overlap
- The assign/unassign to me command is now split into assign to me and
unassign from me. The presence of the commands depends on whether they
would have an effect or not
- The "View switcher" command category is moved to second last position
of the command categories

task-3235223

closes odoo/odoo#129743

Related: odoo/enterprise#44620
Signed-off-by: Francois Georis (fge) <fge@odoo.com>
2023-09-13 15:34:31 +00:00
vlst 0d008f094c [IMP] point_of_sale, pos_adyen: Introduce WebSocket Communication
After a customer has paid via an Adyen terminal, the Adyen server sends
a request containing the payment confirmation to the webhook on the odoo
server.

At the moment, the pos frontend continuously polls the backend in order
to find out whether or not the confirmation from Adyen arrived.

This pattern is wasteful and over complicated.

In this PR I replace the polling logic with websockets communication.

closes odoo/odoo#125593

Task: 3342693
Signed-off-by: Joseph Caburnay (jcb) <jcb@odoo.com>
2023-09-13 15:34:29 +00:00
Julien Banken 95e6d0199b [FIX] web_editor: video selector component adjustments for Knowledge
This commit will apply the following changes:
1. Introduce a new `VideoIframe` component for the `VideoSelector`
   component. With that change, one can easily mock the `VideoIframe`
   component in a tour and replace the iframe of the video with
   alternative content. It will then be possible to test the whole video
   integration flow with a tour without relying on Third-Party services.
2. Enhance the Python video parser to include the video id and the video
   parameters of the url being parsed. These new information will be
   used for the new video behavior of Knowledge.
3. Call the callback function notifying that the video url has changed
   when the textarea is emptied (see: `selectMedia`).
4. Authorize non-internal users to call the /web_editor/video_url/data
   route. This will ensure that portal users will be able to integrate
   videos in their Knowledge articles.
5. Apply some minor UI and UX adjustments:
   - The label next to the toggle buttons will now be properly aligned.
   - The textarea to input the video url will be automatically focused.

task-3297215

closes odoo/odoo#127452

Related: odoo/enterprise#40683
Signed-off-by: Damien Abeloos (abd) <abd@odoo.com>
2023-09-13 15:34:27 +00:00
Jonathan Castillo (jcs) 1c5961ceed [IMP] website_blog, *: rename "Blogs" module to "Blog"
closes odoo/odoo#135307

Signed-off-by: Romain Derie (rde) <rde@odoo.com>
2023-09-13 13:49:39 +00:00
Xavier Morel 6177b04ce5 [FIX] core: remove unnecessary ast.unparse
Only available in Python 3.9, and for now at least Odoo remains
committed to supporting Python 3.8.

And it's not actually necessary: `literal_eval` supports ast node
input, because internally it just `ast.parse`s the input then
evaluates it, giving it an AST node just skips the parse step.

closes odoo/odoo#135302

Signed-off-by: Xavier Morel (xmo) <xmo@odoo.com>
2023-09-13 13:49:38 +00:00
hmai f567a8ef8a [FIX] web_editor: clear format button always visible
This commit makes the clear button of the toolbar always visible
even if no style is applied.

Since the display is controlled by the css, we removed the concerned
style.

Task-3459819

closes odoo/odoo#135293

X-original-commit: 78d3e1c327e81a1fddbe068860eeec498af29b89
Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
2023-09-13 13:49:37 +00:00
Rodolpho Lima d72e471e5f [FIX] web_editor: extra history step on image paste
Before this commit, when pasting or dropping an image, the insertion of
the image element to the DOM and the addition of the
"o_b64_image_to_save" class to it were recorded in two separate history
steps. This commit makes sure they are both recorded in a single step.

Additionally, the dataset was removed from the image element by the
(unnecessary) call to _prepareClipboardData. This resulted in losing the
file name information, which is useful when converting the image into an
attachment.

Before this commit, the "width: 100%" addition to the image's style
attribute had no effect, as it was later removed by the call to
_prepareClipboardData. In fact, the class "img-fluid" sets "max-width"
to 100% instead, which is offers desirable behaviour.

task-3497880

closes odoo/odoo#134832

Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
2023-09-13 13:49:36 +00:00
Chong Wang (cwg) 964d97358c [FIX] web: fix web translations
the comment 'openerp-web' has been deprecated since odoo/odoo#105589, and there
is only JAVASCRIPT_TRANSLATION_COMMENT in the most po files of the source code
repository

closes odoo/odoo#135277

X-original-commit: 4f84ea2be89f255846364c00a230463dce6ac773
Signed-off-by: Raphael Collet <rco@odoo.com>
Signed-off-by: Chong Wang (cwg) <cwg@odoo.com>
2023-09-13 12:19:10 +00:00
Chong Wang (cwg) f0efebee4d [FIX] core: fix typo for TranslationImporter
fix typo to log correct error message when the imported file is badly formatted

X-original-commit: 75606b0f92a26b64ee281792dfa32d47f135f46d
Part-of: odoo/odoo#135277
2023-09-13 12:19:10 +00:00
Chong Wang (cwg) 506d0cc4ec [FIX] core: fix cached translations
before this commit:
translations updated by `update_field_translation` api cannot be detected by
t-cache and some cached data whose model overrides `write` with an extra
'clear_caches()'

Step to reproduce:
- Create a mega menu, select any template, `Odoo Menu` for the example
- Install another language on the website
- Go to the translated version of your website and enter translate mode
- Change "Camera" in the mega menu to something else
- Save

The change won't be replicated, looking like it did nothing.
From there, removing or adding `edit_translations=1` in the URL will
use different cache version of the page's views and you will see the
outdated value on one and the correct on the other one.

after this commit:
`update_field_translation` will call `write`
it does the following 4 important things
1. mark field as modified
2. execute logics in the override `write` method
3. update write_date if needed to support t-cache

opw-3305117

X-original-commit: 2beb466668e4eb80d7c3ca3947445fb1cb141cff
Part-of: odoo/odoo#135277
2023-09-13 12:19:10 +00:00
Guillaume (guva) c71b571b68 [FIX] base: superuser on company creation
When creating a new company, SUPERUSER_ID is not added in `user_ids`.
Therefore, when installing a new module, the newly created company
is not in `self.env.companies`, which leads to an issue when
computing `company_id`.

Steps:

- Install Accounting module
- Create a new company with any localisation
- Delete the tax closing entry
- Try to install `stock_account` module
-> Error: `_check_company` failed

With this commit we add the company newly created to
the superuser's `company_ids`

opw-3488788

closes odoo/odoo#135276

X-original-commit: 771fdaf25eefdc30443e96b03b029346bebb50be
Signed-off-by: Guillaume Vanleynseele (guva) <guva@odoo.com>
2023-09-13 12:19:09 +00:00
Lucas Lefèvre (lul) 945b96378f [IMP] spreadsheet: update o_spreadsheet to latest version
https://github.com/odoo/o-spreadsheet/commit/5dfa942c [REL] 16.5.0-alpha.7
https://github.com/odoo/o-spreadsheet/commit/1bf08cca [REM] selection: removed `types/selection.ts` file Task: 3272931
https://github.com/odoo/o-spreadsheet/commit/e7d85184 [IMP] spreadsheet: add header grouping feature Task: 3272931
https://github.com/odoo/o-spreadsheet/commit/a498b5a6 [FIX] sheet: fix add/remove headers allowDispatch Task: 3272931
https://github.com/odoo/o-spreadsheet/commit/decbd467 [FIX] grid: keyboard context menu position Task: 3272931
https://github.com/odoo/o-spreadsheet/commit/be351a83 [REF] ot: simplify grid-dependant command transform Task: 3272931
https://github.com/odoo/o-spreadsheet/commit/e4a64149 [IMP] remove duplicate: add the remove duplicate functionality Task: 2984935
https://github.com/odoo/o-spreadsheet/commit/20600cda [IMP] commands: modify enum of CommandResult
https://github.com/odoo/o-spreadsheet/commit/4b1be76c [IMP] LineChart: cumulative chart
https://github.com/odoo/o-spreadsheet/commit/513ffcaf [FIX] SheetPlugin: Prevent deletion of all non-frozen headers Task: 3414127
https://github.com/odoo/o-spreadsheet/commit/cc408d7b [FIX] find_and_replace: remove useless tab index Task: /
https://github.com/odoo/o-spreadsheet/commit/34d34a19 [IMP] chart: use locale in chart labels/tooltips

closes odoo/odoo#135184

Related: odoo/enterprise#47343
Signed-off-by: Lucas Lefèvre (lul) <lul@odoo.com>
2023-09-13 12:19:08 +00:00
Morgane (morm) 4b111ad1e5 [FIX] web: fix listView text truncate on wrong cells
This commit fixes the text truncate that should not be applied on some of
the cells inside the `listView` (causing a dot next to graphical elements).

This issue was created by this commit (a6dd707).
The inline-block display of o_field_widget was the source of the issue.

We also changed the called mixin text-overflow to text-truncate for
cleaner code. The vertical align top is then removed, and we added a
vertical align middle to fix the wrong alignement of some elements.

Thoses modifications also fix the issue with where the tags were cut in
the `listView` when the window was smaller.

task-3455121
Related to task-3326263

closes odoo/odoo#134878

X-original-commit: 53f605399755f9355554c2582ea0f693c8f947b4
Signed-off-by: Pierre Paridans (app) <app@odoo.com>
2023-09-13 12:19:06 +00:00
stefanorigano (SRI)andBrieuc-brd 46dca09cc4 [FIX] web, crm, fleet, sale: font-weight
Establish a set of target font-weight values (may not directly match the
final result on screen).
Enable the system to naturally utilize the "bolder" font-weight.
Remove previous customizations designed for "Roboto" that clashed
with certain system-fonts.
Enforce the "normal" font-weight for icons, regardless by their parent
design.
Adapts some kanban titles.

closes odoo/odoo#134824

X-original-commit: 74fce06cad4000a3894757d4fef9074b64153b7b
Related: odoo/enterprise#47140
Signed-off-by: Pierre Paridans (app) <app@odoo.com>
Co-authored-by: Brieuc-brd <brd@odoo.com>
2023-09-13 12:19:04 +00:00
tsm-odoo 4775fedddf [FIX] im_livechat: fix history command
Before this commit, executing the `/history` command in a livechat
would do nothing. Indeed, the message was sent on the wrong target
through the bus so the history request was never received by the
visitor client. This commit fixes the issue by sending the notification
on the channel instead of the channel uuid.

closes odoo/odoo#135254

Signed-off-by: Didier Debondt (did) <did@odoo.com>
2023-09-13 10:55:53 +00:00
Loukas Wets (lowe) b512d5f0b6 [FIX] point_of_sale: New mobile order list display
Prior to this commit the displayed order information in the order list
was inconsistent. This commit rearranges the displayed information.

Task-3502304

closes odoo/odoo#134969

Signed-off-by: Joseph Caburnay (jcb) <jcb@odoo.com>
2023-09-13 10:55:51 +00:00
Pierre Paridans 7552284e78 [REF] web: replace jQuery UI Datepicker usage in Calendar view
This commit removes the jQuery UI Datepicker usage for the sidepanel's
mini-calendar in the Calendar View and replace it by our own
DateTimePicker component.

On the visual side, the styling has been aligned to the DateTimePicker
one and takes a bit more space to allow a better readability.

It also adds two props to the DateTimePicker:
- showWeekNumbers : allow to show or hide the week numbers' column, default to true.
- daysOfWeekFormat : allow to choose between the "short" or "narrow" (1
  letter) format for the week's days column header, default to "short".

task-3439226

closes odoo/odoo#134263

Related: odoo/enterprise#47114
Signed-off-by: Adrien Dieudonné (adr) <adr@odoo.com>
2023-09-13 10:55:49 +00:00
Harsh Modi 6a22ce9bde [FIX] pos_paytm: resolved issue of not receiving expected Paytm Error
Before this commit:
While using Paytm Terminal the expected behavior is to get an error
message from Paytm on payment failure but unexpectedly the cashier is getting
TypeError: this.env._t is not a function

After this commit:
The issue has been fixed, and the cashier will now receive the correct error
message from Paytm on payment failure

closes odoo/odoo#135258

Signed-off-by: Harsh Modi (hamo) <hamo@odoo.com>
2023-09-13 09:39:05 +00:00
Antoine Boonen 0b2ec2a39b [IMP] hr_expense: Don't hide taxes on hr.expense when product has cost
Problem
---------
In 15, taxes are hidden from hr.expense when the expense category has a
cost. They can however be configured and added. The current behaviour is
counter intuitive.

Objective
---------
Don't hide taxes when product has cost in v15.

Solution
---------
Remove the `hidden` attribute in the expense xml form as well as the
`groups` attribute.

task-3491868

closes odoo/odoo#135237

X-original-commit: 08405f0673fd19a8c278d095a141f53b935eb5f0
Signed-off-by: Quentin De Paoli <qdp@odoo.com>
Signed-off-by: Antoine Boonen (aboo) <aboo@odoo.com>
2023-09-13 09:39:03 +00:00
Andrea Grazioso (agr-odoo) 566b31c02a [FIX] sale_timesheet_margin: sale order line cost
Set Default UoM on Timesheet Settings page: Hours
Set [Employee] Timesheet Cost (HR Settings tab): 65.00/hour
Create a product [TEST] as follows:
- Product type: service
- Invoicing Policy: Based on Timesheets
- Create on Order: Project & Task
- Unit of Measure: Days
- Purchase UoM: Days
- Sales Price: 1.00
- Cost: 0.00
Create a sales order
Add an order line with product [TEST], quantity 1
Confirm. Project and task will be created
On the task add a 1 hour timesheet entry for [Employee]
Save and go back to the SO

Issue: SO line cost is incorrectly computed.

opw-3378688

closes odoo/odoo#135173

X-original-commit: dcf7b9fd7c5ae5653a368b9dc2219ce72818c6c1
Signed-off-by: Xavier Bol (xbo) <xbo@odoo.com>
Signed-off-by: Andrea Grazioso (agr) <agr@odoo.com>
2023-09-13 09:39:02 +00:00
Pierre Paridans a94d337b1a [REF] web: remove dependency on Bootstrap Collapse in OnboardingBanner
This commit removes the usage of Bootstrap's Collapse widget and replace
it by the `useTransition` hook when discarding an OnboardingBanner.

task-3439226

closes odoo/odoo#133917

Signed-off-by: Adrien Dieudonné (adr) <adr@odoo.com>
2023-09-13 09:39:00 +00:00
vlst a869ee87f2 [REF] pos: use reactivity in ClosingPopup
The "ClosingPopup" relies on an error-prone pattern of calling
a "handle" function on each input change.

In this commit we refactor it's logic such that the calculation
is done reactively. 

This leads to much simpler code.

In addition, we remove multiple pieces of dead code.

closes odoo/odoo#131171

Task: 3499250
Related: odoo/enterprise#47323
Signed-off-by: Joseph Caburnay (jcb) <jcb@odoo.com>
2023-09-13 09:38:58 +00:00
vlst f1dbd84e9d [FIX] point_of_sale: fix MoneyDetailsPopup
The MoneyDetailsPopup accepts the prop `total`. This popup is used to
keep track of the bills selected by the user and it's total should
thus simply be computed from the given bills information.

Passing the `total` prop and using it as `state` serves no purpose
and leads to bugs, such as the one addressed in this task.

Steps to reproduce:
1. Click on "Close Session".
2. Input a value in the "counted" field
3. Open the "MoneyDetailsPopup"
4. Observe the fact that the "Total" value is the one from the "counted"
   field, instead of "0".

This is caused because the `ClosePosPopup` has to also independently keep
track of this `total`, in order to be able to pass it to the
`MoneyDetailsPopup` on future calls.

In order to fix this problem from the root cause, we completely remove
the prop `total` and instead allow the popup to compute it from it's
information about the selected bills. This simplifies the code, preventing
future similar bugs.

Task: 3499242
Part-of: odoo/odoo#131171
2023-09-13 09:38:58 +00:00
vlst 60fb310696 [REF] point_of_sale: generic Input component
This PR introduces the generic `Input` component.
This component is meant to provide a "batteries included" api for working
with inputs. It is well suited to work as a `search bar` or as a `monetary input`.
It has no dependency on the pos app. It can then be used anywhere.

The `Input` component handles:
        - `debouncing`;
        - toggling between mobile and desktop views;
        - `autofocus`;
        - validation;

Example usage:
- As a search bar:
```xml
    <Input
        class="'ms-auto'"
        isSmall="ui.isSmall"
        placeholder="'Search products...'"
        icon="{type: 'fa', value: 'fa-search'}"
        callback.bind="(value) => pos.searchProductWord = value"
        debounceMillis="99"
    />
```
- As a monetary input:
```xml
    <Input
        icon="{type: 'string', value: pos.currency.symbol}"
        iconOnLeftSide="pos.currency.position === 'before'"
        isValid.bind="env.utils.isValidFloat"
        callback.bind="(value) => state.amount = value"
        autofocus="true"
        getRef="(ref) => this.inputRef = ref"
    />
```

In this pr we refactor the
    - `ProductsWidget`,
    - `CashMovePopup`,
    - `ClosePosPopup`,
    - `CashOpeningPopup`
components to use the
new `Input` component.

With the previous commit in which we introduced the `CategorySelector`
component and with the use of this new `Input`, the component
`ProductsWidgetControlPanel` was no longer needed and thus removed.

The use of the `Input` component allowed us to also remove the
error prone `useValidateCashInput` hook.

Task: 3459850
Part-of: odoo/odoo#131171
2023-09-13 09:38:58 +00:00
Denis Ledoux 67954c080e [FIX] sale: apply record rules on order cancellation subject and body
When rendering the sale order cancellation message,
the rendering should apply the current user record rules,
for instance the count of the partner sale orders should
match the count of what the salesman can see in his ui.
Otherwise he doesn't understand why he has a different count
in the UI and in the cancellation message.

In case you want the behavior of seeing all records
and not just the current salesman records only,
then you apply within the template itself the
`sudo()`.

Applying the `sudo` where you actually need it in the template,
and not computing the full subject/body as sudo,
offers more granularity.

closes odoo/odoo#135233

X-original-commit: 5d49a08f60b1f299784e2e983e87cdec178642c1
Signed-off-by: Denis Ledoux (dle) <dle@odoo.com>
2023-09-13 08:20:43 +00:00
FrancoisGe 87a4a85295 [FIX] web: relatedFields with column_invisible
Before to this commit, the activeFields of the fields in the x2many arch
were not merged with those of the relatedFields.

Problem:
When I have a custom x2many field that contains a many2one "x" field in its
relatedFields and this field is also present in the arch with column_invisible="True".
The field is considered invisible because its presence in relatedFields is ignored.

Solution:
Merge the field description in the arch with that in relatedFields.

Before:
Only the "id" of the many2one field is present in "web_read".

After:
The "id" and "display_name" of the many2one are present in "web_read".

closes odoo/odoo#135216

Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2023-09-13 08:20:41 +00:00
Aaron Bohy 93938cfdf3 [IMP] web,*: remove assets_backend_prod_only
This commit reworks a little bit the backend assets to remove a
bundle and thus save a call at webclient startup. The bundle
"assets_backend_prod_only" existed only to allow to add files in
production, but not in the tests (typically, the file that spawns
the webclient).

This commit introduces a new bundle "web.assets_web" that contains
"assets_backend" and the few files that we only want in production.
In the /web page, we now load "assets_web" instead of
"assets_backend" and "assets_backend_prod_only". In the /web/tests
page, we keep loading "assets_backend", which is now directly
included into "web.tests_assets".

For the sake of consistency, this commit also renames the dark
mode bundle "dark_mode_assets_backend" into "assets_web_dark".

closes odoo/odoo#135204

Related: odoo/enterprise#47316
Signed-off-by: Samuel Degueldre (sad) <sad@odoo.com>
2023-09-13 08:20:40 +00:00
Samuel Degueldre 4327c062d8 [REF] web, *: remove moment.js library
The moment.js library is officially done and no longer recommends its
use for new projects. As such, we have been progressively moving to
luxon instead. Until recently, we still had some libraries that depended
on it, and some leftover calls to it. This is no longer the case, and as
such, the library can be removed completely.

closes odoo/odoo#135182

Related: odoo/enterprise#47304
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2023-09-13 08:20:37 +00:00
abd-msyukyu-odoo 6b74a84e44 [FIX] crm: update progressbars after adding forecast column
Impacted versions:
16.3+

How to reproduce:
- open CRM > Forecast
- drag&drop a lead from a column to another
- click on "add next month" button

Current Behavior:
- the progressbars revert back to their state before the drag&drop

Expected Behavior:
- the progressbars keep their updated value after the drag&drop

Technical explanation:
After [1], the split of the progress bar logic from the relational model, only
notifying the model of a reload is not enough to correctly update the
progress bar values. It is therefore required to manually do it in the CRM
Forecast view after adding a column.

Master update:
Furthermore, after [2], the adaptation of the codebase to the new relational
model, the domain modification of the `forecast_kanban_model` was not
transcripted correctly: the domain modification for the fillTemporalPeriod
should be added by replacing the previous one if present, not simply added
(because then we have a constantly growing domain with contradictory leaves).

Also, since the new `RelationalModel` makes it mandatory to render the view
after a `DynamicGroupList.load` because `DynamicGroupList` is `Reactive`, to
avoid `progressBars` flickering when adding a forecast kanban column, the
`ProgressBarHook._updateProgressBar` should store the result of its
`read_progress_bar` call in `_pbCounts`. This makes it so that when the
`DynamicGroupList.load` is done, already computed progressBars will keep their
value and not switch back and forth between the previous state of `_pbCounts`
computed in `loadProgressBar`.

[1]: https://github.com/odoo/odoo/commit/58ca40b03215ef4c6c575267494dc8bccc30a033
[2]: https://github.com/odoo/odoo/commit/218ad8456a06503dd508e7216edcffdc90b35cac
task-3497579

closes odoo/odoo#135149

X-original-commit: b53b46ec36818615b7beb1d24fd44c9f8d69063a
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
Signed-off-by: Damien Abeloos (abd) <abd@odoo.com>
2023-09-13 08:20:36 +00:00