Commit Graph
156230 Commits
Author SHA1 Message Date
Julien Castiaux ec4826ef5b [FIX] core: session logout after 16.0 migration
Create a 15.0 database with website, access the home page via your
browser. Stop the server and migrate the database to 16.0. Restart the
server with a `--dbfilter` that rejects the database you created and
refresh your browser. 500 Internal server error, attribute error:
the `request` object as no `session`.

An error could occurs after a migration to 16.0 due to the presence of
the `geoip` key in the session. `request.session.geoip` has been made a
deprecated alias to `request.geoip` between 15.0 and 16.0, see 04e9726.

Because the session was created before 16.0, the session dict does
contain a `geoip` key. Upon logging the session out, the session dict
is cleared. The default implementation of `clear()`[^1] inside of
`collections.abc.MutableMapping` can be summarized for our usecase to:

    for key in self:
        value = self[key]
        del self[key]

There is an extra `__getitem__` call due to `value = self[key]`, in the
case of the `geoip` key, it would access the alias. It is not possible
to accessing that alias inside of the `_get_dbname_and_session` method
of request as the session has not been set on `self` (the request) yet.

Yet inside of that method, we do `session.logout()` which `clear()` the
session which (wrongly) access the alias because `geoip` exists in the
internal dict (`'geoip' in self.keys()  # True`).

The solution has been to implement the `clear()` function ourself
instead of using the mixin of `MutableMapping`.

[^1]: https://github.com/python/cpython/blob/b43496c01a554cf41ae654a0379efae18609ad39/Lib/_collections_abc.py#L925-L931

closes odoo/odoo#105763

X-original-commit: b66e1ffa8e348eedf2de735babbc398290a8bffb
Signed-off-by: Julien Castiaux <juc@odoo.com>
2022-11-15 18:25:40 +01:00
Benjamin Vray 48ae46cb22 [FIX] website: fix language switcher in off-canvas menu
Since this commit [1], the header language switcher has been moved out
of the header navbar. This created a bug, when the off-canvas option of
the navbar is activated, the language switcher is no longer accessible
on mobile.

As this commit is in stable version, the fix is only in Javascript. It
puts the language switcher back in the navbar when the off-canvas menu
is opened.

A specific case with the "hamburger full" header template, where there
is the same bug with the "call to action" button, is also fixed by this
commit.

This commit also fixes display issues in the off-canvas menu.

[1]: https://github.com/odoo/odoo/commit/2a000e33c5a44ddf0a777b43d8266cc413d8e4e2

opw-2964824

closes odoo/odoo#105504

X-original-commit: b89dbb2e18c4ccebcd72e87758b5d3363ed875b3
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2022-11-15 18:25:24 +01:00
fdardenne 4edbe54456 [REM] web: qweb views
QWeb views allowed to render QWeb templates rendered by the server in
a view.

Today, QWeb views are only used in website to see the hierarchy of
their views. The use case of website has now more sense in a client
action rather than an extension of a QWeb view.

This commit removes this view because it is not used anymore and will
probably not find any useful use case in the future.

closes odoo/odoo#103477

Related: odoo/upgrade#4016
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2022-11-15 18:25:12 +01:00
fdardenne 439db9eaeb [REF] website: view_hierarchy: refactor to client action
Before this commit, `view_hierarchy` extended the QWeb view to see
the hierarchy of views.

With the evolution of the javascript framework, this use case has
now more sense in a client action rather than an extension of a
QWeb view.

This commit refactors `view_hierarchy` into a client action.

Part-of: odoo/odoo#103477
2022-11-15 18:25:12 +01:00
Audric Onockx (auon) c513b57c3e [IMP] hr_timesheet: populate
task-3030132

closes odoo/odoo#103426

Signed-off-by: Laurent Stukkens (ltu) <ltu@odoo.com>
2022-11-15 18:25:08 +01:00
Chong Wang (cwg) dc15f81d08 [IMP] core: new comments for translations
before this commit:
If a translation is used for web client, the translation has comment
'openerp-web'.

after this commit:
If a translation is used for web client, the translation has comment
'odoo-javascript'
If a translation is used for python, the translation has comment
'odoo-python'

PO/POT files with old comments still works. The only overhead is: translation
only for web client will also be stored as code translation for python.

closes odoo/odoo#105764

X-original-commit: 13a5fa56ac7a102ad38f7ecc11874786bdb2fe85
Signed-off-by: Wang Chong (cwg) <cwg@odoo.com>
2022-11-15 16:16:54 +01:00
Chong Wang (cwg) 424774e081 [FIX] core: fix export web client translations
before the commit: web client code translations cannot be exported in the po.

If a web client only translation (not used for python translation and has
comment openerp-web) has its translation in the po file of /i18n, when it is
exported in a po file from Settings -> Translations -> Export Translation,
its corresponding translation is missing.

after this commit: web client code translations can be exported in the po.

X-original-commit: c2bf7665363b988d7c7e8bff43e71b7b1097ad84
Part-of: odoo/odoo#105764
2022-11-15 16:16:54 +01:00
Philippe Wauthy 347dd08342 [FIX] hr_contract: add group on contract_id field
Add the hr_contract.group_hr_contract_employee_manager group on the contract_id field in hr_employee
to avoid having an access error once a user with Manager security group in Payroll tries to open the
Payroll app.

task-3053032

closes odoo/odoo#105753

X-original-commit: fa1b4f14257ca04c85c7541fd94b19dff939626c
Related: odoo/enterprise#33942
Signed-off-by: Kevin Baptiste <kba@odoo.com>
2022-11-15 16:16:48 +01:00
Nshimiyimana Séna 90b73796bc [FIX] web: fix copying markup object to clipboard
### Steps to reproduce
* install Live Chat (`im_livechat`)
* Go to Live Chat > click any channel
* Under Widget, Click the copy button for the first link

If you're on firefox, nothing will happen (text won't be copied).
On chrome, you will get a traceback saying `Failed to execute 'write' on
'Clipboard'`.

### Expected behavior
The text should be copied to the clipboard, and a tooltip should appear
to confirm that.

opw-3058357

closes odoo/odoo#105756

X-original-commit: 977f5aacf46c3746380dda33585b407df659e07d
Signed-off-by: Luca Vitali <luvi@odoo.com>
2022-11-15 13:01:40 +01:00
Nshimiyimana Séna f1eb3b9d42 [FIX] website_sale: register the website_sale.FieldVideoPreview template
### Steps to reproduce
* install `website_sale` (eCommerce)
* go to any product's form view
* in the 'Sales' tab, click `ADD A MEDIA`
* fill the 'Video URL' field and save

You should be met with a traceback saying that the template
`website_sale.FieldVideoPreview` is missing.

opw-3057118

closes odoo/odoo#105755

X-original-commit: 9cbb0ab0bafa4e05673862d601a7b089bbd2b519
Signed-off-by: William Braeckman (wbr) <wbr@odoo.com>
2022-11-15 13:01:38 +01:00
niyasraphy bdd47f07ef [FIX] mail: add a placeholder on language selection
Add a placeholder to beautify the UX of mail preview wizard. Field is currently
a bit hard to sport with the new UI.

closes odoo/odoo#105751

X-original-commit: fd5a5bc38bad09e3e8e99ff22e64a5dda60e32aa
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2022-11-15 13:01:35 +01:00
niyasraphy 868f40a9f9 [FIX] mass_mailing: typo in closing tag
closes odoo/odoo#105605

X-original-commit: 19f42ec08780c889a3ee25db4092a5ed78051722
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2022-11-15 13:01:32 +01:00
FrancoisGe a882b725bb [REF] web: adds the callback onWillSaveRecord and onRecordSaved
The purpose of this commit is to add extension points that allow code
to be executed before and after the save of a record.

CallBack:
    onWillSaveRecord is a callBack that will be executed before the
        record save if the record is valid if the record is valid.
        If it returns false, it will prevent the save.

    onRecordSaved is a callBack that will be executed after the save
        if it was done. It will therefore not be executed if the record
        is invalid or if a server error is thrown.

This commit will replace all the save overrides by the onWillSaveRecord
and onRecordSaved callBack.

Observed problem:
We could notice that each of the overrides of save in order to execute
for example a doAction after this one did not take into account the fact
that the save did not succeed.
For example, a required field is invalid and we try to save, then the
doAction will be executed without the "write" of the save.
The callBack onRecordSaved will prevent this common error.

closes odoo/odoo#105180

Related: odoo/enterprise#33710
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2022-11-15 13:01:29 +01:00
Xavier Morel d4f8f7ece6 [IMP] core: handling of the form tour checker
`DOM.querySelector` will generally return a `nodeId` of 0 when no node
is found, however there is a small window during which the document
can apparently get collected (?), which leads to an error

    Could not find node with given id

which can break otherwise successful builds (cf 20832402 / staging
60731).

Handle errors from the pipeline as if the node had not been found,
though the matter was not fully investigated so it's possible this
explanation is incomplete or incorrect.

The CDTP documentation does not document the failure modes for either
`DOM.getDocument` or `DOM.querySelector`.

closes odoo/odoo#105734

X-original-commit: 5ef975f75cf8044e7dcd67f403ca11058630c85a
Signed-off-by: Xavier Morel (xmo) <xmo@odoo.com>
2022-11-15 11:38:43 +01:00
anhe-odoo 51751665f2 [FIX] spreadsheet: fix getFiltersMatchingPivot for no records
Task Description :

When right-clicking on a cell in a pivot with no matching records
and a positional argument, we get the following exception :

TypeError: Cannot convert a Symbol value to a string

This is coming from the fact we try the get the nth records
associated to the positional argument, but in a case where
there is no associated records.

Reproducibility:

This issue can be reproduced with the following steps :
1. Open a pivot
2. Change some cell to add a positional argument
3. Set a filter so that no related records can be found
4. Right-click on the previously changed cell

Related Task:

task-3009982

closes odoo/odoo#105733

X-original-commit: 4595bed9493b0b4b9a3c5f5ff14a71a9cd59ad95
Signed-off-by: Pierre Rousseau (pro) <pro@odoo.com>
2022-11-15 10:34:18 +01:00
niyasraphy 990ce0331b [FIX] delivery: show only delivery apps and translatable string
closes odoo/odoo#105726

X-original-commit: 9572e0a0410787ac60aeeb3996b4044f7d7eda22
Signed-off-by: Arnold Moyaux (arm) <arm@odoo.com>
2022-11-15 10:34:15 +01:00
Solan Delvenne (sode) 93fb62edb1 [IMP] snailmail: Send an error when using non-A4 paperformat.
Since the provider only accepts A4 letters, prevent the user from using
non A4 formats by giving them an error when clicking the Send button.

closes odoo/odoo#105725

X-original-commit: 452882f4534cb55546bcf19e93390067e1337f6f
Signed-off-by: Florian Daloze (fda) <fda@odoo.com>
Signed-off-by: Solan Delvenne (sode) <sode@odoo.com>
2022-11-15 10:34:12 +01:00
Adrien Widart 18e1b19880 [IMP] barcodes_gs1_nomenclature: add test
Add test for 8cdcc933ca

OPW-2930873

closes odoo/odoo#105441

Signed-off-by: Steve Van Essche <svs@odoo.com>
Signed-off-by: Adrien Widart <awt@odoo.com>
2022-11-15 10:34:04 +01:00
Rémi Rahir 1a9f6aa421 [FIX] spreadsheet: Fix model/table structure
Since the revamp of the pivot datasource (Odoo task 2779455),
The data stored in the pivot table did not match the format of the
pivots formula arguments. I.E.
A formula mays contain arguments  under stringified version or not
```
=PIVOT("1","field","false", "m2m_id", "42")
```
or
```
=PIVOT(1, "field", "false", "m2m_id", 42)
```
but they are stored in their non-stringified version in the table.
Going from stringified to the original value is not possible, we
therefore now store the stringified values in pivotTable and
stringify the formula arguments when required.

Task 2946479

closes odoo/odoo#105732

X-original-commit: ad0b24cb7b80c22c57091254d4161326fbc07adf
Related: odoo/enterprise#33934
Signed-off-by: Pierre Rousseau (pro) <pro@odoo.com>
2022-11-15 09:31:48 +01:00
Prakash Prajapati 56d2ba4f85 [REM] sale_timesheet: remove the allocated hours compute method in project
task-2955983

closes odoo/odoo#105730

Signed-off-by: Xavier Bol (xbo) <xbo@odoo.com>
2022-11-15 08:34:19 +01:00
Andro Gvivradze a6ce0597c8 [FIX] event, website_event: fix event tours
Due to owl conversions the namings of few buttons changed,
thus event_tour and website_event_tour were broken. Commit fixes this issue.
At the same time, test didn't understand the change with datepicker in input
field. Now test moves to next stage whenever the date input field is clicked,
and I added "apply change" step to event_tour to make sure that user saves
their changes.

Task-3060511

closes odoo/odoo#105724

X-original-commit: 10a2cf33c00915a26a473411793e9d20af86a2ac
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2022-11-15 00:18:02 +01:00
Julien Castiaux ebe2516a44 [FIX] base: unlink request.cr after rpc db drop
Start odoo on a specific database, e.g. 'db-example'. Drop it via JSON
or XML RPC. The database is successfully dropped but the RPC fails with
a traceback because it attempts to commit on a database that doesn't
exist anymore.

    import requests

    admin_passwd = ...
    requests.post(
        'http://127.0.0.1:8069/jsonrpc',
        json={'params': {
            'service': 'db',
            'method': 'drop',
            'args': [
                admin_passwd, 'db-example'
            ]
        }}
    )

Closes odoo#104527

closes odoo/odoo#105710

X-original-commit: b6e195ccb3a6c37b0d980af159e546bdc67b1e42
Signed-off-by: Julien Castiaux <juc@odoo.com>
2022-11-15 00:17:59 +01:00
Julien Castiaux 6b0e54ca4c [FIX] base, web: missing borrow_request() for db
The new `borrow_request()` function has been introduced to properly
separate the HTTP layer from the RPC layer. We forgot to protect some
RPC endpoints, mainly inside of `odoo.addons.web.controllers.database`.

This commit moves `odoo.service.dispatch_rpc` to `odoo.http` as we only
permorm RPC from the controllers and that we don't want to import
`borrow_request` inside of `odoo.service` (circular import).

X-original-commit: d0ee8615d8820e02232989c50a6e6ffbc66a9266
Part-of: odoo/odoo#105710
2022-11-15 00:17:59 +01:00
Prakash Prajapati 58b743b28d [FIX] project: fix the traceback when we created task from project sharing
Reproduction steps:
     - Install project module
     - Create project and task
     - Share the project
     - Open the  portal
     - Open the project sharing list view
     - Create a new task

Before this fix:
      traceback occurs when we create task from project sharing.

Why traceback occurs:
    In `portal_chatter_init` route both res_id and res_model are mandatory.res_id
    is undefined during a task created from project sharing.

task-3012469

closes odoo/odoo#105392

X-original-commit: 2c2b7d94bbbe6f785c68bb6a479bc1aa4eceb668
Signed-off-by: Xavier Bol (xbo) <xbo@odoo.com>
2022-11-15 00:17:56 +01:00
Pallavi Savaliya 826d6cf5a6 [IMP] sale_timesheet: prevent recompute allocated hours of project
Before this commit, the allocated hours of a project are set when
the linked sale order are confirmed. And then, the project manager
can change the allocated hours. However, if the sale manager
changes a qty in the sale order, then the allocated hours of
the project are recomputed according to the changes made in the
sale order and so the allocated hours set by the project manager
are erased.

This commit removes the compute of allocated hours and so only
the default value computed when the linked sale order is
confirmed are set to the allocated hours field of the project.

task-2955983

closes odoo/odoo#105727

X-original-commit: 318c07ec1e12940434d83b84d58603b1e69f9b14
Signed-off-by: Xavier Bol (xbo) <xbo@odoo.com>
2022-11-14 22:14:49 +01:00
Prakash Prajapati 3a1afcc20a [FIX] project: filter projects for Late Milestones filter
Before this commit, when the user uses the `Late Milestones`
filter in the project views, all the projects in the views
are used, but some projects could have the feature disabled
and so those ones should be ignored in the filtered.

This commit filters the projects to only apply the filter
on those projects and not also the ones without the feature
enabled.

task-3033041

closes odoo/odoo#105709

X-original-commit: e8ee1e370ec3c6b4bc13d0d5da6b242af1e9b9c3
Signed-off-by: Xavier Bol (xbo) <xbo@odoo.com>
2022-11-14 18:17:52 +01:00
Prakash Prajapati e2b52e6358 [FIX] project: hide "Milestone" action button in project kanban card
Before this commit, when the Milestones feature is globally enabled
in the project app, the "Milestones" action button displayed in the
dropdown of the kanban card are always visible even if the project
has the feature disabled in its settings.

This commit changes the visibility of that action button to also
take into account the settings of each project.

task-3033041

X-original-commit: 05485bbd192c2316267d38934544d7f08ff4e9e8
Part-of: odoo/odoo#105709
2022-11-14 18:17:52 +01:00
Sébastien Theys c0f78e9d27 [IMP] base, web, mail: clean and move notification_alert
The code does not actually depend on mail features and it is intended to be used
in the base form view of user.

closes odoo/odoo#105415

Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2022-11-14 18:17:49 +01:00
Bastien (bvdn) 0a23462728 [IMP] project: improve user experience
This commit introduces the following improvements:

- In `My Tasks` list view: the personal stage is displayed instead of the stage for private tasks
- When copying a stage, the new stage name is appended with `(copy)`
- A default filter 'open task' is added in the subtask notebook search
- A default filter on the project is set on the search of the `parent_id` task field

task-3024152

closes odoo/odoo#103318

Signed-off-by: Laurent Stukkens (ltu) <ltu@odoo.com>
2022-11-14 18:17:44 +01:00
Nicolas (vin) 9168a8e73b [FIX] website_sale: make add_to_cart_snippet_tour run as expected
Add a setUpClass with a dummy payment provider to ensure that at
least one is always available when the tour is running, and set
the company country_id to None before starting the tour to avoid
any country dependant fields to block the tour during the checkout
process.

closes odoo/odoo#105700

X-original-commit: 779965fbf0471f2b003692f1afa541864a396651
Signed-off-by: William Braeckman (wbr) <wbr@odoo.com>
Signed-off-by: Nicolas Viseur (vin) <vin@odoo.com>
2022-11-14 17:18:11 +01:00
niyasraphy 08094099dc [FIX] hr_presence: wrong config key in get_param method
closes odoo/odoo#105699

X-original-commit: c3706f5caeb7cd8caeb0c58e253e31de1822d03e
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2022-11-14 17:18:02 +01:00
Julien Castiaux 1219f043fe [FIX] http_routing: should redirect only for multilang
Define a route that is website but not multilang, e.g.

    @route('/example', website=True, multilang=False)

Login to the frontend, change the website lang to another (non-default)
lang (e.g. install french, keep english as default lang, log in the
french website) then access the '/example' controller by typing it
directly in your address bar.

You are being redirected to '/fr/example', you should not.

This commit restore the behavior pre-httpocalypse, that is the address
is kept as-is.

Note: in the comment, the 4th and 5th cases were inverted, we use this
commit as an opportunity to reorder the two.

closes odoo/odoo#105686

X-original-commit: be7a02917a66136a8d3b601d61a898b0419ff79d
Signed-off-by: Julien Castiaux <juc@odoo.com>
2022-11-14 17:17:59 +01:00
Hed Shefer 930b2f015e [IMP] l10n_il: improve CoA, fiscal positions, taxes and translations.
* Fix wrong translations for taxes, accounts and tax groups.
* Remove auto_apply for fiscal position israel, because partner from israel can also lead to other fiscal positions (self invoice, eilat,etc).
* Remove the duplicate account Income tax withheld - customers

closes odoo/odoo#105676

X-original-commit: 2e21514eeaabd00aadd80355ccc327667a2c4d14
Signed-off-by: Josse Colpaert <jco@odoo.com>
2022-11-14 17:17:53 +01:00
Ahmed Khalaf ead2e5e964 [IMP] stock: json widget no longer changes props
This commit changes the json widget to no longer edit the `props` of the
component as it might cause reactivity issues.

closes odoo/odoo#105663

X-original-commit: eb4ae1d79c455b1b9e163beebb98fb1935834194
Signed-off-by: Arnold Moyaux (arm) <arm@odoo.com>
2022-11-14 17:17:50 +01:00
Audric Onockx (auon) 76b513917b [IMP] web,project: add and modify commands in the palette
\- Add 'Move to next stage'
Generic, we think it is a useful tool to have anywhere.

\- Change the 'Set priority...' command
to 'Set priority as Low/High' :
Only 1 command will be available with the 'not current' priority.
Specific, because it is used on selection fields,
which means there could be more than 2 options.

\- Transform the 'Set kanban state...' command into three commands
Generic. 2 commands will be available.
One for each 'not current' kanban state.

task-2857447

closes odoo/odoo#91821

Signed-off-by: Laurent Stukkens (ltu) <ltu@odoo.com>
2022-11-14 17:17:47 +01:00
FrancoisGe 1c5fe423f2 [IMP] web: add isAvailable in options command
This commit adds the isAvailable option to the command. If you set this
option, then it determines if the command should be displayed or not
in the command palette.

Why add this option?
We want to allow a component to define a command that will be displayed
according to the internal state of the component

Part-of: odoo/odoo#91821
2022-11-14 17:17:47 +01:00
FrancoisGe 0340769af2 [FIX] web : indeterministic crash in Many2ManyTagsField tests
The goal of this commit is to fix indeterministic crashes
in Many2ManyTagsField test suite.

We could see that the wrong helper was used in some tests. We used
selectDropdownItem after an editInput on this same field.

Cause of the error:
editInput => event input debounce which causes the autocomplete to open.
selectDropdownItem => event click which causes the autocomplete to open.
                     After this event, a second click takes place to
                     select the dropdown item (call to clickOpenedDropdownItem).

The setTimeout is not patched, it is possible that the input event takes
place after the click which does not cause any crash. But if the click
event happens after the input then the autocomplete is closed before
the dropdown item is selected.

To solve this, we will patch the setTimeout and we will use only
clickOpenedDropdownItem to select the dropdownItem.

We also patched the setTimout in all tests to avoid indeterminate
behavior related to the debounce in the autocomplete input.

closes odoo/odoo#105693

X-original-commit: 36f6e6801166865e0c8047c1c2be43ef8826581f
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2022-11-14 16:21:59 +01:00
FrancoisGe 473c4817e1 [FIX] web: test: ensure to wait for dialog to be opened
Before this commit, the modified test sometimes failed on runbot.
We need to wait for an extra tick, because the dialog might be
rendered in another animation frame that the crashing client
action.

X-original-commit: fb73b9f08fbb315544b3a4fce727a4bf2fbaa1bc
Part-of: odoo/odoo#105693
2022-11-14 16:21:59 +01:00
niyasraphy 46d015abd8 [FIX] crm_sms: remove unused models directory
crm_lead.py file does not exist, but models directory is not imported. We
can safely remove the init and the models directory.

Oversight of odoo/odoo@5d4208d44d

closes odoo/odoo#105690

X-original-commit: cf857b86b2073d1e83a5e3e5b009d67058116b69
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2022-11-14 16:21:55 +01:00
Joseph Caburnay 7b61eefc0e [FIX] web: should keep background of folded column
**Issue:**

When moving a record in a kanban view from one column to another,
it is possible to keep holding the record, hover it in one column
for a moment, then move again to another column then eventually
drop the record. Doing this where a folded column is the intermediate
column results to visual issue, such that the darker highlight of
a folded column is lost.

The desired behavior is to keep the background color of a folded
column.

**Solution:**

When moving a record, the hovered column is highlighted, and right
after leaving the column, we remove the highlight. And we are doing
this without exempting the folded column, thus, its darker highlight
is lost during the record-moving-hovering process.

Instead of adding/removing .bg-100 during unhover/hover on each
kanban column to make sure of the "greenish" tint of the column when
hovered, we just make background of the .o_kanban_hover to be important.

closes odoo/odoo#105689

X-original-commit: fdd7f017c73718c9582256dde3124dd2655aeb01
Signed-off-by: Julien Mougenot (jum) <jum@odoo.com>
Signed-off-by: Joseph Caburnay (jcb) <jcb@odoo.com>
2022-11-14 16:21:52 +01:00
miad-odoo 7a5ee6e6f9 [FIX] crm: add user_company_ids to tree view
Before this commit, when using the `many2one_avatar_user` on the `user_id`
field of the crm tree views, an error was thrown because the domain of `user_id`
refers to  `user_company_ids` which the view did not have access to, so it
wasn't yet computed.

The field was added in invisible to the tree views so that it can be computed
before being accessed.

Task-3053146

closes odoo/odoo#105688

X-original-commit: 558607d98798d6a55adbcd98a6648a888286c3c9
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2022-11-14 16:21:49 +01:00
FrancoisGe aaefe77c95 [FIX] *: override save checks that the save is valid
The goal of this commit is to avoid the execution of code depending
on the validity of the save of a Record.

Before this commit, several override save functions in Record execute
code after the record's save without checking if the record's save has
taken place.

Override before:
export class NewRecord extends Record {
    async save() {
        const isSaved = await super.save(...arguments);
        // doAction
        return isSaved;
    }
}

Override after:
export class NewRecord extends Record {
    async save() {
        const isSaved = await super.save(...arguments);
        if (isSaved) {
            // doAction
        }
        return isSaved;
    }
}

How to reproduce the problem:
    Go to a form view with a Record having its save override function.
    Edit a record in such a way to have an invalid field
    Click on the save button

Before this commit:
The doAction is executed

After this commit:
The doAction is not executed

Real use case
- Go to the form view of a lead in CRM
- Change stage
- Clear the name field
- Click on save button

Before this commit:
A call to get_rainbowman_message is made

After this commit:
No call to get_rainbowman_message is made.

closes odoo/odoo#105687

X-original-commit: 46b93da545b52496196624712c44599fd6467f4e
Related: odoo/enterprise#33913
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2022-11-14 16:21:44 +01:00
Gert Pellin 1d9dd51913 [CLA] Add CLA for gert@pellin.be
closes odoo/odoo#105679

X-original-commit: 987137dc911c9ff525bf06a39b15e0ba35172c8c
Signed-off-by: Victor Feyens (vfe) <vfe@odoo.com>
2022-11-14 16:21:41 +01:00
Alexandre Kühn b0116e4523 [IMP] web, mail: add mail module to prettier and linter
closes odoo/odoo#105677

Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2022-11-14 16:21:39 +01:00
Antoine Vandevenne (anv) 424b77b6a8 [FIX] payment_adyen: update translatable terms
closes odoo/odoo#105664

X-original-commit: e0c16914d7602763b52a2b76c2e120b85927c42c
Signed-off-by: Antoine Vandevenne (anv) <anv@odoo.com>
2022-11-14 16:21:36 +01:00
Ivan Yelizariev 8b027b69ce [FIX] payment_adyen: add missing fields to api call
It's needed to use "Automatic Risk assessment" feature in Adyen.

Technical docs:
https://docs.adyen.com/risk-management/configure-manual-risk/required-risk-field-reference

opw-3004646

X-original-commit: a8a166086b41692af49e0a9d4c44c0afdc0e05d4
Part-of: odoo/odoo#105664
2022-11-14 16:21:36 +01:00
Benoit Sociasandqsm-odoo fc61a2da5a [IMP] base: advertise view's active behavior in <template> vs <record>
Upon updates, the `active` field of `ir.ui.view` behaves differently
depending on whether the view is defined by using the `<template>` tag
or the `<record>` tag.

When using `<record>`, it behaves like any other field and gets updated
with the new value (notice that for qweb view, you should rarely rely
on this as if users customized those views with the website builder,
they are duplicated (COW)... updating the active field without migration
script would then be a source of errors).
When using `<template>`, it is not updated since [1], except for new
records since [2].

This commit adds a comment to the `active` field to help developers find
out about this difference.

See this [discussion].

[1]: https://github.com/odoo/odoo/commit/2d296cb77922d33be2dc45b900191fac34bda429#diff-175c28787c272a219b9275f79262a48af9aa029e718f45077fd609737559e84eR803-R804
[2]: https://github.com/odoo/odoo/commit/f1c70d4cc943ac4eb81a85a9dc005de34cd2060a#diff-175c28787c272a219b9275f79262a48af9aa029e718f45077fd609737559e84eR801-R804
[discussion]: https://github.com/odoo/odoo/pull/104836#discussion_r1013155860

Related to task-2963840

closes odoo/odoo#105647

X-original-commit: 454a47fdc1583bb7f77708e483606782743537b2
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
Signed-off-by: Benoit Socias (bso) <bso@odoo.com>
Co-authored-by: qsm-odoo <qsm@odoo.com>
2022-11-14 16:21:29 +01:00
Ivàn Todorovich 382d6924b8 [IMP] core: remove useless mapped call when calling filtered with a str
The mapped call is supposed to populate the cache, but that's already
taking care of by prefetching. It ends up adding an overhead instead.

The perf improvement is more noticeable on large recordsets.
For example, on a database populated with 100k res.partner records.

Before:

.. code-block:: python

    partners = env["res.partner"].search([])
    partners.filtered("name")  # warm up
    timeit.timeit(lambda: partners.filtered("name"), number=10)
    # result: 7.15

After:

.. code-block:: python

    partners = env["res.partner"].search([])
    partners.filtered("name")  # warm up
    timeit.timeit(lambda: partners.filtered("name"), number=10)
    # result: 4.67

closes odoo/odoo#105350

Signed-off-by: Rémy Voet <ryv@odoo.com>
2022-11-14 16:21:24 +01:00
Benoit Socias 5c08d0a47c [FIX] website: not mention "model" in tooltip
This commit updates the tooltips of disabled form field's duplicate &
remove buttons so that they do not reference the concept of "model".

task-2950433

closes odoo/odoo#105278

Signed-off-by: Romain Derie (rde) <rde@odoo.com>
2022-11-14 16:21:21 +01:00
jbw-odoo 82249b1c04 [FIX] account_edi: tax round globally
Prevent "per line" rounding taxes when tax rounding method is round globally.

Manual fwd port of https://github.com/odoo/odoo/commit/46504495664be211cf2ddbf2fa7532c022b1e5f0

closes odoo/odoo#105662

Task: opw-2963947
X-original-commit: c2b8ab136a5df4d70274d4abc5ceb14fa88b4149
Signed-off-by: Laurent Smet <las@odoo.com>
Signed-off-by: de Wouters de Bouchout Jean-Benoît (jbw) <jbw@odoo.com>
2022-11-14 15:21:26 +01:00