Commit Graph
157134 Commits
Author SHA1 Message Date
Adrien Dieudonné d816ef8939 [FIX] web: property fields should take all width
This commit restores the style we have for fields.
- Takes the full avalables space for the input value
- No limit for the label size
- Align property value to the top (only usefull in case of long label)
- Clean unnecessary css since we use grid

After this commit, the property field will be shown with the same
layout used for standard fields in groups.

closes odoo/odoo#108630

X-original-commit: a89c6763a7440822e839bdccc75d8a6177db7eec
Related: odoo/enterprise#35225
Signed-off-by: Romeo Fragomeli (rfr) <rfr@odoo.com>
2022-12-23 20:18:02 +01:00
Samuel Degueldre a5c0889748 [IMP] odoo,web: tests: ease memory leak debugging
This commit adds (in comments) the necessary code to (more) easily
detect memory leaks in the qunit test suite. Running the test with
those lines uncommented would log information about the heap size
after each test module and the delta of the module, after garbage
collecting.

Useful regexes to extract information from the log:
```
remove lines not containing "delta: ":
`(^.*?delta: .*$\n)|(^.*$\n)` => $1

extract deltas:
`.*suite (.*) -.*gc: (\d+).*delta: (-?\d+).*` => $1,$2,$3
```

closes odoo/odoo#108620

X-original-commit: 0d5cb1659468f01f1b6f88deca0b46c1810111b0
Related: odoo/enterprise#35224
Signed-off-by: Samuel Degueldre <sad@odoo.com>
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2022-12-23 19:19:15 +01:00
Aaron BohyandSamuel Degueldre 3ab33f6737 [FIX] web: assets: fix wrong usage of memoize
The `assets.loadBundle` function was memoized. However, this
function takes in arguments an object. What matters here is the
list of js/css libs/contents to load, and the methods to load them
are already memoized (based on the url to load, which is correct).

So the use of memoize for loadBundle was
 1) wrong, because you basically never call it twice with the same
    object reference, so you never do cache hits
 2) causing memory leaks because in mvc.js, it is called with the
    view controller instance as argument, which could thus never
    be garbage collected.

This commit remove the wrong usage of memoize, thus fixing the
memory leak.

X-original-commit: 921c68d587845785189c938aa90bd02b9936182f
Part-of: odoo/odoo#108620
Co-authored-by: Samuel Degueldre <sad@odoo.com>
2022-12-23 19:19:15 +01:00
Aaron BohyandSamuel Degueldre 969bdafe1e [FIX] web: tests: App: correctly cleanup sharedTemplates
A lot of tests generate dynamic owl templates (e.g. form tests).
These are added in a data structure (sharedTemplates). To mitigate
the memory footprint, there was a piece of code aiming at clearing,
at the end of each test, templates generated during the test.
However, the way it was implemented was wrong, as the cleanup was
only done after the first test.

This commit fixes the issue, and thus improve the memory footprint
of the qunit suite.

X-original-commit: 6ba84b4da195d65f53c45a4e00a8ef7425f121de
Part-of: odoo/odoo#108620
Co-authored-by: Samuel Degueldre <sad@odoo.com>
2022-12-23 19:19:14 +01:00
Aaron BohyandSamuel Degueldre 868adb0e46 [FIX] web: tests: clear handlers on LegacyBus
Before this commit, there was a piece of code aiming at clearing
event handlers registered on core.bus (the main instance of Bus),
registered during a test (main use case being: there is a service,
started in a test, and that service registers an event handler on
core.bus).

However, core.bus isn't the only instance of Bus, and this logic
should be applied to all of them (e.g. web_studio.bus). This was
a memory leak. This commit fixes it.

X-original-commit: 2e7dd01cfdad35b3c6384fec60b158747b86ab78
Part-of: odoo/odoo#108620
Co-authored-by: Samuel Degueldre <sad@odoo.com>
2022-12-23 19:19:14 +01:00
Aaron BohyandSamuel Degueldre a39e703a2e [FIX] web: remove memory leak with bootstrap tooltips
This commit fixes a memory leak occurring in basic renderers. It
seems that the issue comes from bootstrap 5.1 (might be fixed in
5.2). As this is legacy code, and updating from 5.1 to 5.2 doesn't
seem easy (moreover in stable), we come with a simple and local
patch in BasicRenderer.

X-original-commit: 3c01b1cd77adec146b1a90f96bb1223a2108678b
Part-of: odoo/odoo#108620
Co-authored-by: Samuel Degueldre <sad@odoo.com>
2022-12-23 19:19:14 +01:00
PoMa 911fb327b6 [FIX] account : restore QR code generation for vendor bills
To Reproduce
============

- enable QR code on Accounting settings
- with a vendor who has a bank account create an invoice from him/her
- print or preview the credit note

The Problem
===========

the qr code method field will not be filled with SEPA, and a QR code will not be added to the PDF or preview.
This qr reflects the vendor's bank account, so the user could scan it and send the money.
This feature was removed by PR #104496 because it was also printed in the refunds to the customers, which was odd, but as a side effect it is also removed from vendor bills.

Solution
========
The QR should not be hidden in vendor bills and purchase receipts, ( also in vendor refund it can be helpful for the vendor, but there isn't any complain about it now )
A better solution would be displaying the QR code in the form view if it is not the company's bank account (it is the partner's bank account), but it should be done in master, it is too much of change for stable versions.

Ticket No: 3071310

closes odoo/odoo#108612

Closes: #108215
X-original-commit: 1b60e21c3636fffba55312525d86da5b1f14948f
Signed-off-by: Pouya Malekinejad (poma) <poma@odoo.com>
Signed-off-by: William André (wan) <wan@odoo.com>
2022-12-23 19:19:09 +01:00
Benoit Socias 3bbce756c6 [IMP] website, web_editor, *: save dropped images as attachments
*: mass_mailing

When images are dropped from outside the browser into a website page
text paragraph, they are stored as an inline base64-encoded source.

This commit marks those images to be saved as attachments when it
happens in website. The save happens upon page save similarly to what is
done when images are transformed.
This commit also applies this behavior for pasted images.

task-2928495

closes odoo/odoo#98801

Signed-off-by: Romain Derie (rde) <rde@odoo.com>
2022-12-23 19:19:06 +01:00
Romain Derie 7442fb7161 [IMP] web_editor: consolidate both supported image mimetype lists
Before this commit and since commit [1] which introduced
`SUPPORTED_IMAGE_EXTENSIONS` on top of the existing
`SUPPORTED_IMAGE_MIMETYPES` there would be 2 lists which were holding
related values which a strong link between the two: one was holding the
image extensions while the other was holding the images mimetypes.

It was a bad idea as it was not robust and no relation between the two.

It's an issue as some WIP code was then trying to retrieve the extension
based on a given mimetype which was not possible to do in a reliable
way:
```py
ext = SUPPORTED_IMAGE_EXTENSIONS[SUPPORTED_IMAGE_MIMETYPES.index(mimetype)]
```

The chance is then taken to merge those 2 lists in a single dict that
will strengthen the link between the mimetype and its related extension.

[1]: https://github.com/odoo/odoo/commit/9dab9ffce297dcfc89f0ec7efc4c8f8b43104220

Part-of: odoo/odoo#98801
2022-12-23 19:19:06 +01:00
niyasraphy 2f3d277b6c [IMP] website_forum: improve demo data
it is specified as v8, generalized the demo data content to use odoo, instead of odoo v8

closes odoo/odoo#108575

Signed-off-by: Romain Derie (rde) <rde@odoo.com>
2022-12-23 18:22:40 +01:00
Lucas Lefèvre 03061e09ad [FIX] spreadsheet: download xlsx with active filters
This commit allows to download a spreadsheet with active filters
without any crash.

Commit https://github.com/odoo/odoo/commit/509bda2202df9f0f582fd020d96e8e1310b9abc7
was a first attempt to fix the issue.

But the commit was wrong because an empty sheet for excel is not the
same as an empty regular sheet. The `charts` property is missing and
the excel would crash when trying to read it.

Task 3102330

closes odoo/odoo#108603

X-original-commit: 0db14f258c31366ab53728735b4d31b4576c5269
Signed-off-by: Rémi Rahir (rar) <rar@odoo.com>
2022-12-23 17:03:40 +01:00
luvi afd5408bf5 [REM] base_import, debian: remove state-machine library
This commit removes the state-machine.js library. It can be remove as
this library was mainly used to handle the import action process, and
that it has been rewritten without the need of the library.

Copyright mentions to the library have also been removed, since it is no
longer necessary.

closes odoo/odoo#106265

Related: odoo/enterprise#34249
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2022-12-23 17:03:37 +01:00
luviandBastien Fafchamps 0566b5f6ba [REF] base_import, web: convert import action to Owl
This commit reimplements the import action view to fully use Owl instead
of its legacy implementation. Different components have been created to
separate the UI in smaller blocks, and a model file contains the main
aspects of the import logic.

The SelectMenu component is now used instead of the jquery select2, and some
other web components and hooks have been used or modified to bring this
action to a better state. A custom ImportBlockUI component is used, to
support custom messages and the use of components. It was required to
reimplement the loading progress and indicator used by the view.

The set_file route in the base_import controller has been adapted to remove
the usage of jsonp type of code for this situation since it is no longer
needed nowadays.

On top of the rewrite, js tests have been added to make sure the feature
behaves correctly, and to assert the intended specs.

Finally, legacy files have been removed, since they are no longer required.

Enterprise PR: https://github.com/odoo/enterprise/pull/34249

task-3092474

Part-of: odoo/odoo#106265
Co-authored-by: Bastien Fafchamps <bafa@odoo.com>
2022-12-23 17:03:37 +01:00
Bastien Fafchampsandluvi 26a1eee340 [ADD] web: add SelectMenu component
This commit adds a new SelectMenu component. This component makes it
possible to search for options for a select element. It can be used to
replace the jquery select2 element for most cases.

Changes have been made to the Dropdown component as well as the position
hook, to allow the menu to be placed with the same width than the toggler,
using the 'fit' variant. Tests have been added to assert this position
feature.

Tests have been added to make sure the behavior of this component is
working as expected, and let the core element's usage being asserted.

Part-of: odoo/odoo#106265
Co-authored-by: luvi <luvi@odoo.com>
2022-12-23 17:03:36 +01:00
luvi 6a7b3dedaf [IMP] web: position_hook supports fit variant
This commits adds another variant to the position hook. This one allows
a popper to be positionned next to a side, having the same dimension from
this side. A classname is then added to the popper, allowing the element
to be stylized depending of the side it's fitting.

Possible values:
(bottom/top)-fit would give the same width as the reference
(left/right)-fit would give the same height as the reference

Tests have been added to make sure those dimensions are correctly
applied when using thr fit variant.

Part-of: odoo/odoo#106265
2022-12-23 17:03:36 +01:00
luviandFlorent Dardenne 97cc94269d [REF] mail, *: convert Activity view to Owl
*: project, web

This commit converts the Activity view to the current framework shared by
other views. Instead of extending Kanban view/elements, the Activity view
has been implemented by its own.

The project customization of the view has also been converted, as legacy
files have been removed.

Some tests have been adapted since some classnames might differ from the old
implementation, resulting to failing tests. But the overall testing cases
have been conserved.

closes odoo/odoo#107916

Related: odoo/enterprise#35177
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
Co-authored-by: Florent Dardenne <dafl@odoo.com>
2022-12-23 16:07:06 +01:00
luviandFlorent Dardenne 28927c2eeb [REF] web, crm: adapt Kanban progressbar to be a component
This commit moves some parts of the code used by the progress bar of kanban
to its own component. It is now clearer to distinguished its code from the
renderer code (see crm_kanban_renderer). Also, it allows to re-use this
component in other views without making a direct use of 'kanban' elements.

The KanbanAnimatedNumber component has simply be renamed to AnimatedNumber,
as this naming suggested the element was only used as a Kanban element. This
more generic name now indicates that the element can be imported and used in
other places.

Part-of: odoo/odoo#107916
Co-authored-by: Florent Dardenne <dafl@odoo.com>
2022-12-23 16:07:05 +01:00
Ivan Yelizariev 29fc7bdc4d [FIX] mail: avoid copying notified_partner_ids field
The field `notified_partner_ids` has type Many2many with relation table
`mail_message_res_partner_needaction_rel` [1] which is a regular Odoo model
`mail.notification` with some extra fields. One of those fields is required:
`notification_type`.

On copying `mail.message` record, ORM copies Many2many fields directly without
using `default_get` method for `mail.notification` model. Particularly,
`notification_type` get null value and we get an error.

STEPS

1. Create Server Action for `mail.message` model:

```py
for message in (records or record):
    message.copy({
        "subject": message.subject + "(SA copied)",
    })
```

2. Add contextual action
3. Open `mail.message` which has non-empty value on
`notified_partner_ids` (*Partners with Need Action*)
4. Run the Server action via Action menu.

PROBLEM

```
ValueError: <class 'psycopg2.errors.NotNullViolation'>: "null value in column
"notification_type" of relation "mail_notification" violates not-null constraint
DETAIL: Failing row contains (11, 210, null, 3, null, null, null, null, null,
null, null, null, null).
```

SOLUTION

Fix it by adding `copy=False`, because we don't want to copy those values
anyway (confirmed by TDE).

[1]: The relation table is renamed to `mail_notificaiton` in v15+

opw-3069556

closes odoo/odoo#108599

X-original-commit: d68b0f7d6b8f973ddaafdd7526d4f753a1b6abd2
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
Signed-off-by: Ivan Elizaryev (iel) <iel@odoo.com>
2022-12-23 15:08:24 +01:00
Alexandre Kühn 7139ae416e [IMP] tools: put QUnit.only test in module wrap
Before this commit, when filtering tests by odoo module,
tests registered with `QUnit.test` and `QUnit.debug` were
listed, but not `QUnit.only`.

closes odoo/odoo#108591

Signed-off-by: Géry Debongnie <ged@odoo.com>
2022-12-23 15:08:18 +01:00
fdardenne 5358930855 [IMP] web,project: kanban: quick create when grouped by many2many
This commit adds the ability to quick create records from the
kanban view when it is grouped by a many2many field.

This feature improve the user experience for multiple views, here are
some examples of new possible workflows:

- Project -> My tasks (this view is grouped by m2m) -> quick create
- Project -> Select a project -> group by Assignees -> quick create
- Multiples module -> group by tags -> quick create

The "My Tasks" view is grouped by the m2m `personal_stage_type_ids`
field which is a complicated computed field on which we cannot write. A
custom behaviour in their `ProjectTaskRecord` was necessary in order to
support this feature. Previously, they also implemented a custom
behaviour for this field to be able to move records between groups.

closes odoo/odoo#108150

Task-id: 2960497
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2022-12-23 15:08:15 +01:00
Aaron Bohy a3d77e877d [IMP] web: list view: sticky header
With this commit, the header of list views no longer scrolls with
the table, it remains visible on the top when scrolling.

Task 1917230

closes odoo/odoo#107631

Related: odoo/enterprise#35097
Signed-off-by: Adrien Dieudonné (adr) <adr@odoo.com>
2022-12-23 14:09:23 +01:00
Xavier BOL (xbo) b34c458311 [FIX] hr: search method of member_of_department
Before this commit, when the parameters given to the
`_search_part_of_department` is:

- `operator='!='`
- `value=False`

Then the domain returned by the method does not take into account the
False value.

This commit fixes the issue by changing the `=` into `!=` when the value
is False instead of changing `!=` into `=` when the value is False.

closes odoo/odoo#108589

X-original-commit: 814cdc9a7bccf4dca1cf93403295cf1280ca6c10
Signed-off-by: Laurent Stukkens (ltu) <ltu@odoo.com>
Signed-off-by: Kevin Baptiste <kba@odoo.com>
Signed-off-by: Xavier Bol (xbo) <xbo@odoo.com>
2022-12-23 12:11:16 +01:00
FrancoisGe ec201d2205 [FIX] web: save ace field with alt+s
Before this commit, edit an ace field and press alt+s remove the change.

How:
- edit an ace field
- press alt+s

Before:
The change is removed.

After:
The change is saved.

closes odoo/odoo#108579

X-original-commit: 5ca1b68ef9f5b31416cdfbeee6e984ca754d38cd
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2022-12-23 12:11:14 +01:00
Rahul Prajapati 5c83fc5e99 [IMP] mail: push to talk key display for space key
PURPOSE:

When the push to talk key is the "space" we show an "empty string",
which is very confusing and not very clear.

SPECIFICATION:

We display `Space` string instead of empty space.

Task-2794733

closes odoo/odoo#108573

Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2022-12-23 12:11:11 +01:00
mehjabin 8efee64757 [CLA] signature for Mehjabin
closes odoo/odoo#108537

X-original-commit: baa8ec8757dbfd1fdbb955e570ca20159b32dcff
Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2022-12-23 12:11:06 +01:00
Michael (mcm) 296413a616 [IMP] web: edit view in current action
Before this commit, editing views from debug menu opened a dialog
and the user needed to refresh the page to see the changes.
Now, the edit view is opened in a new action so when the user goes back
in the breadcrumb, the view is updated.

task id: 3081332

closes odoo/odoo#108524

Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2022-12-23 12:11:03 +01:00
Arthur Detroux (ard) 285333a521 [FIX] website: properly add anchors into website menu
Prior to this commit, adding an anchor using auto-complete would not
properly prefix the url with the URL of the current page.

Steps to reproduce:
- Create a page (e.g. /test), add blocks and create an anchor (e.g.
- Save the page
- Click on "Edit Menu" in "Pages"
- Add a new menu entry
- Type '#' in the URL field and select the anchor
- Save

=> The menu entry is wrongly set as it does not contain the original
page's URL inside the `href` attribute. This means that clicking on the
menu from any other place will not properly redirect to the anchor on
the /test page

On top of that, editing a menu entry that was previously linked to a
page would change the URL of the page with an anchor, making it
impossible to access the page anymore until you change the URL back in
the page manager.

Steps to reproduce:
- Create a new page (e.g. test)
- Add a new menu entry that has this page as its URL
- Save the new menu entry (close the dialogs)
- Re-open the Menu dialog and edit the newly created menu entry
- In the URL field, replace it with the page + an anchor
 (e.g. /test#anchor)
- Save
=> The page's URL is now /test#anchor and is no longer accessible

The is due to the `save` method of the `website.menu` model not
containing code to properly manage adding an anchor to the menu.

This commit fixes that.

opw-3067750

closes odoo/odoo#108502

X-original-commit: 192bf08da191e6fad27dd2913be0801817256a3a
Signed-off-by: Romain Derie (rde) <rde@odoo.com>
2022-12-23 12:11:01 +01:00
Arnold Moyaux 9cd316f038 [IMP] stock_account: Set the AVCO value as standard price on product form
Currently the standard price for products with FIFO as cost_method, show
the price of the next product to go out. It could be confusing on the
report page because the standard price * quantity is different than the
stock value. Another issue, is the margin, they are only computed on the
last piece even if we sell multiple ones.

For example:
MOVE IN 5 units @ 10$
MOVE IN 5 units @ 20$

If we do an order for 10 units at 30$ each we will have a margin of
200$ (30$ - 10$)*10. And the report page will be 10*10$ --> 150$.

The purpose of this task is to have always a report correct. For the
margin it will not be always true because it's depending the number of
pieces that we sell. In the above example:
- if we sell 9 units, the margin will be better with this patch
135$/130$ with this commit and 90$/130$ without
- but if we sell 6 units it will be closer to reality with the old patch.
90$/70$ and without 60$/70$

It has other implications: the inventory adjustement and edition of
moves will now takes the AVCO values and not the next to go out.
With the upper example if we add 10 units following an inventory
adjustement (10 * `standard_price`):
- With this commit: 150$
- Current behavior: 100$

Globally it will be closer to reality for products with a price having
a lot of variance and it won't change for the other.

Task-2918885

closes odoo/odoo#108468

Signed-off-by: William Henrotin (whe) <whe@odoo.com>
2022-12-23 12:10:58 +01:00
Samuel Degueldre f7f16bd85d [FIX] web: correctly log full traceback for uncaught errors
Previously, we added some handling so that errors that were not
defaultPrevented would have their traceback logged by the error service
instead of the default behaviour of the browser, because not all
browsers correctly log error chains (errors with causes). This did not
actually work because the errorEvent was written on the object at the
top of the error chain and checked on the error at the bottom of it.

This commit fixes that by just looking at the event on the uncaught
error.

closes odoo/odoo#108463

X-original-commit: cefba026ad7fe453da840a948e25d29d4d1837e9
Signed-off-by: Géry Debongnie <ged@odoo.com>
Signed-off-by: Samuel Degueldre <sad@odoo.com>
2022-12-23 12:10:55 +01:00
Xavier-Do bc61ab4fb2 [FIX] web: format set_profiling output nicely
JSON content can be rendered nicely by browsers when using the
appropriate mimetype

closes odoo/odoo#107708

X-original-commit: 70153bbe233bb81d51752c5f1ed1766414eb875b
Signed-off-by: Olivier Dony (odo) <odo@odoo.com>
2022-12-23 12:10:52 +01:00
Patrick Hoste 44dba8e572 [FIX] website_slides: fix dropdown item in channel kanban view
Before this commit the dropdown items in the channel kanban
view were not centered, this fix the issue by adapting the
css rules.

Task-3086160

closes odoo/odoo#108552

X-original-commit: 7d1a013b43ce9196e1f2f7a602cf8161d44776ad
Signed-off-by: Stéphane Debauche (std) <std@odoo.com>
2022-12-23 11:10:41 +01:00
Mathieu (mano) c1d3cc88f6 [FIX] web: fixing font weight on fedora
This commit replaces Liberation Sans for Noto Sans in the default system
font stack as Liberation doesn't support font-weight: 500 and had a 
fallback at 400.

Liberation Sans was the fallback font on Fedora Linux, this commit fixes
it by setting Noto Sans (variable font) as the fallback font for Fedora.

task-3076171

closes odoo/odoo#106525

Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2022-12-23 10:09:54 +01:00
Thomas Lefebvre (thle) 8029b467da [FIX] hr_timesheet: prevent user to see other employee's timesheets
Steps to reproduce:
- for a user, define Timesheets access rights to "User: own timesheets only";
- go to Reporting tab in Timesheets application with this user;
- go to pivot view "By Project" or "By Task".

Issue:
It is possible to see timesheets that do not belong to the user.

Solution:
Add rules which force de domain for the `timesheets.analysis.report` model.

opw-3088745

closes odoo/odoo#108553

X-original-commit: 07c9a3687511c2feaf9b6558da8c7f4d93470e64
Signed-off-by: Xavier Bol (xbo) <xbo@odoo.com>
Signed-off-by: Lefebvre Thomas (thle) <thle@odoo.com>
2022-12-23 07:44:44 +01:00
jorv edec9e92c7 [FIX] website_livechat: define auto_init for better installing performance
When installing the website_livechat module, the `_compute_livechat_operator_id`
method is run on every record to update the value for `livechat_operator_id`.
On a large `website_visitor` table this leads to timeouts and livechat installation
stops with a traceback.

We can safely assume that at the moment of installing livechat,
no livechat operator was attributed to any visitor. initializing the value to
a default FALSE seems acceptable.
That way PostgreSQL will not need to touch the rows at all, the operation will
be instantaneous, and the actual values will be lazily initialized when the rows
are modified later.

Example, client database with +7 million `website_visitor` records to run
`_compute_livechat_operator_id` on installation:
- before commit: more than 3 hours (timeout)
- after commit: less than 3 mins

Previous implementation: cc9f59b , c426a45

opw-3095632

rebase + squash :
Switched to using the `create_column` method instead of a raw SQL query.
Added some comments in the `_auto_init` definition.

closes odoo/odoo#108570

X-original-commit: f7eae96e1aeb29a518eddd7dd18267dfc0a39fca
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2022-12-23 01:41:45 +01:00
Solan Delvenne (sode) 63f52519e7 [FIX] snailmail: Fix base snailmail layouts
Due to some changes to the layout and to some upcoming changes to the
service provider's validation area, the layout had to be fixed to avoid
validation errors.

closes odoo/odoo#108559

X-original-commit: 0ba4a7ea649846b796161206b5ea011cf6fcda27
Signed-off-by: Florian Daloze (fda) <fda@odoo.com>
Signed-off-by: Solan Delvenne (sode) <sode@odoo.com>
2022-12-22 18:30:07 +01:00
Lucas Lefèvre e73bf6580f [IMP] spreadsheet: update o_spreadsheet to latest version
### Contains the following commits:

https://github.com/odoo/o-spreadsheet/commit/4c5002db [IMP] function: hyperlink(url, label)
https://github.com/odoo/o-spreadsheet/commit/9d84b33f [REF] popover: improve popover component
https://github.com/odoo/o-spreadsheet/commit/5a33e7d7 [REM] figures: remove duplicated image component
https://github.com/odoo/o-spreadsheet/commit/6df5f339 [IMP] chart: aggregate data for labels
https://github.com/odoo/o-spreadsheet/commit/ee3d2ab7 [FIX] scrollbars: Fix size of the scrollbars
https://github.com/odoo/o-spreadsheet/commit/11d6eeee [FIX] index.ts: export helper to create empty sheet
https://github.com/odoo/o-spreadsheet/commit/53c18e51 [IMP] model: allow to run evaluation in non lazy mode

closes odoo/odoo#108540

Signed-off-by: Pierre Rousseau (pro) <pro@odoo.com>
2022-12-22 15:55:12 +01:00
Ahmed Khalaf d7246ef786 [FIX] mrp: fix change MO qty to produce
Before this commit, if a user changes a MO move qty to 0
and then tries to change the MO qty to produce, an error occurs.

The move with 0 qty is no longer cancelled or unlinked as this was not
the intenteded behavior.

Since the change production wizard no longer deletes cancelled moves
a test was updated accordingly.

closes odoo/odoo#108534

Taskid: 3082611
X-original-commit: 39abadb30dc8fab6b2a1ca24cb2916ab148fb5fa
Signed-off-by: Arnold Moyaux (arm) <arm@odoo.com>
Signed-off-by: Ahmed Khalaf  <ahkh@odoo.com>
2022-12-22 15:55:09 +01:00
Patrick Hoste fe6fd32adf [FIX] website_slides: fix dropdown item in channel kanban view
Before this commit the dropdown items in the channel kanban
view were not centered. This fix the issue

Task-3086160

closes odoo/odoo#107542

Signed-off-by: Stéphane Debauche (std) <std@odoo.com>
2022-12-22 15:55:07 +01:00
Pierre Rousseau 180ddd6da2 [FIX] spreadsheet: autoresize pivot table
Before this revision, the pivot table was not autoresized when group bys
contains a many2one or a many2many field as it required an extra
request to get the name_get of the values.

With this revision, the values of the relational fields are extracted
from the pivot model in order to save an extra request.

Note: this fix is not ideal as it introduce a dependency between the
pivot model and the server data source. However, it is the best
solution in a stable version.

Task-id 2928601

closes odoo/odoo#108527

X-original-commit: d6a1aa63702132ffc59d2412c2a009912eba797a
Signed-off-by: Lucas Lefèvre (lul) <lul@odoo.com>
2022-12-22 14:49:29 +01:00
Pierre Rousseau 0fa9d984f3 [FIX] spreadsheet: call the correct callback when fetching data
Before this revision, the callback passed to the constructor of
BatchEndpoint which should be called when there is an error when
fetching data was not called.

Part of task-id 2928601

X-original-commit: 6b4d5e4274c7644f9fda40c96f6b08a6bfd9ff37
Part-of: odoo/odoo#108527
2022-12-22 14:49:29 +01:00
Denis Roussel ca17c97920 [FIX] delivery: Really use propagate_carrier option on stock rules
closes odoo/odoo#108501

X-original-commit: c41d64507cd08c6e6cb033e8802d537acce5aaab
Signed-off-by: Arnold Moyaux (arm) <arm@odoo.com>
2022-12-22 14:49:26 +01:00
William Braeckman ae497d22e5 [FIX] website_sale{,_stock}: fix issue with tests
Multiple tests introduced in 16.0 created a product template and then a
default product for that template, however a default product is already
created by default in the product module when creating a template and it
somecases triggered an unicity constraint.

closes odoo/odoo#108523

X-original-commit: 3c9ff6e148cd0ee77442dd31079f0fec9c456b4c
Related: odoo/enterprise#35180
Signed-off-by: William Braeckman (wbr) <wbr@odoo.com>
2022-12-22 13:47:58 +01:00
niyasraphy f9ec85614b [FIX] repair, sale, stock: translatable string and typo
currently the returned warning from the sale, stock and repair apps are not translatable to user languages.

this pr makes the string's translatable and correct the grammer of the warning.

closes odoo/odoo#108379

X-original-commit: 217115e68d117d7cf1eeb94794118819d6082547
Signed-off-by: Victor Feyens (vfe) <vfe@odoo.com>
2022-12-22 12:45:48 +01:00
Adrien Widart (awt) 1f3cbfd7ca [FIX] mrp: hide smart buttons for kits
When a kit template has several variants, the on hand quantity can be
incorrect.

To reproduce the issue:
1. Create two products P_compo, P_kit:
    - P_kit:
        - Storable
        - Variants:
            - Color (White, Black)
    - P_compo:
        - Storable
2. Update the on hand quantity of P_compo: 10
3. Create two BoMs:
    - BoM01:
        - Product: P_kit
        - Variant: Black
        - Type: Kit
        - Components: 1 x P_compo
    - BoM02:
        - Product: P_kit
        - Variant: White
        - Type: Kit
        - Components: 2 x P_compo
4. Open the form view of the template P_kit

Error: it displays "15 units on hand", which is impossible (there are
only 10 P_compo available)

Since it is difficult to determine the expected value, a decision has
been made: hide these smart buttons if a template has more than one
variant and if at least one of the variants is a kit.

OPW-2645299
OPW-2678400
OPW-3076502

closes odoo/odoo#108284

X-original-commit: cf3b83d6a48c080d900d9cf343e4012be718c79d
Signed-off-by: William Henrotin (whe) <whe@odoo.com>
Signed-off-by: Adrien Widart <awt@odoo.com>
2022-12-22 11:40:55 +01:00
xO-Tx 3b9406419a [FIX] web_editor: fix shape animation loss
To apply a shape on image, we use its base64 string as source on the
<image/> of the shape svg file. Then, the svg is used as source on the
targeted DOM element (<img/> on snippet).

When the targeted image is an animated GIF, the behaviour is different:

CHROME:
- The animation works correctly.

SAFARI & FF:
- The GIF animation is lost (only on non-animated shapes). The animation
works correctly on the svg file but once it is used as src of <img/> tag,
the animation is lost.

The goal of this commit is to fix this behaviour by forcing the
animation on SVG content.

task-2679905

closes odoo/odoo#108229

X-original-commit: 996acc3977de0346a45da328f42583b4366d1d47
Signed-off-by: Vray Benjamin (bvr) <bvr@odoo.com>
2022-12-22 11:40:52 +01:00
vishal padhiyar e9f99dff16 [IMP] web_editor: improve link popover
PURPOSE

Simply improve the design of the link popover

SPECIFICATION

- "ellipsis" the link preview instead of wrapping it
- only keep a 0.5rem gap between each of the right icons

Task-2916270

closes odoo/odoo#108497

X-original-commit: bb1f37226dcd842abf4ec63ecf037f5ce3a3441b
Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
2022-12-22 10:39:35 +01:00
Nicolas Bayet cb3dc19969 [FIX] web_editor: make monetary field unremovable
Before this commit, the span within monetary field could wrongly be
removed. Python code that parse the value (see `from_html` of
`ir.qweb.field.monetary`) expect to have that span available.

This commit make that span being unremovable.

opw-3090775

closes odoo/odoo#108496

X-original-commit: 7576c88fec4f993e525279d15c22077a11132281
Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
2022-12-22 10:39:31 +01:00
Swapnesh Shah 97ec1f4ab3 [FIX] hr_holidays: correct date format on leave name
Before this Commit, dates was not formatted based on user's language.

With this commit, we use format_date to correctly format dates.

closes odoo/odoo#108442

X-original-commit: 4da7129695f2619711f08ed7c36a37543deaa31d
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
Signed-off-by: Kevin Baptiste <kba@odoo.com>
2022-12-22 10:39:28 +01:00
Rohitkumar (roku) 30f4b615d3 [FIX] project: stat button content align
Before this commit, the content of the stat button not aligned.

So this commit fixes by the stat button's content is aligned to the left and vertically centered.

task-3054386

closes odoo/odoo#108504

X-original-commit: e87284cebe64cc1f5bf31198ca221f14cffdc671
Signed-off-by: Xavier Bol (xbo) <xbo@odoo.com>
2022-12-22 09:38:07 +01:00
Abdelouahab (abla) 2c7ab4d85f [FIX] website_sale: set t-key to unique value
To reproduce
============
- add a second image to a product and publish it on the website
- on the website make sure to enable image popup when clicking on it
click on the product image -> error

Problem
=======
the `t-key` is set to `image` which has the value `[object Object]` as `string`
so for the `t-foreach` loop all the keys are the same which leads to keys duplication error

Solution
========
set `t-key` to the `image.thumbnailSrc` because we are sure
that the src is unique.

opw-3090782

closes odoo/odoo#108485

X-original-commit: 6059b8ca68cfe8f631451f7d306387c6ed4f7844
Signed-off-by: William Braeckman (wbr) <wbr@odoo.com>
Signed-off-by: abla001 <abla@odoo.com>
2022-12-22 09:37:59 +01:00