Commit Graph
157157 Commits
Author SHA1 Message Date
xO-Txandqsm-odoo fb6d300a6e [FIX] website: hide link popover on social share
To reproduce the issue:

- Website > Edit mode > Add "Share" block.
- Cannot edit the link by clicking a social share item ("Edit link"
on link popover doesn't work).

Since 15.x, "Share" snippet items are not meant to be user links but
buttons to share the page on the related social media. It is also
useless to update those links after the update on [1], since they will
be replaced by the right values "on social item click" (the shared URL
may be updated during the page use as on product pages).

The goal of this commit is to fix this behavior and prevent the link
popover from appearing on items (by setting the `o_no_link_popover`
class right after the snippet is dropped into a drop zone).

[1]: https://github.com/odoo/odoo/commit/ddb2c06be4196c86ff6a2fd74874487d75b31c94

opw-3084367

closes odoo/odoo#108724

X-original-commit: f4a602ca4d423056fa3f760fc8a3fc222e2a5e51
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
Co-authored-by: qsm-odoo <qsm@odoo.com>
2022-12-27 16:49:57 +01:00
xO-Tx 5e1074340f [FIX] website: fix missing space on whatsapp text for "share" block
To reproduce the issue:

- Website > Edit mode > Add "Share" block > Save.
- Click WhatsApp > Missing space between page title and its URL.

Starting from [1], the `$('title').text()` value was replaced on "Share"
snippet by `document.title` (which will trim and collapse whitespaces
in the page title). This leads to a missing space between page title
and the shared URL.

After this commit, the correct spacing is restored.

[1]: https://github.com/odoo/odoo/commit/ddb2c06be4196c86ff6a2fd74874487d75b31c94

opw-3084367

X-original-commit: e7e9eb4f806680b19f3ec61fb080316a3160e7fb
Part-of: odoo/odoo#108724
2022-12-27 16:49:57 +01:00
luvi 850c821f7e [FIX] base_import: set the correct default separator
In the default import options, some separators had a wrong value by
default. This commit fixes those, which will fix some failing imports.

A test has been added to verify the default options set.

closes odoo/odoo#108710

Signed-off-by: Bouvy Damien (dbo) <dbo@odoo.com>
2022-12-27 15:49:26 +01:00
Julien Alardot (jual) ef6e3b668d [FIX] l10n_fr_fec: Fix missing colspan
Since the recent css change the text of the description field was no taking all the place he could, so it was impossible to read, thanks to the colspan it's now the way it was intended

closes odoo/odoo#108714

Task: task-3103640
X-original-commit: b35485ddbb0567ff129e9da863a29bdc66df34eb
Signed-off-by: William André (wan) <wan@odoo.com>
Signed-off-by: Julien Alardot (jual) <jual@odoo.com>
2022-12-27 13:18:10 +01:00
Benoit Socias 965e2bce29 [IMP] web_editor: align m2m widget label with first element
The m2m widget label is aligned at the middle of the height of the whole
option's display.

This commit makes the m2m widget label aligned with the first element
(either the first active value, or the "Choose a record..." dropdown if
no value is selected).

task-2811746

closes odoo/odoo#108227

Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2022-12-27 13:18:03 +01:00
Demesmaeker fdf2dd3dd0 [FIX] sale_management: onboarding tour can't send email
This tour was broken due to the partner not having an email. The step to send the email was then
failing because the email was missing.

The problem only appears recently because the step after setting the partner is usually fast enough
to detect the dropdown of the partner field before any text was entered, and so a partner in the
demo data was chosen instead, which has an email. This problem will be investigated in another
task.

closes odoo/odoo#108703

X-original-commit: b9e80c1403de0341a0c133a254142e53ef8c2842
Signed-off-by: Morgane Demesmaeker <edm@odoo.com>
2022-12-27 11:17:46 +01:00
Claire Bretton (clbr) 068f3edff9 [FIX] account,l10n_lu: Adds a migration for the l10n_lu that will get the latest taxes
All taxes change in Luxembourg, we added a script that will create or update taxes so the clients don't have to
manually update everything or ask the support to do it for them. We don't modify custom taxes.

closes odoo/odoo#108699

Task: 3098941
Related: #104833
X-original-commit: c44a33d67065e20c4ded2a229d0663191c91a0a0
Signed-off-by: William André (wan) <wan@odoo.com>
Signed-off-by: Claire Bretton <clbr@odoo.com>
2022-12-27 11:17:44 +01:00
dbkosky 8e20e965f0 [FIX] l10n_ke_edi_tremol: reduce command delay, fix abort message
The command delay on writing to the device is a little too prolonged.
After some testing it has been determined that this can be reduced to
by reading with the serial.read function (rather than read_all) when
we know the expected output length.

The serial read fuction accepts an integer describing how many bytes are
expected in the read buffer, and returns when the buffer is filled.

This has much better performance than waiting a fixed length of time,
and reduces the chance of getting an empty response (when the device
takes longer than expected to process the previous command).

The request sent when trying to abort was incorrect, the length byte was
too large by a value of 2. It has been corrected to be the length of the
message
i.e. LEN = 0x20 + len(<LEN><NUM><CMD>) = 32 + 3 = 35
where num is the serial message number

The error message for aborting the post was incorrect, stating the the
invoice had been cancelled when it was not successfully cancelled, and
vice versa. Loggers have also been added for the cancelling of the
invoice.

closes odoo/odoo#108629

X-original-commit: aaa0bbde8251e08feeb180fb14543ede7d05afa6
Signed-off-by: Josse Colpaert <jco@odoo.com>
Signed-off-by: Daniel Kosky (dako) <dako@odoo.com>
2022-12-27 11:17:41 +01:00
Alexandre de Pape (alpa) 7eb9d9716b [IMP] website_sale: change mandatory checkout labels
This commit changes the label of the checkout button if the user is not signed in and the option is mandatory.

Backport of odoo/odoo#103072

closes odoo/odoo#108470

Task: 2929654
X-original-commit: a7a2bc6abed07af40247e7e663d309bb0db3de36
Signed-off-by: William Braeckman (wbr) <wbr@odoo.com>
2022-12-27 09:23:02 +01:00
Touati Djamel (otd) 8e4e32ab01 [FIX] mrp: use the operation type set on the BoM in MO
Steps to reproduce the bug:
- Enable “Multi-Step Routes” option in the inventory settings
- Create a storable product “P1” with BoM:
    - Add any Component
    - Go to “Miscellaneous” tab
    - Create a new picking type and set in the “Operation” tab
- Create a Mo:
    - Add the product “P1”
    - Select the created BoM
    - Go to “Miscellaneous” tab

Problem:
The operation type set on BoM does not update when selecting the BoM
on a manufacturing order

opw-3091436

closes odoo/odoo#108632

X-original-commit: cd561574d044d4799163ac90305c7914855ead50
Signed-off-by: William Henrotin (whe) <whe@odoo.com>
Signed-off-by: Djamel Touati (otd) <otd@odoo.com>
2022-12-26 11:39:49 +01:00
amdi-odoo 2a015600b2 [FIX] web,auth_totp,base: fix 2FA views
Web:

Adding a css rule constraint to avoid the rule
from overwriting the o_field_highlight css class
applied on a field in a form view.

Base, auth_totp:

Adding the o_field_highlight class on the 2FA
form fields to display the input bottom border and
thereby more easily identify the fields.

Adding a placeholder to the 2FA password field.

Modifying the 2FA title and toggle font to keep
a consistency between the different page titles.

Task-3083540

closes odoo/odoo#108611

X-original-commit: c128a01490bbbcbf824781f5e8716aa30e65ba5b
Signed-off-by: Warnon Aurélien (awa) <awa@odoo.com>
2022-12-26 11:39:47 +01:00
Denis Ledoux 9b0aeca547 [FIX] auth_ldap: traceback during installation due to invalid view
This is an oversight in odoo/odoo#106425

`<div name="auth_ldap_right_pane">`
has been replaced by
`<setting ... id="oauth">`

But, in the `auth_ldap` module,
the view has not been adapted to replace the selector
`<div name='auth_ldap_right_pane' position="inside">`

Therefore leading to the below exception

```
odoo.tools.convert.ParseError: while parsing /home/odoo/src/odoo/master/addons/auth_ldap/views/res_config_settings_views.xml:3
Error while validating view:

Element '<div name="auth_ldap_right_pane">' cannot be located in parent view
```

This is most-likely because the runbot doesn't install `auth_ldap`
and therefore doesn't test it.

I take the opportunity of the commit to better name this setting
section, from `id="oauth"` to `id="module_auth_ldap"`,
first because "oauth" is not "ldap",
second to make the naming uniform compared to the other setting section
id names.

closes odoo/odoo#108530

Signed-off-by: Denis Ledoux (dle) <dle@odoo.com>
2022-12-26 11:39:44 +01:00
dbkosky 1d97d7f7b0 [FIX] l10n_ke_edi_tremol: To send to TIMS filter
It is important that users are able to filter by invoices that need to
be posted to TIMS

This commit adds that filter in the account move tree view.

closes odoo/odoo#108645

Task-id: 2950308
X-original-commit: e19f0f478331e3c63833e791db42413e5b5a6684
Signed-off-by: Josse Colpaert <jco@odoo.com>
Signed-off-by: Daniel Kosky (dako) <dako@odoo.com>
2022-12-26 10:39:13 +01:00
Ivan Yelizariev f59cea4521 [FIX] web: add missing binary class to domain_selector/fields
Domain widget has Components for every type of field to define list of available
operators, initial value, etc. However, class and template for some fields is
missing (e.g. for binary field).

This commit adds support for such fields via Default class. More specific
classes could be added later.

STEPS

* Activate Debug mode
* Open menu *User-defined Filters*
* Create a filter for `product.product`
* Select any binary field in the domain widget

opw-3084273

closes odoo/odoo#108631

X-original-commit: 3d0044046517690215625c92a6550fd6083fbd93
Signed-off-by: Michaël Mattiello <mcm@odoo.com>
Signed-off-by: Ivan Elizaryev (iel) <iel@odoo.com>
2022-12-26 10:39:10 +01:00
smdc-odoo f79630c7e5 [IMP] l10n_sg: Change the Goods and Service tax rate
Starting from 1 January 2023, the Goods and Services Tax rate (GST) will
change and go from 7% to 8%

task-3098705

closes odoo/odoo#108336

X-original-commit: b2ca5ca9dc5c7455ec545c46696c688e78b45ca6
Signed-off-by: Olivier Colson (oco) <oco@odoo.com>
Signed-off-by: Simon Morais Da Cunha (smdc) <smdc@odoo.com>
2022-12-26 10:39:05 +01:00
Pierre c539a9b214 [FIX] event_sale: division by 0 on price
When you have some order lines linked to a registration that have a
'product_uom_qty' equals to 0, you get a division by 0 error when you
try to get the 'sale_price' and the 'sale_price_untaxed'.

To avoid such issue, we are now checking if the 'product_uom_qty' is not
equals to 0 to avoid a division by 0. In the case it is equal to 0, we
consider that the 'sale_price' and 'sale_price_untaxed' are equal to 0
as nothing has been paid for this registration.

To reproduce you can do like this:
- create invite someone to your event
- create a SO with qty 1 and the price
- validate the SO and select the registration
- set product_uom_qty to 0 in the SO
- open the event dashboard (and remove the filter to get your event)

closes odoo/odoo#108653

X-original-commit: f0e8d30ac425241f42cbf7412b072502696d09c2
Signed-off-by: Masereel Pierre <pim@odoo.com>
2022-12-26 09:39:13 +01:00
momegahed 327ebf77ee [FIX] l10n_gcc_invoice: product name is not shown in arabic
Steps to reproduce:

-install l10n_gcc_invoice module
-switch to a company in Saudi Arabia (SA company)
-create and print an invoice with a product that has arabic translation

Bug:

in 880954ebfc

a change was introduced that causes the context on the fields
to be overridden by the env context

https://github.com/odoo/odoo/blob/16.0/odoo/addons/base/models/ir_qweb_fields.py#L120

this causes the arabic name `t-field` in this case to lose its context
along with the language information

Fix:

change it to `t-out`

OPW-3077547

closes odoo/odoo#108366

X-original-commit: 0113d8539334f76d364771deceb882714ddc36bb
Signed-off-by: Josse Colpaert <jco@odoo.com>
Signed-off-by: Mohamed Megahed Abbas Megahed SALLAM (mome) <mome@odoo.com>
2022-12-25 09:47:52 +01:00
Ethan Hildick 82c72b58f6 [CLA] Update Studio73 CLA
Update the emails of all members and incorporate several new members as Studio73's contributors.
I confirm we have signed the CLA and read the PR guidelines at
www.odoo.com/submit-pr

closes odoo/odoo#108621

X-original-commit: ca8f11c739d05dfc21651d7ff1a8bd4fa0fcc4db
Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2022-12-24 14:24:18 +01:00
Nshimiyimana Séna 68f1529490 [FIX] tools: set correct mimetype for XML files
Currently, the mimetype detection for XML files always returns
`image/svg+xml`.

opw-3062131

closes odoo/odoo#108644

X-original-commit: 6ea9e75d5a14cfe4a846be69e05c3c18f1daffcb
Signed-off-by: Julien Castiaux <juc@odoo.com>
2022-12-24 02:35:46 +01:00
Pierre Masereel 4ac3fbc5e9 [FIX] base: ir_attachment override traceback
When the _search method is called with, it passes this argument
to the other _search call in it con concatenate it with the
result. But when the count argument is true, it tries to take a sublist
of an integer which raise a traceback.

So we explicitly call it with count=False

closes odoo/odoo#108634

X-original-commit: 5c12edb989a044d35e8be93b40fdc0e3a66379ed
Signed-off-by: Julien Castiaux <juc@odoo.com>
2022-12-24 02:35:43 +01:00
Arthur Detroux (ard) 7c66694cdb [FIX] website: add a test on snippet cache
The last two parent of this commit introduced fixes towards the Snippet
Cache, more specifically, the snippet cache according to the snippet
language.

Commit [1] introduced a Snippet template "Cache" that keeps the snippet
templates in memory throughout multiple instantiation of the
SnippetsMenu. Unfortunately, while this improved performance, it also
introduced bugs where the cache was not properly cleared. Starting
the edition in translate mode, then switching back to master edit mode
would sometimes lead to the Snippets being loaded in the wrong language.

The parent commits fix that but this one introduces a test to make the
snippet cache and translation more robust.

[1]: https://github.com/odoo/odoo/commit/03c552690b15cbf2e7d6b7812386ac64042219af#diff-52a4f9d2c217548e69e6b7fd097f286f1754a6389734eea254b87255e501cbefR18

closes odoo/odoo#108643

X-original-commit: a066dc8319cc9c204656a25af16fc78ae618cd71
Signed-off-by: Romain Derie (rde) <rde@odoo.com>
2022-12-23 21:19:51 +01:00
Arthur Detroux (ard) 8d48efeece [FIX] web_editor: add snippet_lang as a template cache context key
In commit [1] it was decided that the Snippet Menu would have its UI in
the user's language, while the Snippets' Content would be in the
language of the website they are currently editing. To do so, a new
context key was added: Snippet Lang.

Unfortunately, while Odoo handles the compilation according to a
language, website_id and more, it does not do so according to the
snippet lang.

It would not be an issue if the Snippets were compiled only in edit
mode, as a Website only has one default language. Unfortunately the
Snippet Content is also rendered in translate mode (Since the
SnippetMenu is one big XML template), therefore it can be rendered in
different Snippet Lang (though it's useless).

This commit fixes that by adding Snippet Lang as a cache key so that if
the key is present, it will re-compile the template.

Steps to reproduce:
- Create a new language
- Translate a snippet (e.g. search s_cover view and translate contact
 us)
- Create a new website with 2 languages, the new language as default and
 english
- Enter translate mode
- Leave it
- Enter edit mode via the "Edit master" button
- Drop the translated snippet
- It will not be translated because the Snippet Menu was rendered in
English first.

A commit introduced after this one will test these steps.

[1]: https://github.com/odoo/odoo/commit/55a978aa86967581956f855a1c5db33b7425bd15

X-original-commit: 6eba6203e9f1b8a730ab53f80fea8e7b78818bc7
Part-of: odoo/odoo#108643
2022-12-23 21:19:51 +01:00
Arthur Detroux (ard) 0e73a5308a [FIX] website: invalidate snippet cache when changing language
Commit [1] added a snippet template cache so that if a user changes
pages on their website, they do not need to fetch the SnippetMenu from
the server again.

Unfortunately that commit added a few side effects that commit [2] tried
to fix since commit [3] made them apparent. However, there is still one
broken flow:

- Create a website with 2 languages, e.g. English (primary) and French.
- Visit the website in French and enable translate mode
- Save and click on the "Edit in Master" button
- Drag and drop a Snippet
- The Snippet is in the translated language

This commit fixes this broken flow by clearing the snippet cache when
changing the language of the website.

[1]: https://github.com/odoo/odoo/commit/03c552690b15cbf2e7d6b7812386ac64042219af#diff-52a4f9d2c217548e69e6b7fd097f286f1754a6389734eea254b87255e501cbefR18
[2]: https://github.com/odoo/odoo/commit/bb503962a36f3798c50049f2844e7b288b632955
[3]: https://github.com/odoo/odoo/commit/55a978aa86967581956f855a1c5db33b7425bd15

task-2687506

X-original-commit: eb214e1feb677c5061f9c034f3c4421a2109af2f
Part-of: odoo/odoo#108643
2022-12-23 21:19:50 +01:00
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