Commit Graph
153229 Commits
Author SHA1 Message Date
luvi fbfbcb15fb [FIX] web: remove padding of StateSelection
This commit removes vertical padding of the dropdown
toggler used in the StateSelection field widget converted
to Owl recently. In a list, it was causing an unexpected
 higher row.

closes odoo/odoo#98718

Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2022-08-23 17:55:44 +02:00
Ivan Yelizariev f478362f52 [FIX] website_sale: keep "sorting by" on searching by attributes
Searching by attributes works via a separate form. It has a copy of other search
parameters (`category`, `search`), but not `order`.

STEPS

1) enable View "Products Attribute's Filters" in eCommerce
2) enable View "Show Sort by" in eCommerce
3) Set sorting to specific value
4) Change Product Filters Attribute values
5) as you can see, the sorting set in Pt3 is lost....

opw-2956280

closes odoo/odoo#98716

X-original-commit: 7e9afa3f167bd3251984c2027fb50f127bc002c2
Signed-off-by: Ivan Elizaryev (iel) <iel@odoo.com>
Signed-off-by: William Braeckman (wbr) <wbr@odoo.com>
2022-08-23 17:55:38 +02:00
William Braeckman bb4324a69e [FIX] base: fix t-field with empty value/default value
Since odoo/odoo#97347 we support default values for `t-field`
directives.
However this causes some issues in the case where we have: no value, no
default value AND force_display is true.
This is because the indentation for one of the lines in the compiled
code was not correct. (full explanation here: https://github.com/odoo/odoo/pull/97347#issuecomment-1222430659)

closes odoo/odoo#98714

X-original-commit: 2b605d3ccd55dc4f5b1ad44439411542e5b04b31
Signed-off-by: Rémy Voet <ryv@odoo.com>
Signed-off-by: William Braeckman (wbr) <wbr@odoo.com>
2022-08-23 17:55:35 +02:00
Louis Wicket (wil) 381c0f0228 [IMP] mail: model_field: use this.model instead of record.constructor
Since be0fc43bbd0664340d555f2156630870e3548466, a reference to the model
is passed to ModelField constructor. This commit replaces all occurrences of
record.constructor with this.model (shorter and more straightforward).

closes odoo/odoo#98687

Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2022-08-23 17:55:31 +02:00
FrancoisGe 211a38b4b0 [FIX] web: ReferenceField with model_field option
Before this commit, if we have a reference field with a "model_field" in
X2many in list mode and we modify this record, then the value of the
reference field is set to false.

Cause of the problem:
The reference field assumes that the preloadedData are always available.

How to reproduce :
- Go to an x2many in list mode containing a reference field with a
 "model_field" already containing a value
- edit another field than the reference
- click outside the record

Result before :
The record switches to readonly mode and its reference field contains
the value false

Result after:
The record switches to readonly mode and its reference field has not
changed value.

closes odoo/odoo#98630

Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2022-08-23 17:55:28 +02:00
Louis Wicket (wil) a8c73f285f [IMP] mail, rating: turn computes and relateds readonly by default
Automatically add readonly on computed and related fields. This commit
required to rewrite some preexisting fields to make them readonly.
Task-2955927.

closes odoo/odoo#98541

Related: odoo/enterprise#30625
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2022-08-23 17:55:22 +02:00
Dardenne Florent (dafl) d3905b5bb7 [IMP] web: improve statusbar widget performance
Purpose:
Improve performance/reduce server load for the status bar widget when
the underlying field is a m2o.

Before this commit:

The status bar widget does two calls:
- a search_read request to retrieve ids and folds
- a name_get to retrieve names

With this commit:

The name_get can be avoided to save a call by fetching display_name in
the search_read.
This commit removes the name_get call to retrieve the name directly
from search_read.

task-2919535

closes odoo/odoo#98164

Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2022-08-23 17:55:18 +02:00
tsm-odoo 29468b1272 [IMP] config: deprecate longpolling port in favor of gevent port
This commit is part of the websocket integration in Odoo.
The longpolling port does not make sense anymore: longpolling has been dropped.
This commit deprecate the `--longpolling-port` option and replace it by the
`--gevent-port` option.

closes odoo/odoo#75510

Related: odoo/enterprise#23184
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2022-08-23 17:55:11 +02:00
Matthieu Stockbauer fe699a241d [IMP] *: adapt client code to use websocket instead of longpolling
*: bus, calendar, hr_attendance, iap_mail, im_livechat, project, snailmail,
snailmail_account, survey, web, web_editor, website_livechat.

This commit is part of the websocket integration in Odoo.
This bus service now communicates with a shared worker in order to provide
a single websocket connection for multiple tabs. It is designed to
be used as a websocket except that events are slightly different,
re-connection is handled automatically. If the browser does not support shared
worker (Safari), the service fallback on a simple web worker.

Available events are:
   - connect : fired upon a successful connection.
   - disconnect : fired upon reception of the websocket close event.
     The close code and reason are given to the listeners callback.
   - reconnect : fired upon a successful re-connection.
   - reconnecting : triggered when the worker starts to try reconnecting.
   - notification : fired upon the reception of notifications.

Since multiple tabs are now handled by a worker, the cross_tab bus is no longer
required and has been removed.

Part-of: odoo/odoo#75510
2022-08-23 17:55:10 +02:00
tsm-odoo de6de48deb [IMP] bus, *: adapt server to use websocket instead of longpolling
*: hr_presence, web_editor.

This commit is part of the websocket integration in Odoo.
It focuses on adapting the bus to support websockets:
   - last notification id is now kept on the server
   - channel list is built by overriding the `_build_bus_channel_list`
     method of the `ir_websocket` model instead of overriding the `_poll`
     method of the bus controller.
   - The bus presence was updated during polls, since there is no more poll,
     bus presence update will be the responsability of the client.
   - The `/websocket/peek_notifications`, `/websocket/update_bus_presence`
     routes will be available so that odoo sh can access notifications/update presence
      from http requests.
   - /longpolling routes are now prefixed with /bus thus won't be redirected to the
     gevent worker anymore except for `/longpolling/health` which is the
     health check route of the gevent server.

Since websocket now handle incoming messages, a way to manage authentication
have been introduced :
    - The session is retrieved from the HTTP handshake.
    - When a websocket message comes/leaves the session is retrieved
      on the file system so that we're sure it still exists and that
      it is up to date.
    - The session is checked
    - If no session is found on the file system or `check_session`
      fails, the websocket connection is closed with the `SESSION_EXPIRED`
      close code (which is a custom close code: 4001).
    - Note that websocket connections are closed every `KEEP_ALIVE_TIMEOUT`
      seconds to ensure no websocket connection will stay open if the user
      clears its cookies.
    - Note that a wsrequest object is available when processing incoming
      messages. It is similar to the http request and contains various
      useful informations (session, env, ...).

Part-of: odoo/odoo#75510
2022-08-23 17:55:10 +02:00
tsm-odoo 256ea2bd28 [IMP] bus, core, website: add lifecycle events to websocket server
This commit is part of the websocket integration in Odoo.
It focuses on implementing websocket  lifecycle events.

Two lifecycle hooks are currently available:
   - onopen: called after the websocket opening
   - onclose: called after the websocket closure.

Those callbacks will be passed an environment and the websocket
related to the lifecycle event.

In order to subscribe to websocket lifecycle events, one must decorate
a free functions with either `@Websocket.onopen` or `@Websocket.onclose`.

Part-of: odoo/odoo#75510
2022-08-23 17:55:10 +02:00
tsm-odoo f8e794a864 [IMP] bus, tools: add rate limiting to incoming websocket messages
This commit is part of the websocket integration in Odoo.
It focuses on implementing rate limiting to the incoming
websocket messages. When opening a connection, a burst of messages
is allowed. When requests are received too fast, an exception is
raised and the websocket is closed.

Two config parameters are added to customize the rate limtier
behavior:
   - websocket_rate_limit_delay: Integer specifying the seconds that
     should space out two requests.
   - websocket_rate_limit_burst: Integer specifying how many websocket
     frames can be accepted in excess of the specified rate.

Part-of: odoo/odoo#75510
2022-08-23 17:55:09 +02:00
tsm-odoo e06bb9a42d [ADD] bus: add websocket implementation
This commit is the first commit of the websocket integration in Odoo.
It focuses on the implementation of the websocket protocol as per RFC6455.

The implementation is tested thanks to the autobahn test suite.

A config parameter is available to customize the websocket connection:
   - websocket_keep_alive_timeout (default 600): Integer specifying how
     many seconds a websocket connection should be kept alive

Part-of: odoo/odoo#75510
2022-08-23 17:55:09 +02:00
Denis Roussel cbb5805479 [IMP] point_of_sale: Add currency for price per unit on Order Receipt
Some audit companies require this display.

closes odoo/odoo#98702

X-original-commit: 093d0e9b743d9aaa7e2a8f94278242524f975500
Signed-off-by: Masereel Pierre <pim@odoo.com>
2022-08-23 16:29:39 +02:00
Ahmad Khanalizadeh 97c954866f [FIX] point_of_sale: allow selection of pricelist when creating contact
Steps to reproduce:
1. create additional pricelist `p1`
2. add `p1` to available pricelists in PoS, remove default pricelist
3. open the session, create a new contact, don't change the pricelist
4. the created contact will have default pricelist and there is no
way to use `p1` as its pricelist

The problem is that when creating contacts, if the pricelist had not
been changed, it is not passed to be processed and so the contact is
created with the default pricelist, even though the default pricelist
is not available in the PoS.

To fix the problem, we can use the default pricelist of the PoS as the
default when creating new contacts and pass it as well.

opw-2930778

closes odoo/odoo#98685

X-original-commit: 9151edc3083775a0459a3af332114a572795cd20
Signed-off-by: Trinh Jacky (trj) <trj@odoo.com>
Signed-off-by: Joseph Caburnay (jcb) <jcb@odoo.com>
Signed-off-by: Khanalizadeh Ahmad (khah) <khah@odoo.com>
2022-08-23 16:29:36 +02:00
Denis Ledoux 53482ac8c1 [FIX] hr_expense: precompute name, uom, taxes and account
This is an oversight of odoo/odoo#95729

In a database with multi-uom disabled,
when attempting to create an expense choosing a product
with a different unit of measure than the Unit(s)
a ValidationError was raised to the user
regarding  an UOM incompatibility

e.g.
- Create an expense
- Set the product "[MIL] Mileage", using the uom "km"
- Save
-> ValidationError about UOMs

This is because the above mentioned PR makes the
`product_uom_id` completely removed from the view,
and the onchange no longer set the uom correctly within the form.

Solve this by setting `precompute=True` on the UOM field,
and the other fields using the same compute method.

In addition to solve the issue, it also allows to create
more easily expenses from the XMLRPC API:
Before, when creating an expense for the product "Mileage",
it was required you set yourself the uom correctly
in your API call,
even if multi UOMs was disabled in your database.
After, it's no longer mandatory to pass the UOM to use,
it is correctly computed from the product directly,
by default.

closes odoo/odoo#98662

Signed-off-by: Denis Ledoux (dle) <dle@odoo.com>
2022-08-23 16:29:32 +02:00
sofiagvaladze 6106f2eb9a [FIX] hr_contract: fix access error when archiving employee
Scenario:
hr_contract is installed and employee/officer without rights on contract
tries to archive an employee.

Before the fix:
An employee/officer without rights on contract gets the following access error:
Due to security restrictions, you are not allowed to access 'Employee Contract' (hr.contract) records.
THis is because the action tries to access employee's contract and set
date_end on it.

After the fix an employee/officer without rights on contract can archive
an employee without access error.

task - 2811165

closes odoo/odoo#98648

X-original-commit: c7ff577053a120f8f961642891d3a0ec0c960ae8
Signed-off-by: Kevin Baptiste <kba@odoo.com>
2022-08-23 16:29:29 +02:00
FrancoisGe 4f87c9c07f [FIX] web: switch the record with keynav in FormView
Before this commit, in a formView, if you modify an input and use
the keynav (alt+n or alt+p) to change the record, then the modification
is not saved.

How to reproduce?
- go to a form view with a pager containing more than one record
- edit an input
- press alt+n to move to the next record
- press alt+p to go back to the previous record

Result before:
    The record has not changed

Result after:
    The record has saved the change.

closes odoo/odoo#98602

Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2022-08-23 16:29:25 +02:00
Bruno Boi fff7334d09 [FIX] web: use right datetime format in daterange field
- First issue
The format passed to the daterangepicker locale options could have been
wrong as the daterangepicker lib uses moment and we would pass to it
the date(time) format expressed with luxon's format tokens.
Furthermore, there was no need to pass the format to the daterangepicker
library as the DateRangeField component already handles this.

- Second issue
There was also another issue with the DateRangeField component:
When applying the daterangepicker values, the conversion between a
moment object to a luxon DateTime object was wrong because of the format
used to convert the moment object to a string.

- Explanation
The format tokens are different between luxon and moment.

- After this commit
An helper function has been introduced in order to transform a luxon format into a moment format.
The DateRangeField component now properly converts a moment object to
a luxon's DateTime object when applying the daterangepicker selection.

- Additional note
Also, the DatePicker component was locally converting the luxon's
datetime format and thus has been adapted to use the new helper.

closes odoo/odoo#98578

Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2022-08-23 16:29:22 +02:00
Bruno Boi 83719ce376 [FIX] web: make daterange field work with empty initial value
- Before this commit
Using a daterange field with an empty start/end date(time) will result in an unusable field.
The datepickers shown are set with invalid moment.js objects.

- Explanation
A formatted empty value yields an empty string.
Calling `moment("")` results in an invalid moment objet.

- After this commit
When the formatted empty value yields to a falsy value (i.e. an empty string), we call the global moment function without arguments.
Calling `moment()` results in a valid moment object representing the current date and time.
This is what we are looking for, and thus our issue is resolved.

Part-of: odoo/odoo#98578
2022-08-23 16:29:21 +02:00
qsm-odoo 670c079d16 [REF] website: rename slide method of CarouselItem option class
This method name, while being not specific enough to ease grepping,
leads to have `data-slide` in the option XML declaration. This was
actually confusing with the BS4 data-slide of carousel elements. Here,
in master, this leads to even more confusion as BS5 uses data-bs-slide
thus making it unsure if the option's `data-slide` has to be converted
or not during the current BS5 bug fixing.

Indeed, it was converted by mistake with the original BS5 merge at [1]
and later fixed with [2] but it could be matched by regexes again and
be re-broken by mistake.

[1]: https://github.com/odoo/odoo/commit/971e5a91aab96d36129a823e03f1f9f1b1293968
[2]: https://github.com/odoo/odoo/commit/c6524ee9d60888bb147b77db5e394af8beda05ab

closes odoo/odoo#98362

Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2022-08-23 16:29:16 +02:00
Dardenne Florent (dafl) 87effdf514 [IMP] web: graph: add group by many2many
The purpose of this commit is to enable the "group by" functionality of
many2many in graph views.
Some other views also implement it (e.g. Gannt odoo/enterprise#20192,
List and Kanban odoo/odoo#74985), it is therefore a logical step to also support group
by many2many in graph views.

Previous behavior:
It is possible to select a many2many in the group by but it has no effect in the graph.

Expected behavior with this commit:
It is possible to select a many2many in the group by and it has an impact in the graph.

task-2721035

closes odoo/odoo#98009

Related: odoo/enterprise#30272
Signed-off-by: Mathieu Duckerts-Antoine <dam@odoo.com>
2022-08-23 16:29:02 +02:00
FrancoisGe 771fdcc67c [FIX] web: pick a non-enumerable property
Before this commit, pick did not work on non-enumerable properties.

For example, getters in a class are non-enumerable properties. It was not
possible to pick the value of a getter in a Class with the pick function.

closes odoo/odoo#97558

Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2022-08-23 16:28:58 +02:00
FrancoisGe e1d60b9161 [FIX] web: x2m open form dialog with the correct context
Before this commit, when you want to modify or add a record in a
non-editable x2many, the call to get_views to receive the arch for the
FormViewDialog did not contain a context.

Problem:
The arch of the form view that is received for adding or editing a
record in a non-editable x2many is not evaluated correctly.

Cause:
An empty context is passed to the "get_views" to receive the arch
for the FormViewDialog.

Solution:
We use the context of the StaticList that represents the x2many for
the "get_views".

Part-of: odoo/odoo#97558
2022-08-23 16:28:57 +02:00
FrancoisGe d531848034 [REF] mrp: Convert MrpFieldOne2ManyWithCopy to owl
The legacy field MrpFieldOne2ManyWithCopy added a control create
that performed an action when clicked.
In the new listRenderer we have added the possibility to define control
action buttons. So it is no longer necessary to create a custom field
for this use case.

Part-of: odoo/odoo#97558
2022-08-23 16:28:57 +02:00
FrancoisGe a11dafc99c [IMP] web: add control action button in x2many
This commit adds the possibility to define control action buttons in the
arch of a list view for a x2many. These buttons are action buttons that
will be placed in the same place as the control create ("Add a line").

The goal of this new feature is to offer the possibility to define
buttons that execute actions linked to an x2many.

Here is an example where we define a control create and a control action
button:
<tree>
    <control>
        <create string="Create" context="{}" />
        <button string="Action Button" name="do_something"
            class="btn-link" type="object" context="{'parent_id': parent.id}"/>
    </control>
    <field name="display_name"/>
</tree>

Part-of: odoo/odoo#97558
2022-08-23 16:28:57 +02:00
FrancoisGe b2a0a1c7d3 [FIX] web: ListViewHeaderButton use the correct context
Before this commit, when a ListViewHeaderButton was clicked, the view
context wasn't sent to the server.

As ListViewHeaderButton shows, the onClickViewButton API is not correct.
It expects a record in params but this is not correct in the case of
ListViewHeaderButton. So we decided not to pass a record but a getParams
callback that allows us to calculate the params when we need them.

Part-of: odoo/odoo#97558
2022-08-23 16:28:57 +02:00
yhu-odoo 221ee0cdc3 [IMP] stock, product_expiry: Change how we calculate dates related to
expiration

Previously, we do
{expiration,use,removal,alert}_date = receipt_date + {expiration,use,removal,alert}_time

After this commit, expiration date remains unchange, for the other 3
dates, we calculate them by
{use,removal,alert}_date = expiration_date - {use,removal,alert}_time

Task-2657043

closes odoo/odoo#86760

Related: odoo/enterprise#25419
Signed-off-by: Steve Van Essche <svs@odoo.com>
2022-08-23 16:28:44 +02:00
Louis Wicket (wil) af7dd7d79d [FIX] mail: get_mention_suggestions returns correct channel data
ac08da0a834631b2a7c39c40b1f36f01a85e8617 moved channel_type from Thread
to Channel, but data returned by get_mention_suggestions have not been
updated accordingly. This commit adapts it.

Follow-up of task-2948676.

closes odoo/odoo#98677

Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2022-08-23 15:05:56 +02:00
Sébastien Theys 449fd0154f [IMP] mail: slightly improve performance of model manager
closes odoo/odoo#98672

Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2022-08-23 15:05:53 +02:00
Yannick Tivisse 39f92c2993 [IMP] point_of_sale: Remove pos_config_form js_class
Purpose
=======

The logic has been moved from the pos.config to the res.config.settings
model/views, and therefore this js_class is not used anymore.

closes odoo/odoo#98641

Taskid: 2958057
Related: odoo/enterprise#30658
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2022-08-23 15:05:43 +02:00
Stanislas Gueniffey 789606f57d [FIX] account_edi: UserError if doc is processing
The "Process now" button throws a UserError if doc is already processing
=> but only thrown if parameter with_commit=False

PR odoo#87266 changed with_commit default value for test purposes
=> accidentally prevented the UserError from popping up

This PR restores with_commit default value for button action
=> User now gets the expected UserError pop up

closes odoo/odoo#98618

X-original-commit: 451fbfb356e9f7941180d14796afeb161fa09660
Signed-off-by: Josse Colpaert <jco@odoo.com>
Signed-off-by: Stanislas Gueniffey (stgu) <stgu@odoo.com>
2022-08-23 15:05:40 +02:00
tsm-odoo c218c09119 [IMP] mail, im_livechat: remove thread local id usage from tests
Using local ids in test is cumbersome: we need to retrieve the mail
record associated with the server record to get it while the thread
model/id are more than enough and available. This PR replaces thread
local id data attribute by thread model/id.

task-2959366

closes odoo/odoo#98588

Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2022-08-23 15:05:36 +02:00
Guillaume (gdi) d36c14e346 [FIX] website, survey: correct the aria-labelledby
The attribute aria-labelledby was used erroneously and was misspelled.
This commit corrects that by replacing it with the aria-label attribute.

task-2937538

closes odoo/odoo#98401

Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2022-08-23 15:05:33 +02:00
amdi-odoo 947cd7ebbe [FIX] website_event_track: Prevent title from flickering
Fixing the display of long track names by taking all the
width for the title in edit mode and forcing line breaks in
read mode.

Task-2941724

closes odoo/odoo#98396

X-original-commit: 4e2484e84bfaf8c4d21b0ac887c7c80594142792
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
Signed-off-by: Dieudonné Amélie (amdi) <admi@odoo.com>
2022-08-23 15:05:29 +02:00
Laurent Desausoi (lade) 1e19842303 [FIX] web: allow auto_save when using the keyboard to switch records
When using the keyboard to switch records (e.g.: Leads records), we can use
keyboard shortcuts (ALT + N / P) to travel from records to records. However,
when using these shortcuts, the changes on the current record are not applied
when switch.

Step to reproduce the issue:
1. Install CRM module and activate Lead
2. Ensure that there are multiple Lead already created
3. Go on one Lead and edit its title WITHOUT clicking outside the box
4. Press ALT+N on your keyboard to switch to the next record
5. Press ALT+P to come back to the initial record
You will see that the initial record's changes have not been saved.

Solution: The issue is a racing condition. Somehow, when we use the keyboard
shortcuts, the `mutex.exec` from the `applyChanges` function (cfr. Line [1]) is
not prioritized and the `isDirty` check from `saveChanges` is executed first (
cfr. [2]). We can check this with the debugger, we stop on the `mutex.exec`
then we execute the `isDirty` then we execute the callback of the initial
mutex. The issue is that, it is the callback of the mutex that allows to set
the `_isDirty` flag to True which in return allows the `saveChanges` to
save the record as he spot some changes.

[1]: https://github.com/odoo/odoo/blob/ef789170ce2f1553b325b379aac4452e473de1e9/addons/web/static/src/legacy/js/views/basic/basic_controller.js#L281
[2]: https://github.com/odoo/odoo/blob/ef789170ce2f1553b325b379aac4452e473de1e9/addons/web/static/src/legacy/js/views/basic/basic_controller.js#L180

opw-2824986

closes odoo/odoo#96696

X-original-commit: d9ec7b4b4a9f3cc8caa4c7f5fade8ce1fb8baaea
Signed-off-by: Desausoi Laurent (lade) <lade@odoo.com>
Signed-off-by: Simon Genin (ges@odoo) <ges@odoo.com>
2022-08-23 15:05:17 +02:00
roen-odoo 62ed398304 [FIX] website_sale_delivery: keep delivery method when using giftcards
Current behavior:
If you have atleast 2 delivery methods available on the website,
and try to pay with a giftcard the selected delivery method will
always switch to the partner preferred delivery method.

Steps to reproduce:
- Activate giftcards for website
- Set a preferred shipping method for partner A
- Make sure the preferred shipping method is website published
- Publish atleast one other shipping method for the website
- Go on the website shop, and add product to the cart
- Process checkout and select any shipping method that is not
  the preferred shipping method of partner A
- Pay with giftcard
- The selected delivery method switch back to the preferred method
  of partner A

opw-2883592

closes odoo/odoo#98619

X-original-commit: b356091d579bf4a29c9c8ad84915139984cf16e9
Signed-off-by: William Braeckman (wbr) <wbr@odoo.com>
2022-08-23 13:38:30 +02:00
Brieuc-brd 61c32b8578 [IMP] mail: MessageActionList, adapt padding and items order
Since ChatWindow messages can be aligned in both directions, the
MessageActionList must adapt its padding and the order of its items when
the menu is expanded according to the message.

This commit adapts the padding and the order of the items.

closes odoo/odoo#98607

Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2022-08-23 13:38:28 +02:00
Brieuc-brd 3e67492d8e [IMP] mail: increase messages width in ChatWindow
Space for messages is precious in ChatWindow, so this commit increases
the width of messages as much as possible.

Part-of: odoo/odoo#98607
2022-08-23 13:38:27 +02:00
Denis Ledoux 9a8ad08dc6 [FIX] purchase: currency_id is required for account-tax-totals-field
The widget `account-tax-totals-field` needs the value of the
`currency_id` field, even when not in multi-currency mode.

The widget is used in `sale.order`, `account.move` and
`purchase.order`. The only place where the field
was not included when not in multi-currency mode
was the purchase.order.

A traceback was raised when attempting
to open the purchase order form when
not in multi-currency.

This is an oversight of odoo/odoo#95729

closes odoo/odoo#98597

Signed-off-by: Denis Ledoux (dle) <dle@odoo.com>
2022-08-23 12:05:51 +02:00
Julien Van Roy 60f6f7038f [FIX] account_edi: send & print - prevent duplicating attachments
Currently, the EDI attachments *content* is passed to the Send & Print wizard.
Then, the wizard re-creates these attachments and link them to itself. At the
end of the flow, when clicking 'Send & Print' button on the 'Send & Print' wizard,
the attachments of the wizard are copied on the move.
Thus, the EDI attachments are duplicated.

Passing the ids of the EDI attachments rather than the content solved the issue,
since they are simply linked to the wizard, without being re-created.

task-2957823

closes odoo/odoo#98447

Related: odoo/enterprise#30596
Signed-off-by: Laurent Smet <las@odoo.com>
2022-08-23 12:05:45 +02:00
Nasreddin Boulif (bon) 2ce3da3846 [FIX] account_edi_ubl_cii: Don't attach edi document to on confirm
Steps to reproduce:

  - Install Netherlands localization module
  - In the `Customer Invoice` journal, activate `NLCIUS (Netherlands)`
    as Electronic Invoicing
  - Create a new invoice and confirm

Issue:

  XML generated and available as attachment and if we click on
  `Send & print`, a second one is added to attachments.

Cause:

  If it's not a factur-x or e-fff edi documents, we will generate the
  XML file add it as attachment on confirm.

Solution:

  Don't add as attachment of the invoice when confirming invoice if
  code is `nlcius_1` (like for factur-x and e-fff edi documents),
  only when generating invoice PDF (`Sent & Print`).

opw-2751148

closes odoo/odoo#98594

X-original-commit: 6c090dae0a051ac4e89310387c7777ef2d0d60d9
Signed-off-by: Florian Gilbert (flg) <flg@odoo.com>
Signed-off-by: Nasreddin Boulif (bon) <bon@odoo.com>
2022-08-23 10:02:46 +02:00
Christophe Monniez c754838489 [FIX] web: fix clickbot click timeout inconsistency
The clickbot click default timeout was increased in #98495, but missed
the fact that the default was overridden for the "Settings" menu to a
lower value.

With this commit, the "Settings" exception is completely removed as the
default timeout is higher. Also, checking that the text contains
"Settings" was a bit weak.

While at it, the timeout for the global testing of an app is also
increased to 10 minutes instead of 5 as this limit is reached by the
Field Service app.

closes odoo/odoo#98617

X-original-commit: 0247e6f4abef4121b451c1373ae3c1ce184451c0
Signed-off-by: Christophe Monniez (moc) <moc@odoo.com>
2022-08-23 08:50:01 +02:00
Guillaume (guva) 348865b484 [FIX] account: register payment method multiple partners
Improvement of https://github.com/odoo/odoo/commit/e66663b52920ad5a647b03a8fd9ade4070f09158

The commit mentioned above introduced a bug, which
prevent the user to select payment method when register
a payment for multiple partners, even if the payments
were from the same type.

The solution here is to allow the selection of payment method
in any case, the _create_payment_vals_from_batch method will
change the payment method if it is not available on the journal.

Note: for the forward port from 15.0, only test is adapted, as the bug
does not happen.

opw-2954325

closes odoo/odoo#98574

X-original-commit: d16946b450356922b69e6152bd343229ed4d2bb3
Signed-off-by: Laurent Smet <las@odoo.com>
Signed-off-by: Guillaume Vanleynseele (guva) <guva@odoo.com>
2022-08-23 08:49:58 +02:00
Xavier Morel 9c0fa1efe3 [CHG] core: deprecate get_module_filetree
It's pretty much unused and fairly complicated.

Also deprecate `listdir` entirely since `get_module_filetree` is the
only extant user of the recursive listdir.

closes odoo/odoo#98034

Related: odoo/enterprise#30403
Signed-off-by: Xavier Morel (xmo) <xmo@odoo.com>
2022-08-23 07:36:24 +02:00
Alvaro Fuentes adf534f2bf [FIX] payment: compute related_partner_ids with sudo
`related_partner_ids` is used in the form view of account.payment
https://github.com/odoo/odoo/blob/43fccd7aaa83117c95babc52d60dd1c26b28335a/addons/payment/views/account_payment_views.xml#L14
It is only needed for electronic payments to display the payment token
ids (as part of its domain)
https://github.com/odoo/odoo/blob/45f5167b956521f0a183ff1b1cc75fa1b273866c/addons/payment/models/account_payment.py#L13-L21
and for draft payments only.
https://github.com/odoo/odoo/blob/43fccd7aaa83117c95babc52d60dd1c26b28335a/addons/payment/views/account_payment_views.xml#L16

Before this change the form view will fail when partner_id has a company
that is not in the context. This is not incorrect, but it is unexpected
as `related_partner_ids` is not needed to just show the form view. A way
to reproduce the issue is to confirm a payment, then change the partner
company to a company not accessible for current user.

This causes issues during migrations: the form view for the failing
payments is displayed just fine for versions <=13.0

closes odoo/odoo#98623

X-original-commit: a126f007573a41d22108d9d7887f92b6926ef3ec
Signed-off-by: William André (wan) <wan@odoo.com>
Signed-off-by: Alvaro Fuentes Suarez (afu) <afu@odoo.com>
2022-08-22 22:56:27 +02:00
qsm-odoo 1968599a45 [FIX] web: restore default website navbar (BS5 order classes)
Commit [1] broke the default website navbar by removing the generation
of order-XXX-0 classes.

[1]: https://github.com/odoo/odoo/commit/6ed6a512bfec8e2415da2d19304215fcd06273b2

closes odoo/odoo#98609

Signed-off-by: Adrien Dieudonné (adr) <adr@odoo.com>
2022-08-22 20:27:01 +02:00
Louis Wicket (wil) f728216a86 [IMP] mail, *: add validation for OnChange + get rid of OnChange class
In this commit:

+ Add validation for OnChange definitions 💪
+ Fix the errors found thanks to the new validation 🤩
+ Get rid of the `OnChange` class (useless boilerplate code) 😤

* = calendar

closes odoo/odoo#98549

Related: odoo/enterprise#30631
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2022-08-22 19:12:47 +02:00
Benjamin Vray a66ca75b96 [FIX] website: fix vertical header template elements ordering (BS5)
With the merge of Bootstrap 5 at [1], the class "order-lg-12" no longer
exists, this class was used in the vertical template header and this one
was therefore broken. This commit replaces this class with "order-lg-5"
to fix that.

Note: while this commit was being made, [2] was merged restoring the
order-lg-12 class into BS5. This commit is still merged as using
order-lg-5 instead cannot hurt and is a bit more robust in case [2] is
reverted for some reason.

[1]: https://github.com/odoo/odoo/commit/971e5a91aab96d36129a823e03f1f9f1b1293968
[2]: https://github.com/odoo/odoo/commit/6ed6a512bfec8e2415da2d19304215fcd06273b2

closes odoo/odoo#98028

Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2022-08-22 19:12:44 +02:00
Benjamin Vray 570cbc194f [FIX] website: fix hr opacity (BS5)
Since the merge of Bootstrap 5 at [1], a background-color and an opacity
are added on the `<hr>` elements. That way the <hr> now follows the
color of the surrounding text but are faded a bit. The BS4 behavior was
to use a lightgray (transparent black).

With the adaptation at [1], it was chosen to be compatible by forcing
that opacity to 1 and re-forcing the previous transparent black. This
commit chooses to instead keep the nice auto behavior of BS5, at worst
this will thus change lightgray <hr> to the color of the surrounding
text (faded a bit), it should not be a breaking change. The separator
snippet however keeps its full compatibility as we want to let users
choose the exact color they want so we cannot add a default opacity (we
may want to improve the UX later on).

[1]: https://github.com/odoo/odoo/commit/971e5a91aab96d36129a823e03f1f9f1b1293968

Part-of: odoo/odoo#98028
2022-08-22 19:12:43 +02:00