Commit Graph
160316 Commits
Author SHA1 Message Date
Renaud Thiry f7e5fd7aab [FIX] base: use html method from lxml
Prior to this change the convert tool did could mangle
the value of html fields when importing static data.

This is because html does not support 'self-closing'
except for HTML5 where it is allowed on void elements (such as img).

Browsers will assume that they are opening tags, left unclosed.
<span/> becomes <span>
They will then try to repair them with variying degrees of success.

Example where it fails:
`<t><t/></t><t><t/></t>`
should become
`<t><t></t></t><t><t></t></t>`
but it becomes
`<t><t></t><t><t></t></t>`

i.e. instead of closing the 'self-closing' tag immediately,
it puts everything inside a single t node

More concretely:
```
<t t-if>
  <t t-out />
</t>
<t t-else>
  <t t-out/>
</t>
```
becomes
```
<t t-if>
  <t t-out></t>
  <t t-else>
     <t t-out></t>
  </t>
</t>
```
which is invalid

-------------------------
The fix is simply to tell lxml that we want to print the xml nodes
as HTML nodes. This will make sure the output is compliant with
the standard and keep the semantic clear for the browser.

The issue does not appear before 16.2, as jquery used to fix it
for us until an update here 9c41ee5091ac06ac3ca71aeac607195c70061e4a

task-3162320

X-original-commit: 8ff2e1018264972107f19755ecda352d78dfa829
Part-of: odoo/odoo#118710
2023-04-17 11:47:11 +02:00
Renaud Thiry 5c146ec219 [FIX] mail: compute resource_ref
Before this, the resource_ref field is computed once in the default_get.
This means if the cache is invalidated, its value is unrecoverable.

Notably, the cache is invalidated when an attachment is generated
(triggering a commit).

So calling _generate_template could invalidate resource_ref,
which we use as a key to retrieve its result.

This results in a traceback for the user when trying to preview
a template where the first record hasn't yet generated its attachment.

As an example, trying to preview `Sales: Send Quotation`
on fresh installs.

task-3162320

X-original-commit: b4bd93c9b61736a7f41d70afe5db977a6e4b35e0
Part-of: odoo/odoo#118710
2023-04-17 11:47:11 +02:00
Renaud Thiry 20fe457377 [FIX] mail: set error_msg in template_preview
If the preview wizard was used to preview a template on a model that
has no record, error_msg would not be set.

This means the field is never set in that case and creating the wizard
results in a cache miss on that field.

The fix is to simply set it, and we add a test to cover that flow of
the wizard.

task-3162320

X-original-commit: 0976ce53e0a97a1f49dc2a262cf66355242fde25
Part-of: odoo/odoo#118710
2023-04-17 11:47:11 +02:00
paso-odoo 85ce80f029 [FIX] resource: external id not found in the system base.user_admin
If applied, this commit will solve the external id issue of the base admin user.

Before this commit:
==========================
When we delete the admin user (base.admin_user) and try to login with a new user
or try to write in a new user, this error will come.

After this commit:
===========================
The issue will be resolved after this commit and authorize new users without
any errors.

sentry - 3973828005
see - https://tinyurl.com/2jm772jm

closes odoo/odoo#118681

X-original-commit: 567027b4d4e3efdbbabab3a7a3c5e090df51dbf8
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2023-04-17 11:47:01 +02:00
Horacio Tellez b7332c016f [FIX] loyalty: rewards being reset to default upon save.
Before this commit when choosing the program rule type "Buy X get Y"
an error occured: after adding rewards and trying to save the record
the rewards were reset to the default value for program rules
of type "discount".

This ocurred because the program type was not being sent to the
`default_get` method of the `loyalty.reward` record.
After this commit rewards are correctly preserved.

opw - 3240558

closes odoo/odoo#118679

X-original-commit: 44b9eab482a219e6c260ef29512b8d6a595300ac
Signed-off-by: Victor Feyens (vfe) <vfe@odoo.com>
2023-04-17 11:46:59 +02:00
dasz 0a2b6d3abc [IMP] hr_contract: add working times menu
closes odoo/odoo#118509

Task: 3254679
Signed-off-by: Kevin Baptiste <kba@odoo.com>
2023-04-17 11:46:56 +02:00
Julien Van Roy 23760a53e1 [FIX] account_edi_ubl_cii: hide EDI section on journal
Section "Electronic Data Interchange" should not be displayed for
account_edi_ubl_cii since it's empty. In addition, only display the
section in account_edi if some EDI are compatibles.

closes odoo/odoo#117901

Related: odoo/upgrade#4525
Signed-off-by: Laurent Smet <las@odoo.com>
2023-04-17 11:46:47 +02:00
Benoit Socias f9c342374c [FIX] web_editor: allow aligning pictograms to the right in cards
When replacing an image by a pictogram inside columns, the pictogram
right-alignment is neutralised by the fact that the section of the card
inside the column spans over 100% width.

This commit makes pictograms in those sections rely on their auto width
instead - thus letting the right-alignment happen as expected.

Steps to reproduce:
- Drop a "Columns" block.
- Replace an image by a pictogram.
- Select the pictogram.
- Click on the "Float Right" icon in the toolbar.
=> Pictogram remained aligned to the left.

task-2841127

closes odoo/odoo#118684

X-original-commit: c3eae07259cb38656aa910ad98d0da04f4fc7edb
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
Signed-off-by: Benoit Socias (bso) <bso@odoo.com>
2023-04-17 10:34:32 +02:00
Benoit Socias 14bcdbc6f5 [FIX] web_editor: align image to the right
Align images to the right by using an auto left margin.

Steps to reproduce:
- Drop a "Columns" block.
- Select an image.
- Resize image to 50%.
- Align image to the right.
=> Image did not get aligned to the right.

task-2841127

X-original-commit: d2364278371828fa353c17d53fd266350aa2446b
Part-of: odoo/odoo#118684
2023-04-17 10:34:32 +02:00
Touati Djamel (otd) e3da10baf1 [FIX] purchase: fix test_supplier_list_in_product_with_multicompany
Install only the “purchase” module and run the test, it’ll always fail
since the product type is added in the stock module

Bug introduced in: https://github.com/odoo/odoo/pull/117956

Solution:
Use the consumable type instead

closes odoo/odoo#118672

X-original-commit: e155d91a906fabff02c0d34af51f874daebef909
Signed-off-by: William Henrotin (whe) <whe@odoo.com>
2023-04-17 09:28:06 +02:00
niyasraphy d289a59ab5 [FIX] transifex: update transifex project url
from april 3, the transifex has changed domain
from www.transifex.com to app.transifex.com

after this commit, the transifex project url
in the system parameter will be updated to
the new domain

closes odoo/odoo#118664

X-original-commit: c79164f6fad26f9838fee753436eb8fb763947ab
Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2023-04-17 09:28:03 +02:00
Sanket Brahmbhatt da513fa016 [FIX] point_of_sale: prevent trackback when changing journal in report.pos.order
This issue occurs when the user changes the Journal 'journal_id' in this
'report.pos.order' model then traceback will be generated.

Step to Produce:-
- In POS, Click on Reporting Menu > Order.
- Click on graph > Open any One record.
- Try To Change the Journal('journal_id').
- Trace-back will be generated.

sentry:- 3929247828

closes odoo/odoo#118660

X-original-commit: 87ed00e65ecaa22c559a43452c87d4f16e598f3f
Signed-off-by: Joseph Caburnay (jcb) <jcb@odoo.com>
2023-04-17 09:28:01 +02:00
Lucas LefèvreandAlexis Lacroix 7a1ae006eb [IMP] spreadsheet: update o_spreadsheet to latest version
https://github.com/odoo/o-spreadsheet/commit/6824b8a1 [REL] 16.3.0-alpha.4
https://github.com/odoo/o-spreadsheet/commit/9b911f61 [FIX] tests: fix indeterministic ui sheet
https://github.com/odoo/o-spreadsheet/commit/f20b7be5 [FIX] demo: Align font family with Odoo Task: 3269724
https://github.com/odoo/o-spreadsheet/commit/49a5ee0e [FIX] ColorPicker: Fix checkmark symbol Task: 3269724
https://github.com/odoo/o-spreadsheet/commit/4f2ecfec [REM] menu: remove icons on menu items
https://github.com/odoo/o-spreadsheet/commit/54fca81f [REF] *: rename 'menuItem' files to 'action' files
https://github.com/odoo/o-spreadsheet/commit/5c23e084 [REF] *: Change names of type 'MenuItem' to 'Action'
https://github.com/odoo/o-spreadsheet/commit/e5007fd1 [REF] replace xml tool bar in the xml top bar by menu item buttons
https://github.com/odoo/o-spreadsheet/commit/950abc45 [REF] menu registry: factorize menu registries by menu items
https://github.com/odoo/o-spreadsheet/commit/c02a7e96 [IMP] topbar menu: add icons for conditional menu items
https://github.com/odoo/o-spreadsheet/commit/a19d9cac [IMP] topbar menu: add icons for static menu items
https://github.com/odoo/o-spreadsheet/commit/7825124c [IMP] menu: replace right text icon by left icon
https://github.com/odoo/o-spreadsheet/commit/be3c3d6f [FIX] viewport: infinite loop with hidden headers
https://github.com/odoo/o-spreadsheet/commit/c05be1de [FIX] github: update release-action to latest version
https://github.com/odoo/o-spreadsheet/commit/9fdbdab2 [FIX] sheetview: correctly auto-size spreadsheet
https://github.com/odoo/o-spreadsheet/commit/7d18b589 [IMP] bottom_bar: hide add sheet button in readonly mode
https://github.com/odoo/o-spreadsheet/commit/108b89bd [FIX] menus: don't open submenu is not readonly
https://github.com/odoo/o-spreadsheet/commit/1edbc157 [FIX] top bar: remove useless "Save" menu item

closes odoo/odoo#118624

Related: odoo/enterprise#39801
Signed-off-by: Rémi Rahir (rar) <rar@odoo.com>
Co-authored-by: Alexis Lacroix <laa@odoo.com>
2023-04-17 09:27:58 +02:00
Archana Vaghasiya 91a6b3097b [FIX] point_of_sale: prevent creation of journals with existing id's
Error:'UniqueViolation duplicate key value violates unique constraint
account_journal_code_company_uniq.'

When we install the 'point_of_sale'  module it tries to create account journals
with existing id's due to which we face the above error.

This commit removes the portion of code that creates the account journal
with already existing id's.

sentry - 4062359900

closes odoo/odoo#118618

X-original-commit: 3c209e5c91e374dc7738df01f48e630a7fba5caf
Signed-off-by: Joseph Caburnay (jcb) <jcb@odoo.com>
2023-04-17 09:27:53 +02:00
Benoit Socias 95bb8dc0f8 [FIX] web_editor, website, *: make snippets name translatable
*: mass_mailing, website_blog, website_event, website_mail_group,
   website_mass_mailing, website_payment, website_sale, website_twitter

The names of snippet blocks are not translatable because their name is
obtained from a their template name which is not a translatable item.
For markets that use a non-latin alphabet this is a no go.

This commit makes it possible to specify a `string` attribute in the
`t-snippet` blocks that makes their name inventoried by the translation
process.

closes odoo/odoo#118530

X-original-commit: a501d226d8674ed0c9b183c69a9e754c79682237
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
Signed-off-by: Benoit Socias (bso) <bso@odoo.com>
2023-04-17 08:24:47 +02:00
william-andre fba1347784 [FIX] account: balance in GL on dashboard display
There were a few issues:
* we didn't always take the last statement as a reference: if we had
  two statement the same day, we needed to take the last one. Adding the
  `id` in the ORDER BY actually also improves the performances (4s to
  2.5s on the test database for all journals)
* If there is no statement, we didn't display the balance at all because
  `statement.first_line_index` is NULL, therefore the `>=` operator
  returned NULL and the condition was falsy

opw-3268956
opw-3269493
opw-3268950
opw-3270450
opw-3270143
and many more...

closes odoo/odoo#118368

X-original-commit: 5c4fb4cd15a371c0648ae4aee160f9f858b89445
Signed-off-by: Laurent Smet <las@odoo.com>
Signed-off-by: William André (wan) <wan@odoo.com>
2023-04-16 09:49:06 +02:00
Bastien Fafchamps (bafa) 9d8523be8c [FIX] web: Break too long customer names in kanban
Behaviour before PR:
In kanban view, the cards UI is broken when there are too long words
without spaces or breaks in the bottom half of the cards.

Desired behaviour after PR:
The words are broken so it fits in the cards without breaking the UI.

closes odoo/odoo#118659

Task: 3083665
X-original-commit: f7696bb31d7a15596892e16cc64e1ab3d6438aa4
Signed-off-by: Géry Debongnie <ged@odoo.com>
2023-04-14 19:45:55 +02:00
Alexandre Kühn 41e0543932 [FIX] mail: no crash on receiving link preview of non-known message
This notification makes sense when we know this message. If we don't
know it yet, then we should just ignore and receive data of link
preview when fetching the message.

closes odoo/odoo#118647

Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2023-04-14 19:45:52 +02:00
Soukéina Bojabza 544ead2b49 [FIX] website: reset a form properly for each submission success type
Before this commit, some behaviors of the forms after being submitted
were problematic:

- with the `On Success` option set on `Redirect`, when going back to a
form after submitting it (with the browser arrows), the fields were
still filled.
- with the `Show Message` option selected, when going in edit mode when
the message was displayed, the submit button was still "loading", even
after saving.

This commit solves this issues by properly resetting the form at each
start and restoring the submit button loading effect when the message is
displayed.

task-2798576

closes odoo/odoo#118645

X-original-commit: ecb3bda77fab512a9790daf58447058f250f49e6
Signed-off-by: Vray Benjamin (bvr) <bvr@odoo.com>
Signed-off-by: Bojabza Soukéina (sobo) <sobo@odoo.com>
2023-04-14 19:45:50 +02:00
Leonardo Pavan Rocha 823cbdf7e6 [IMP] calendar: rework quick create form view
This commit consists of a full rework of the quick create form in the calendar
view, so that it shows more options to the user rather than only the name of
the event. To accomplish this, we added a new attribute on the calendar view
with the id of the quick create form view to be used. This allows us to have
a custom view to be shown on quick create.

task-3129030

closes odoo/odoo#114827

Signed-off-by: Leonardo Pavan Rocha <lpr@odoo.com>
2023-04-14 18:43:34 +02:00
Andrea Grazioso (agr-odoo) 3e49f2bb57 [FIX] sale: sale order line quantity not rounded
Create a Field Service Task
Assing a customer, in Timesheet tab add a line with Hours Spent 00:20
Mark as Done
Sale Order will be created with a sale order line
Total of the line and Total of the order will not match

This occurs because the sale order line has been created with an
unrounded quantity of 0.333333

opw-3184468

closes odoo/odoo#118628

X-original-commit: ca72697042687e205fb288a97ec4717a97c89664
Related: odoo/enterprise#39799
Signed-off-by: Grazioso Andrea (agr) <agr@odoo.com>
2023-04-14 17:38:09 +02:00
Julien Castiaux cadd2a10d8 [REM] test_event_full,test_crm_full: disable perf tests
Disable performance tests from both tef and tcf.

Too many PR are blocked due to broken assertQueryCount, either there are
too many queries, either there are too few.

It is too much work to run all tests three times only to update a comment
with the final count (module alone + community + enterprise).

It is too hard to keep track of the hundreds queries to determine those
that moved, those that are missing and those that are new between two
branches. We have to apply tons of string-replace and sorts just to help
some diff tools (e.g. meld) into showing what changed.

Basically, except a few people, nobody care to do the investigation work
and just increase the query count (without changing the comments).

We tried for one year, now it is time to let those test go.

closes odoo/odoo#118614

X-original-commit: 353074fa1f362560737bb2905270ef4ae35e177e
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
Signed-off-by: Julien Castiaux (juc) <juc@odoo.com>
2023-04-14 17:38:04 +02:00
kais-odoo 69030e2066 [FIX] web: reduce width percentage field widget
before this commit, the 'service_upsell_threshold' field input was too wide.

In this commit, add scss for widget percentage to reduce the width of the
field.

task-3128541

closes odoo/odoo#118589

X-original-commit: 14dddaba34a463d81bf8120fba034ce5f022ad0c
Signed-off-by: Adrien Dieudonné (adr) <adr@odoo.com>
Signed-off-by: Xavier Bol (xbo) <xbo@odoo.com>
2023-04-14 17:37:58 +02:00
Kartik Chavda 96bc30f6cc [IMP] web: improve alignment of button in notification
Before this commit button in notification are not aligned with
other content of notification reason it is not aligned because
all buttons have padding in their surrounding and because of
starting padding on button it is not align with others.

This commit add ps-0 to remove starting padding and align
notification button with other content.

task-3117332

closes odoo/odoo#118145

Related: odoo/enterprise#36540
Signed-off-by: Xavier Bol (xbo) <xbo@odoo.com>
2023-04-14 17:37:55 +02:00
Bruno Boi 2772dae476 [FIX] web: fix traceback in useDynamicPlaceholder
**Before this commit**
Since 394f85c954f anytime this hook opens a popover, a traceback occurs.
It is due to the fact this hook passes a callback as a
getter-only property to the usePopover hook options.
The traceback occur because the usePopover
hook has to reassign this  option (onClose callback).

**After this commit**
Fixed and tested.

closes odoo/odoo#118580

Signed-off-by: Michaël Mattiello <mcm@odoo.com>
2023-04-14 16:33:49 +02:00
Arthur Detroux (ard) 4c928c46ea [FIX] website: remove 'properties' type field from website form
Commit [1], [2] and [3] added `Properties` type fields on (respectively)
project.task, helpdesk.ticket and crm.lead. Unfortunately, those fields
are not currently supported by the Website Form snippet. Selecting the
"Properties" field while editing a form related to one of these model
will lead to a crash as no definition for how the field is supposed to
render is present in the current code base.

(Note that no logic for how options should behave if such field is
selected is present either.)

Therefore, this commit removes this specific type of field from being
present in the "Existing Fields" section of the Website Form Field
editor.

Steps to reproduce:
 - Install website and project
 - Go to Website and start edit mode
 - Drop a form snippet
 - Click on the form snippet and select "Create a task" as an Action
 - Click on an existing field or add one
 - Select "Properties" as the field type
 => Traceback (QWeb render error)

[1]: https://github.com/odoo/odoo/commit/2f244769cbb1512875ae197aa8adc3efd34fd54b
[2]: https://github.com/odoo/odoo/commit/8de9f4c4777481142063f75d4cd3cef47948714b
[3]: https://github.com/odoo/odoo/commit/4722cc4b1fb027b7b9d731c3b206656588071360

opw-3240395

closes odoo/odoo#118597

X-original-commit: 078f879444e5c2655f80ee572156ac663c0e4abb
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2023-04-14 15:06:07 +02:00
Nshimiyimana SénaandLaurent Smet 586b72e0c9 [FIX] account: fix interaction between early payment discount and intra-community taxes
Bug:
Currently, creating an intra-community bill and reconciling it with an
early payment can break the tax report.

Steps to reproduce:
1. install the Austrian localization (l10n_at)
2. set `Cash Discount Tax Reduction` to `On early payment`
3. create a €1000 intra-community bill (you can just use the tax called
   `IGE 20%`)
4. set the payment term to`2/7 Net 30` and confirm
5. reconcile the bill with a payment within the discount period
   (2% discount: €980).
6. check the Tax Report: line 5.4 of the report should be €196. If you
   reconciled the bill with a back statement directly, sections
   `Innergemeinschaftliche Erwerb` and `Bemessungsgrundlage` will be
   wrong as well.

Cause:
Since the intra-community applies here, the bill will produce two tax
lines. And because `Cash Discount Tax Reduction` is set to `On early
payment`, those two tax lines will be reduced when an early payment is
made.
However, because of the way the `is_refund` property of
`account.move.line` field is computed on moves of type `entry`, one of
those *tax reduction line* will be considered a refund and the other
will not. Furthermore, the computed tags are correct only because the taxes
are recomputed again when creating the payment.
After removing this extra taxes computation, both tax_tag_ids/tax_tag_invert
are invalid.
So the solution is to fix the method computing the taxes for cash discount lines.

Note: This commit also fixes the cash discount engine not working with multiple tax repartition lines since:
https://github.com/odoo/odoo/commit/9c134ec379819053e3fdd1e252e3a7ae8a949f42

opw-3112197

Enterprise PR: odoo/enterprise#39181

closes odoo/odoo#118588

X-original-commit: de0db2429f7c47d52c1bad37b9d35d425c8d5b74
Related: odoo/enterprise#39775
Signed-off-by: Laurent Smet <las@odoo.com>
Signed-off-by: Nshimiyimana Serge Séna (sesn) <sesn@odoo.com>
Co-authored-by: Laurent Smet <las@odoo.com>
2023-04-14 15:06:02 +02:00
Julien Carion (juca) 1f6c655cbc [IMP] web, *: Add lazy loading for images in kanban
This commit adds the loading="lazy" attribute to every img tags compiled
by the kanban compiler and modifies some kanban archs in order to use
img tags instead of divs with background-image style to load images
(this allows again the loading="lazy" attribute to work).
The purpose is to avoid loading images that are outside the user viewport
at all time in order to reduce the load on the network when new images are
loaded.
Steps to test: find all views that are using the o_kanban_image or o_kanban_image_fill_left
class and ensure all the images in these views appear in the network tab of devtools
when they enter the user viewport. Example: res.partners, hr.employee, ...

task-3102207

closes odoo/odoo#117049

Related: odoo/enterprise#39560
Signed-off-by: Géry Debongnie <ged@odoo.com>
2023-04-14 15:05:56 +02:00
tsm-odoo cecadbfb8f [FIX] im_livechat: fix message unread counter
Since [1], the way the message unread counter is computed has changed.
The patch of the `im_livechat` module is not adapted properly. This
commit fixes this issue.

[1]: 6ebe033b00774ed8824d05f0adf9dae5f3654261

closes odoo/odoo#118581

Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2023-04-14 12:54:05 +02:00
Guillaume (gdi) 7c474c1a79 [IMP] web, website: add TikTok icon
This commit patches the font awesome library to add an icon for the
TikTok social network. Users are now able to add these icons with the
media dialog. Now, the TikTok icon works like all other font awesome
icons, with the new class introduced by this commit: `fa-tiktok`.
Moreover, the social media block in the website application can detect a
tiktok link and automatically integrate its icon with its color.

Technical note:
In order to add this new icon, a new font that contains only the TikTok
logo has been created.

task-3235451

closes odoo/odoo#118542

X-original-commit: dc926d56a286eebd3e7c10343824a6e2c1a76adc
Signed-off-by: Vray Benjamin (bvr) <bvr@odoo.com>
2023-04-14 12:54:02 +02:00
Jacky (trj) ea881196d2 [FIX] l10n_fr_pos_cert: scope can_be_merged_with
The content of the override of `can_be_merged_with` should only be executed when we're
in France.
The previous implementation resulted in breaking the `test_05_tip_screen` when this module
was installed with pos_restaurant.

closes odoo/odoo#118573

X-original-commit: 0d0a5e9ddc838f34bfbc469f9a8fceaeeadaa24d
Signed-off-by: Joseph Caburnay (jcb) <jcb@odoo.com>
2023-04-14 11:49:33 +02:00
niyasraphy 51761f1918 [IMP] *: improve window title in portal
account, purchase, sale

before this commit, opening a record from
portal(sale, purchase, invoice, project)
shows the window title as Invoice Portal Template,
Purchase Order Portal Template and
Sales Order Portal Template etc

* navigate to portal
* click sales order
* click and open any sales order
* see the window title

after this commit, better title will be
displayed to the portal users.

Invoice Portal Template --> Invoice/Bill
Purchase Order Portal Template --> Purchase Order
Sales Order Portal Template --> Sales Order

closes odoo/odoo#118567

Signed-off-by: Victor Feyens (vfe) <vfe@odoo.com>
2023-04-14 11:49:27 +02:00
Benoit Socias f9435feb39 [FIX] web_editor, web_unsplash: use preset colors on illustrations
Since [1] when the media dialog was rewritten, the illustrations
thumbnails were not using the preset colors.

[2] did partially implement the solution: the updated images with the
right colors were not replaced in the DOM.

This commit continues what [2] started and displays the illustration
thumbnails with the preset colors.
It also assigns a media type to all fetched images.

[1]: https://github.com/odoo/odoo/commit/7fd0698cf765a79959566b51e33cb76bff83d344
[2]: https://github.com/odoo/odoo/commit/f2111cb37a572fe1ffd9b303c4abcbb7fe1d67cd

task-3060679

closes odoo/odoo#118556

X-original-commit: 75cc46c4f784edb1fb7404956e1cfdf6fae6a83c
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2023-04-14 11:49:25 +02:00
Younn Olivier 23b2486666 [FIX] web_editor, web_unsplash: scroll to "load more" button upon search
[1] refactored the Media Dialog using owl and the backend Dialog
component.
Doing so, the width of the dialog was reduced (using the standard
.modal-xl class). With that change, the "load more" button was not
always visible for the user.

It is acknowledged that the current Media Dialog needs a deeper UI
review. In the meantime, it was decided to scroll to the bottom after a
search/click on the load more button.

This commit implements that solution with a ref on the "load more" div.
It is used in a scrollToLoadMoreButton, that is called each time after
loading a new attachment/illustration/unsplash record. As we do not want
a jump in the UI each time an image is loaded, the function is
debounced.
It is simpler to use a debounced function that we call each time an
element is loaded, than keeping track of each loaded element to call
the function only once, when they are loaded.

[1]: https://github.com/odoo/odoo/commit/31cc10b91dc7762e23b4bde9b945be0c4ce3fe3b

task-3060679

X-original-commit: 4921442690e6f5b587441a653f73c3368155422e
Part-of: odoo/odoo#118556
2023-04-14 11:49:24 +02:00
Younn Olivier 12c9d85ba2 [IMP] web_editor: load more illustrations only when filter is set
Before this commit, clicking on the 'load more' button of the media
dialog after a search (with no filter set) would load more
attachments/illustrations/unsplash records.

As illustrations are considered less relevant than attachments/unsplash
records, it was decided to load more of them only when the filter is set
to "illustrations".

When the filter is not set, the 'load more' button will be visible only
if there are more attachments or more unsplash images to load (and not
visible otherwise, even if there are more illustrations to load).
Also, the loadMore override will only perform the query to load more
illustrations if the filter is set.

A deeper review of the Media Dialog UI will be conducted later. For now,
this commit avoids loading too many illustrations, for users that are
most of the time more interested in the unsplash results.

task-3060679

X-original-commit: 6aaca71a4b2a11ffa80578904bc7c79c1fa0339d
Part-of: odoo/odoo#118556
2023-04-14 11:49:24 +02:00
Younn Olivier 883f2e2519 [FIX] web_editor, web_unsplash: do not display too many undraw images
Before this commit, typing a query in the search input of the media
dialog would output a lot of undraw images (15), making some noise and
making the unsplash results (that are fetched 10 by 10) less visible.

First, the number of fetched attachments was reduced from 30 to 10 when
converted to owl in [1], for no valid reason. This commit adds a new
NUMBER_OF_RECORDS_TO_DISPLAY value for better control over the loaded
images, and reverts it to 30.

Then, the /web_editor/media_library_search endpoint does not take any
limit param. Therefore, it was loaded with all the results as they were
returned. Now, a new NUMBER_OF_MEDIA_TO_DISPLAY variable is introduced
to load the 10 first results instead of all of them.

This way, the search results are organised as following:
- NUMBER_OF_ATTACHMENTS_TO_DISPLAY (30 for now) attachments,
- NUMBER_OF_MEDIA_TO_DISPLAY (10 for now) media (undraw, ...),
- NUMBER_OF_RECORDS_TO_DISPLAY (30 for now) unsplash images.

These values can be changed to adjust the search (it may be better to
have more unsplash images than undraw images).

[1]: https://github.com/odoo/odoo/commit/31cc10b91dc7762e23b4bde9b945be0c4ce3fe3b

task-3060679

X-original-commit: bc4fe60bcebd3e47f206c911526784a88fd520d9
Part-of: odoo/odoo#118556
2023-04-14 11:49:24 +02:00
Soukéina Bojabza 1a5a14268d [FIX] web_editor: make image options start more robust
This commit makes the image options initialization more robust, by

- checking at the beginning if the specified `src` and `data-original-
src` attributes match with existing files.
- checking if there is a `data-original-src` attribute before applying
the ImageTools options (shape, filter,...).

This is needed because in the case of wrongly hardcoded templates (e.g.
in customizations), it is sometimes not possible to drop any snippet
after dropping an incorrect one. This happens because the image
`SnippetEditor` is not correctly created. Indeed, the start of the image
options is never completed because the promise rejections when a file
does not exist are not properly caught, interrupting the initialization.
Therefore, ensuring that the files exist beforehand prevents these
issues from happening.

opw-3137732

closes odoo/odoo#118546

X-original-commit: 93ddaac87a76d6d1775e0b3e30bb66ca85147503
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2023-04-14 11:49:20 +02:00
sofiagvaladze cad6ac3c3f [IMP] hr_work_entry: UX changes
For more clarity, we added some fields on the list view of work entry.

task - 3264920

closes odoo/odoo#118050

Signed-off-by: Kevin Baptiste <kba@odoo.com>
2023-04-14 11:49:15 +02:00
lejeune quentin 2badc30db9 [FIX] hw_drivers: Try catch the load of iot handlers
Currently, if a problem occurs during the loading of iot handlers
(drivers or interfaces), all loading of iot handlers is compromised.

With this FIX we display the Exception and the file concerned without
blocking the operation of the iot

closes odoo/odoo#118557

X-original-commit: 3b717b0d66ea2656e5058ab3df0b068fae8b08c8
Signed-off-by: Quentin Lejeune (qle) <qle@odoo.com>
2023-04-14 10:45:09 +02:00
Julien Banken 9dc4b2b438 [FIX] web: reload Many2XAutocomplete component when updating props
Currently, the Many2XAutocomplete component is not reactive: The component
gets the model to load from its props and the component uses a hook to
initialize and open a SelectCreateDialog dialog for that model. The issue
is that the name of the model is copied and set in the setup function of
the Many2XAutocomplete component. When the model changes, the function
opening the SelectCreateDialog dialog is not updated and will hence still
use the name set initially.

Steps to reproduce the issue:
1. Create a new property field of type Many2one or Many2many
2. Choose a model
3. Click on the "Default Value" field
4. Click on the "Search More..." link from the dropdown
5. Choose another model
6. Click on the "Default Value" field
7. Click on the "Search More..." link from the dropdown
=> The modal displays records from the first model picked.

To fix the issue, we will simply put a `t-key` attribute on the component.
The component will then be reloaded whenever the given key changes. The
model loaded by the SelectCreateDialog dialog will then be updated properly
whenever the given model changes.

task-3192917

closes odoo/odoo#118505

X-original-commit: e9fcc1c950129cdb253df3df2ed7197e3de55fd3
Signed-off-by: Michaël Mattiello <mcm@odoo.com>
Signed-off-by: Banken Julien (jbn) <jbn@odoo.com>
2023-04-14 10:45:01 +02:00
Antoine Boonen (aboo) 938c47a76e [FIX] survey: adapt to new feature in 16.
Version 16 has new description for field. This commit adapts the field definition to that new API.

OPW - 3258716

closes odoo/odoo#118488

X-original-commit: af099eadfae9d5018ff1094208ca1c1d640af17f
Signed-off-by: Vranckx Florian (flvr) <flvr@odoo.com>
Signed-off-by: Antoine Boonen (aboo) <aboo@odoo.com>
2023-04-14 10:44:58 +02:00
luvi 585abd4847 [IMP] web: add bottomArea slot for SelectMenu
This commit allows the customization of the bottom area of the SelectMenu
component. The slot can show additional information, of handle any feature
related to the state of the component, such as adding elements, etc. It can
support any kind of content, so it could be used to display all kind of
useful content.

Two test have been added using this custom slot, asserting its presence and
testing an interaction with its content.

This changes is required to use the SelectMenu component in Knowledge, in
task-3134491

closes odoo/odoo#117890

Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2023-04-14 10:44:56 +02:00
clesgow 3cb3a226da [IMP] product_expiry,stock: not reserve to be expired products
Currently, when a product with an expiration date is reserved, the
expiration date isn't checked when seeking which lot/serial to use. This
can lead to the shipping and delivery of already expired products, since
their expiration date came before their scheduled delivery.

Task-3203121

closes odoo/odoo#117138

Signed-off-by: Arnold Moyaux (arm) <arm@odoo.com>
2023-04-14 10:44:53 +02:00
Thomas Lefebvre (thle) 1b662986bd [FIX] hr_skills: add default skill type
Steps to reproduce:
- enable "Skills Management" in Employee app;
- create a new employee;
- add skill by creating a skill level ("Create and edit").

Issue:
A traceback appears.

Solution:
Add the default skill type in the context
so that it can be used during creation.

opw-3269030

closes odoo/odoo#118555

X-original-commit: d553527403f4352da23673b91052e706841e1438
Signed-off-by: Kevin Baptiste <kba@odoo.com>
Signed-off-by: Lefebvre Thomas (thle) <thle@odoo.com>
2023-04-14 09:39:50 +02:00
Thomas Lefebvre (thle) dca0f52239 [FIX] hr_timesheet: display timesheets without task in portal
Issue:
When a project is shared with portal users,
only timesheets that are linked to tasks will be displayed.

Solution:
Change the domain that selects the timesheets to be displayed
to take into account timesheets that are not linked to a task,
but are in a project to which the portal user has access.

opw-3253632

closes odoo/odoo#118527

X-original-commit: 527033596afe5640533c568ea8c7367c40ff183a
Signed-off-by: Xavier Bol (xbo) <xbo@odoo.com>
Signed-off-by: Lefebvre Thomas (thle) <thle@odoo.com>
2023-04-14 08:33:49 +02:00
Touati Djamel (otd) 9db41eda8f [FIX] purchase_stock: don't set effective_date only for return pickings
Steps to reproduce the bug:
- Create a storable product “P1”:
    - route: dropship

- Create a purchase order:
    - customer: Azure interior
    - Deliver to: Dropship
    - Dropship Address: any address
    - Receipt Date: Tomorrow
    - Product: “P1”

- Conform the Picking
- Go to the dropship transfer:
    - Validate the picking

- Go to the Scheduled Action > Purchase reminder
- Run Manually

Problem:
The reminder email for the delivery is sent While the picking is in the
'done' status.

When we run the Scheduled action, the `_send_reminder_mail` function is
triggered in which we get the orders with the `_get_orders_to_remind`
function but we filter the purchase orders which have an "effective_date"
already set:
https://github.com/odoo/odoo/blob/181c7d82e30d0848bbac7f7d0188e81aced0af07/addons/purchase_stock/models/purchase.py#L279

but as in drop-shipping, the dest location is customer and the
"effective_date" is not set:
https://github.com/odoo/odoo/blob/16.0/addons/purchase_stock/models/purchase.py#L53

opw-3246218

closes odoo/odoo#118507

X-original-commit: 1495b54aa452498c79f4178c2e38426b1b423e66
Signed-off-by: William Henrotin (whe) <whe@odoo.com>
Signed-off-by: Djamel Touati (otd) <otd@odoo.com>
2023-04-13 19:27:49 +02:00
Kevin Baptiste 749a73ecff [FIX] hr_attendance: allow kiosk to use My Attendances
The Check In / Check Out menu would show that the user is not linked
to an employee because it was trying to read on `hr.employee` and not
`hr.employee.public`.

opw-3268217

closes odoo/odoo#118498

X-original-commit: 233a185362f2bc3243187f1f0b740ee5b154f039
Signed-off-by: Kevin Baptiste <kba@odoo.com>
2023-04-13 17:57:58 +02:00
Pierre-Yves Dufays ed8a101a08 [FIX] test_mass_mailing, {test_}mail: always apply blacklist for mass mailing
Always apply the blacklist in mass_mail composition mode regardless of the
recipient model implementing mail.thread.blacklist or not.

This solves the problem of mail sent to black listed address for model not
inheriting from mail.thread.blacklist.

Technical notes:
- it has been done in mail.compose.message _get_blacklist_record_ids ignoring
the mixin mail.thread.blacklist to avoid model change in stable.
- some tests have one added query because the blacklist is now queried for each
batch mail sends even if the model of the recipient doesn't implement
mail.thread.blacklist.

Task-2834862

closes odoo/odoo#118497

X-original-commit: 263e86114c60650f421354e165364afcd4122461
Signed-off-by: Dufays Pierre-Yves (pydu) <pydu@odoo.com>
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2023-04-13 17:57:56 +02:00
Stanislas Gueniffey b49823be4c [IMP] web_editor: powerbox search from description
This commit changes web_editor's powerbox search feature to also look
for matches in a command's `description`, in addition to its `groupName`
and `title`.

For example, typing /track will suggest the Checklist command among the
suggestions as its description is "Track tasks with a checklist".

Note that only exact matches are considered for the description, while
fuzzy matches (with missing chars) work for other attributes.

Also fixes a typo in a local variable name because it was hazardous to
some people's eyesight.

task-3188758

closes odoo/odoo#118486

X-original-commit: 7fa6d48f1b69e4d4806db29310223d326b0e0ed5
Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
2023-04-13 17:57:51 +02:00
Gaetan Vanden Bergh (gavb) 31b4fc06c4 [FIX] hr_holidays: Compute hours based on employee
If allocation use the employee mode, the displayed hour must be based on the employee schedule not on the company schedule

Partial revert of https://github.com/odoo/odoo/pull/96419

opw-3201224

closes odoo/odoo#118485

X-original-commit: 62c489fb8523e4ca231ef90e514f6f06c1e3d5da
Signed-off-by: Kevin Baptiste <kba@odoo.com>
2023-04-13 17:57:47 +02:00