Commit Graph
164380 Commits
Author SHA1 Message Date
Alexandre Kühn a48fa4fe40 [FIX] mail: no favorite/unread on messages in public page as guest
Before this commit, the message actions "Add to Favorite" and
"Mark as Unread" were shown in the Discuss public page For guests.

These buttons should not be present in public page for guests,
as they both require at least the user being authenticated.

This commit fixes the issue by not showing these 2 actions
"Add to Favorite" and "Mark as Unread" on messages in the Discuss
public page as guests. Internal users can still see both features
in the public page

Task-3430586

closes odoo/odoo#129359

X-original-commit: b551f8799ccee443fc0c6a1e8d4a5e2b8e673c57
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
Signed-off-by: Matthieu Stockbauer (tsm) <tsm@odoo.com>
2023-07-24 21:27:29 +02:00
Sébastien Theys 11b6210c65 [FIX] mail: fix activity menu counter
Some groups don't have a total_count, ignore them to avoid NaN result.
This is the case of calendar meeting in particular.

closes odoo/odoo#129358

X-original-commit: f29c4f905a557bef1120ea6ea8af2edf3af93489
Signed-off-by: Olivier Dony (odo) <odo@odoo.com>
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2023-07-24 21:27:27 +02:00
dhba-odoo 1a91bd9ea5 [FIX] web_editor: word tables are broken because of formatting spaces.
Before this commit:

When format styles were applied to the word table, it would break table.

After this commit:

Now, when format styles are applied to a word table, the style will be applied to it
without breaking the table.

task-3165767

closes odoo/odoo#129356

X-original-commit: 0b06ba23aa111f6a85929abe8018b6b18da79873
Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
2023-07-24 21:27:24 +02:00
Andrea Grazioso (agr-odoo) 17a0ec17b5 [FIX] web: table border still present in pdf
Set Document Layout to "Light" (the default)
Print an Invoice
Open in chrome (tested in Chromium Version 114.0.5735.198)

Issue: border right after table header is still visible
Note: It is reader dependent, as it may not occur with other browser or pdf
reader

opw-3324785

closes odoo/odoo#129275

X-original-commit: 28eedfeec2531c0ebfbdeb4024abad967d450a0d
Signed-off-by: Andrea Grazioso (agr) <agr@odoo.com>
2023-07-24 20:18:16 +02:00
Yolann Sabaux 9836b1e530 [FIX] l10n_ch: add cash difference account
Steps to reproduce:
- Install l10_ch
- create a journal entry with account 9991 or 9992
- go on the general p&l and compare it to the swiss p&l

Issue:
The results won't be the same

Cause:
The accounts 9991 and 9992 are not taken into account into the swiss expenses.
The `CH_4` only takes into account accounts with code `4 <= x < 5`.
https://github.com/odoo/enterprise/blob/bd43cba9e7b5bdbab6319ae1a90e8bf3a8960c15/l10n_ch_reports/data/account_financial_html_report_data.xml#L416
Therefore accounts 9991 and 9992 won't be take into account.

Solution:
When initialising the localisation, we change their code so they fit in the range of `CH_4`

opw-3210100

closes odoo/odoo#129238

X-original-commit: 0896fbb0957060c82bf0f08deef167f866e63cc0
Signed-off-by: Olivier Colson (oco) <oco@odoo.com>
2023-07-24 20:18:13 +02:00
mehjabinfarsana 4ca77c8833 [IMP] http_routing: window title
before this commit, the window title is
shown as http_error,error_message and
http_error_debug

after this commit, clean window title will
be shown to end user

closes odoo/odoo#129083

Signed-off-by: Romain Derie (rde) <rde@odoo.com>
2023-07-24 20:18:08 +02:00
d4fe919db5 [MERGE][REF] web: new RelationalModel
Before this PR, we had several implementations of a relational
model. The form view used the BasicRelationalModel, which was a
wrapper around the BasicModel. The list view used the
RelationalModel (a simpler version that didn't support complex
usecases of x2many fields). The kanban view used the KanbanModel,
an extension of RelationalModel.

This PR removes all these, and replaces them by a single model.
It is called RelationalModel, and as a similar structure as its
predecessor (with datapoints). It now handles tricky x2many usecases
of the form view though.

This PR also comes with several important changes:
 1) The new model is based on unity reads [1]. This means that all
 data required by the view is fetched at once, and datapoints are
 created with their data (whereas before, they were responsible to
 fetch their data). There's an exception for special data: they are
 no longer handler by the model. A hook "useSpecialData" has been
 created, and it allows fields (components) to fetch additional
 data they require.

 2) The new model uses onchange2 [2]. With onchange2, we send and
 receive a diff, instead of the whole state of the record. Morever,
 onchange2 uses unity, which means that returned commands for x2manys
 (e.g. command 4, LINK) contain the values of the corresponding
 records, so we don't need to fetch them in a separate call
 afterwards.

 3) The new model no longer triggers deep renderings (render(true)).
 It is instead based on fine-grained reactivity (i.e. only what
 depends on what has changed is re-rendered). We introduced a hook
 "observeRecord" which allows a component to subscribe itself to
 some keys in a record datapoint, and register a callback to
 execute when those keys change (e.g. to fetch data).

[1] odoo/odoo@7d2baaa0c7
[2] odoo/odoo@f5e6494da3

Task~3179751

closes odoo/odoo#114024

Related: odoo/enterprise#43125
Signed-off-by: Géry Debongnie <ged@odoo.com>
Co-authored-by: Aaron Bohy <aab@odoo.com>
Co-authored-by: FrancoisGe <fge@odoo.com>
Co-authored-by: Jorge Pinna Puissant <jpp@odoo.com>
Co-authored-by: Pierre Rousseau <pro@odoo.com>
2023-07-24 20:17:58 +02:00
Aaron Bohy 84d199b6ed [REF] web: RelationalModel: move _askChanges from record to model
_askChanges doesn't apply on a single record, it asks all fields
of all records of the current model to send their changes, so it
makes more sense to have this function on the model instead.

Part of task~3179751

Part-of: odoo/odoo#114024
2023-07-24 20:17:57 +02:00
Jorge Pinna Puissant 3967dab0ce [REF] web: RelationalModel: do not change resId in Record
With this commit, we ensure that the resId of a Record datapoint
never changes. The only exception is for new records: their resId
can go from `false` to their actual id when they are created. When
we want to load another record, we must use the `load` function of
the model, which now accepts `resId` (and `resIds`) as param, when
the root is a "mono record".

As a consequence, the instance of record datapoint now changes when
using the pager. This required some changes in the AceField, to
make it properly react in that case. We took the opportunity to
simplify its implementation (several keys in the state were useless).

Part of task~3179751

Part-of: odoo/odoo#114024
2023-07-24 20:17:57 +02:00
Aaron Bohy 65c8f41cf3 [FIX] web: Record: complete relational values
Now that the RelationalModel is based on unity, datapoints expect
to receive their data as returned by unity read (i.e. x2many values
are list of records, not ids, and many2one values are objects with
keys id and display_name, not tuple, or simple ids). As a
consequence, the Record component needed to be slightly adapted for
current usecases to continue working (e.g. using a Record component
for a Many2ManyTags field, and providing the value of the many2many
as a list of ids, like in the studio action editor sidebar).

This commit completes the relational values received by the Record
component with the related records, like if they were read by
unity.

The Record component's API will be reworked soon, now that the
new RelationalModel has been merged, to be more compliant with the
new unity concept.

Part of~3179751

Part-of: odoo/odoo#114024
2023-07-24 20:17:57 +02:00
Aaron Bohy 0994e0ff6d [FIX] web: Many2ManyCheckboxes: batch changes
Have a many2many field with widget many2many_checkboxes. Before
this commit, the widget notified the model (i.e. called replaceWith
on the static list) for each change of one of its checkboxes. This
means that if the was an onchange on the field, the onchange rpc
was done once for each click. With this commit, we debounce the
call to replaceWith, which allows to tick/untick multiple
checkboxes, and a single onchange is done with the resulting value.

This allows to mitigate another issue, which is that consecutive
calls to replaceWith are error prone, because they might send a
list of ids which isn't up to date with the one of the last call
to replaceWith (if the list is computed from the value in the
datapoint), as replaceWith uses the model mutex and thus updates
the datapoint in an async way. This specific issue will be tackled
later.

Part of~3179751

Part-of: odoo/odoo#114024
2023-07-24 20:17:56 +02:00
Pierre Rousseau e02da4224a [REF] web: RelationalModel: commit changes in _updateConfig
This commit adds an option to _updateConfig which allows to specify
a callback to apply the new values obtained from the updated config
e.g.
 1) a dynamic list updates its offset (calls _updateConfig)
 2) a web_search_read is done and returns some records
 3) the new config (with the new offset) is applied on this.config
 4) record datapoints are created for the returned records and set
   on this.records of the list

Before this commit, step 3) was done in _updateConfig, and step 4)
was done by the called of _updateConfig. As _updateConfig is async,
step 4) was actually done in the next microTick after 3). As a
consequence, those two mutations could trigger owl renderings.

To avoid this situation, _updateConfig now takes a "commit"
function, which allows it to execute 3) and 4) in the same tick.

Part of~3179751

Part-of: odoo/odoo#114024
2023-07-24 20:17:56 +02:00
Aaron Bohy 2b21fbe782 [REF] point_of_sale,pos_*: use batched from web
Part-of: odoo/odoo#114024
2023-07-24 20:17:56 +02:00
Jorge Pinna Puissant a41e5ff690 [FIX] web: allow x2many fields without relation_field
Have a field x2many without relation_field.

Before this commit, a server error was raised because, we send changes
for the non-existing field (relation_field).

Now, we only send to the server the changes for relation_field only if
they exist.

Note that, this commit will also add an exception on the server mock
onchange if we sent changes for non-existings fields.

Part of task~3179751

Part-of: odoo/odoo#114024
2023-07-24 20:17:56 +02:00
Jorge Pinna Puissant 2129d774a2 [FIX] web: do not read if field spec is empty
Have a view with many2many_checkboxes field (e.g. product.template
form view with inventory installed, and some routes). Tick a
checkbox. Before this commit, a read was done, but the field spec
was empty (there was no field to read). So basically the read only
returned the id. This is obviously useless. This commit prevents
from doing read rpcs when the spec is empty.

Part of task~3179751

Part-of: odoo/odoo#114024
2023-07-24 20:17:56 +02:00
Aaron Bohy 0df1f4d439 [FIX] web: forget command for nested x2many in form, not in list
Have a form view with an x2many field A displayed as a non editable
list view. In A's form view, there's an x2many field B, which isn't
in the list. B is itself displayed in the dialog form view as a
list, which contains an x2many fields C displayed as many2many_tags.

A contains a record. For this record, B contains also a record,
which contains two tags for C.

Have an onchange on the main record which triggers an update command
for the record in A, such that the command also updates the record
in B, which deletes (or forgets), i.e. commands 2 or 3, a tag C.

Before this commit, if the user opened the x2many record of A after
the onchange, it didn't displayed the remaining tag in C. The
reason is that we received commands to remove the tag before we
actually fetched them (as we don't need them for the list of A).
The tags were then fetched when we opened the record in a dialog,
but we didn't correctly merge the values read from the server with
the commands we received earlier.

With this commit, we properly store the commands and apply them
after reading the values.

Part of task~3179751

Part-of: odoo/odoo#114024
2023-07-24 20:17:55 +02:00
Aaron Bohy 0e2d8eeabe [FIX] web: o2m multi page command forget second page
Have an x2many list or kanban with several page, and an onchange
on the main record that returns forget or delete commands for
x2many records that aren't on the first page. Before this commit,
it crashed, because the code expected the records to be in
this.records (the record of the current page).

Part of task~3179751

Part-of: odoo/odoo#114024
2023-07-24 20:17:55 +02:00
Pierre Rousseau 30d2e224d8 [IMP] web: image field: add option to bypass image reloading
With the image field widget, the image is reloaded each time the record
is updated (when `write_date` is updated). This is not always desirable
as some images are not supposed to change.

This commit adds an option to bypass the image reloading. This option
is called `no_reload` and is set to `false` by default.

Part-of: odoo/odoo#114024
2023-07-24 20:17:55 +02:00
Jorge Pinna Puissant 88b4938b7c [FIX] web: one2many, await onchange when resequence
- On an one2many;
- drag and drop two records;
- a resequence is called, with an onchange;
- click save;

Before this commit, if the network was a little too slow, the return of
the onchange wasn't taken it into account for the save.

Now, we await the onchange of the resequence before executing another
action.

Task 3179751

Part-of: odoo/odoo#114024
2023-07-24 20:17:55 +02:00
FrancoisGe 5e684776d3 [FIX] web: view with a record without properties crash
Before this commit, going into a view with a record that had no properties displayed a crash.

Why ?
If no properties exist, the value is false and was not handled.

Part-of: odoo/odoo#114024
2023-07-24 20:17:54 +02:00
Aaron Bohy c80f76da56 [REF] web: specialize useModel for sample data
Before this commit, there was a hook, named useModel, which eases
the use of a model in views. The main (and almost only) role of the
hook was to deal with sample data (determine whether or not they
can be enabled, fallback on the sample orm when necessary, leave
sample mode at reload...). This hook is used by all views except
form and activity as they do not implement sample data.

This commit renames that hook into "useModelWithSampleData" and
introduces a new hook "useModel", which is a lot simpler that the
other one, as it's only goal is to do the plumbing between the
component using the hook and the model (i.e. spawning required
services and loading the data on willStart and willUpdateProps).
This new hook is used in form and activity views.

Note that useModel doesn't trigger deep renderings, as it is only
used on the RelationalModel which is based on fine-grained
reactivity.

Part-of: odoo/odoo#114024
2023-07-24 20:17:54 +02:00
Aaron Bohy e325603172 [FIX] web: form: do not reload record before leaving
...when using the pager.

When a record is dirty and the user clicks on the pager to go to
the next/previous one, it is automatically saved. Before this
commit, the record was reloaded after the save, which is useless
as we're leaving it anyway. This commit ensures we only save, and
we do not reload.

Part-of: odoo/odoo#114024
2023-07-24 20:17:54 +02:00
FrancoisGe 49b7328376 [FIX] web: evalContext must contain the x2m currentIds
Before this commit, the x2m present in a record's evalContext was
represented by the resIds defined in the config. It therefore did not
contain the current changes. It should therefore be represented by the
currentIds of non-virtual records.

How to reproduce:
- Create a new record with a m2m field having at least one default record
- Edit a field which triggers an onchange with a context depending on the
  value of the m2m

Before this commit:
  The domain and context used contain an empty list for the m2m.

After this commit:
  The domain and context used contain a list with the default id for the m2m

Part-of: odoo/odoo#114024
2023-07-24 20:17:54 +02:00
Aaron Bohy 0a64516858 [FIX] web: form: do not add display_name if in dialog
In form views, the "display_name" field is automatically added to
the list of activeFields as we need its value to display in the
breadcrumbs. However, this isn't necessary when there's no control
panel, in particular in dialogs. Without this commit, the test
"test_addremove" of addon test_apikeys didn't pass.

Part of task~3179751

Part-of: odoo/odoo#114024
2023-07-24 20:17:53 +02:00
Aaron Bohy c98f050435 [FIX] web: x2many onchange: always send id of parent record
Be on an existing record containing an x2many field. Add a row
or click on an existing one to edit it. The changes sent for
onchange done for the subrecord contains a key with the changes
in the parent record. Before this commit, this object didn't
contain the id of the parent record. As a consequence, the
onchange (in py) couldn't correctly link the sub record with
its parent to compute field values. This commit ensures that we
always provide at least the id when the parent record exists.

Part of task~3179751

Part-of: odoo/odoo#114024
2023-07-24 20:17:53 +02:00
Jorge Pinna Puissant 1318be22a4 [FIX] web: a modified field must always be sent to the server
Before this commit, when a field of type one2many or many2many, was
added and afterward deleted, on the onchange or write call to the server
the field wasn't added as a change (because the add and delete command
cancel each other). This can cause issues because when adding the x2many
field, the onchange on the server can have side effects that we want to
remove when deleting the x2many.

Now, we follow the following rule : If a field has been modified, its
value must always be sent to the server for onchange and write.

This commit also avoid to call update on the parent record if the chil
record didn't have changes.

Task 3179751

Part-of: odoo/odoo#114024
2023-07-24 20:17:53 +02:00
FrancoisGe 17de016dc6 [FIX] web: save a record before the onchange is complete in o2m
Before this commit, the save button in the x2m form view dialog does
not wait for ongoing updates.

Why is this?
When you click on the "Save and Close" button of a form view dialog
in an x2m, you check the validity of the record to know whether you
should save or not. The askChanges function called does not wait for
ongoing updates.

Solution:
Just wait until the model mutex has finished processing all the current
functions. This ensures that the record has applied all its updates.

How to reproduce:
- Go to a form view with a non-editable x2m
- Add a line
- Edit a required field with a slow onchange
- Click "Save and close" before the onchange is complete

Before this commit:
    The form dialog remains open and a notification appears telling us that
    a required field is invalid.

After this commit:
    The dialog is closed and the change has been applied.

Part-of: odoo/odoo#114024
2023-07-24 20:17:53 +02:00
Aaron Bohy 575bb235c7 [FIX] web: nested x2manys with context referencing parent
Before this commit, it crashed if an x2many field inside another
x2many field had a context with a key referencing the parent
record:
```xml
<form>
  <field name="foo"/>
  <field name="outer_x2many">
    <tree></tree>
    <form>
      <field name="inner_x2many" context="{'key': parent.foo}">
        <tree></tree>
      </field>
    </form>
  </field>
</form>
```

The crash occured because we tried to evaluate the context of the
static list representing inner_x2many before setting the parent
key on the eval context.

Part of task~3179751

Part-of: odoo/odoo#114024
2023-07-24 20:17:52 +02:00
Aaron Bohy f6a2086375 [FIX] web: wait for static list operation before saving
Have a required many2manytags field and a slow network. The field
is initially empty. Add a tag to the relation and directly save.
An invalid field notification is displayed, because the field is
still considered empty. This commit ensures that we wait for the
operations done in the static list before saving.

Part of task~3179751

Part-of: odoo/odoo#114024
2023-07-24 20:17:52 +02:00
Aaron Bohy a748e3c4df [FIX] web: keep empty string value for char/text fields
For char/text fields, the server can return false or "" (empty
string) depending if the field isn't set in db (NULL) or set to
the empty string. This makes no difference in the UI, but it
matters when evaluating modifiers.

Before this commit, the value of char/text fields was automatically
set to the empty string if it was falsy, as it doesn't impact the
UI, and it is cleaner type-wise. Unfortunately, we cannot do that
for the eval context, as we must be able to make the difference
between False and "" evaluating modifiers. A solution would have
been to stop fallbacking on the empty string when the value was
false, but we wanted to keep the clean API. So this commit fixes
the issue by keeping an internal structure in Record to track
the exact values we received from the server for those fields, and
use that structure to generate the eval context.

Part of task~3179751

Part-of: odoo/odoo#114024
2023-07-24 20:17:52 +02:00
Aaron Bohy 0917241ff7 [FIX] web: x2many kanban: always display fields in readonly
Have an x2many field displayed with a kanban view containing sub
fields with widgets (widget="..."). Click on a record to edit it
in a form view dialog. Before this commit, the fields of the kanban
card displayed in the background were switched to "edit" when the
dialog was open. With this commit, we ensure they always remain
displayed in "readonly".

Part-of: odoo/odoo#114024
2023-07-24 20:17:52 +02:00
Aaron Bohy c1ef9b4a3a [FIX] web: prevent crash with statusbar field
From a list or kanban view, open a form view with a statusbar
field (e.g. in crm.lead). Go back to the list. Open another record
for which the domain of the statusbar is different. Before this
commit, it crashed, because the component bound to the orm service
used by the specialData cache (i.e. the previous FormController)
is destroyed.

Part-of: odoo/odoo#114024
2023-07-24 20:17:51 +02:00
FrancoisGe afa7160d07 [FIX] web: o2m multi page sort on two column
Part-of: odoo/odoo#114024
2023-07-24 20:17:51 +02:00
FrancoisGe a189424ff4 [FIX] web: x2m multi page with context with parent key
Part-of: odoo/odoo#114024
2023-07-24 20:17:51 +02:00
Aaron Bohy cd6d54d7bf [FIX] web: unselect row inside x2many dialog
Have an x2many with an x2many editable list inside the form view
containing at least a row. Open a record, click discard. Open it
again, and click on a row of the x2many to switch it to edit mode.
Before this commit, the row could never be switched back to
readonly. This was the list renderer didn't correctly compute its
active element (it must wait for a micro tick for the mounted hook
of the dialog, its ancestor, to be called).

After fixing this issue, a second one arise: the row can now be
unselected, but it disappears if it is a new record. This is
because we lost the dirty flag when clicking on discard. This is
fixed by storing the dirty state alongside changes in the
savepoint.

Part-of: odoo/odoo#114024
2023-07-24 20:17:51 +02:00
FrancoisGe ad1539b20b [FIX] web: sort x2m multi page
Before this commit, x2m in list mode with several pages did not work
correctly when sorted. The order was lost when the page was changed and
any values not used for sorting were missing.

How to reproduce:
- Go to a form view with an x2m in list mode with at least 2 pages
- Sort on a column
- At least one record not present before sorting is displayed

Before this commit:
    This record only contains the values used for sorting

After this commit:
    This record contains all the values

- Click on next page
Before this commit:
    The records displayed on the page are not ordered and contain only
    the values used for sorting.

After this commit:
    The records displayed are the correct ones for the sort and contain
    all the values.

Part-of: odoo/odoo#114024
2023-07-24 20:17:50 +02:00
FrancoisGe 5987e95ec2 [FIX] web: sort x2m on multi fields
Before this commit, go to a form view with an x2m displayed in list mode.
If you sort the x2m on two differents fields, a crash is displayed.

How to reproduce:
- Go to a form view with an x2m in list mode with at least 2 columns sortable.
- Click on a column to order
- Click on a second column to order

Before this commit:
    We have a crash

After this commit:
    The list is ordered correctly

Part-of: odoo/odoo#114024
2023-07-24 20:17:50 +02:00
218ad8456a [REF] *: adapt codebase to new RelationalModel
This commit adapts the code in addons w.r.t. the introduction of
the RelationalModel.

Main changes that were requested are:
 - record datapoints no longer always have an "id" key in their
 data (they still do if the id field is in the view), so we use
 record.resId instead
 - the new model is based on fined-grained reactivity, so several
 components that previously relied on onWillUpdateProps to update
 their internal state no longer worked. Typically, using the hook
 "observeRecord" is the way to go now.
 - specialdata are no longer handled in the model, so the components
 needing specialData can use the hook "useSpecialData"
 - more generally, all overrides of models (RelationalModel or
 KanbanModel) needed to be reworked.

Part of task~3179751

Part-of: odoo/odoo#114024
Co-authored-by: Aaron Bohy <aab@odoo.com>
Co-authored-by: FrancoisGe <fge@odoo.com>
Co-authored-by: Jorge Pinna Puissant <jpp@odoo.com>
Co-authored-by: Pierre Rousseau <pro@odoo.com>
2023-07-24 20:17:50 +02:00
8723f020c3 [REF] web: new RelationalModel
Before this commit, we had several implementations of a relational
model. The form view used the BasicRelationalModel, which was a
wrapper around the BasicModel. The list view used the
RelationalModel (a simpler version that didn't support complex
usecases of x2many fields). The kanban view used the KanbanModel,
an extension of RelationalModel.

This commit removes all these, and replaces them by a single model.
It is called RelationalModel, and as a similar structure as its
predecessor (with datapoints). It now handles tricky x2many usecases
of the form view though.

This commit also comes with several important changes:
 1) The new model is based on unity reads [1]. This means that all
 data required by the view is fetched at once, and datapoints are
 created with their data (whereas before, they were responsible to
 fetch their data). There's an exception for special data: they are
 no longer handler by the model. A hook "useSpecialData" has been
 created, and it allows fields (components) to fetch additional
 data they require.

 2) The new model uses onchange2 [2]. With onchange2, we send and
 receive a diff, instead of the whole state of the record. Morever,
 onchange2 uses unity, which means that returned commands for x2manys
 (e.g. command 4, LINK) contain the values of the corresponding
 records, so we don't need to fetch them in a separate call
 afterwards.

 3) The new model no longer triggers deep renderings (render(true)).
 It is instead based on fine-grained reactivity (i.e. only what
 depends on what has changed is re-rendered). We introduced a hook
 "observeRecord" which allows a component to subscribe itself to
 some keys in a record datapoint, and register a callback to
 execute when those keys change (e.g. to fetch data).

[1] odoo/odoo@7d2baaa0c7
[2] odoo/odoo@f5e6494da3

Task~3179751

Part-of: odoo/odoo#114024
Co-authored-by: Aaron Bohy <aab@odoo.com>
Co-authored-by: FrancoisGe <fge@odoo.com>
Co-authored-by: Jorge Pinna Puissant <jpp@odoo.com>
Co-authored-by: Pierre Rousseau <pro@odoo.com>
2023-07-24 20:17:50 +02:00
Raphael Collet 7bfbd75d57 [FIX] core: web_read() on new records
This completes 96a98f4f4c in the case
where a many2one field has a new record as value, even when that
many2one field is not a delegate field.

Part-of: odoo/odoo#114024
2023-07-24 20:17:49 +02:00
luvi 273556d16d [IMP] web: improve selection with SHIFT in list view
This commit improves the selection of records in list view using the
SHIFT and arrow keys. In task 2039894, it has been made possible to
select a range of records using the keyboard, but the experience was
confusing. So, the latest task aims to improve the situation regarding
selection with keyboard and navigation.

A test has been added to verify the behavior when selecting multiple
rows, using multiple ways of interaction (SHIFT + arrow, click,
navigate and select).

task-3418715

closes odoo/odoo#128995

Signed-off-by: Florent Dardenne (dafl) <dafl@odoo.com>
2023-07-24 18:38:18 +02:00
Rmi Rahir (rar) 396fdf3953 [FIX] spreadsheet: Fix dark mode assets
The dark mode assets were mistakenly loaded in the default backend
assets, effectively overriding the light theme for spreadsheet 100% of
the time.

closes odoo/odoo#129339

X-original-commit: 97cf8bf7f757b82bdecd6a4531d6b00fcd591bd9
Signed-off-by: Lucas Lefèvre (lul) <lul@odoo.com>
Signed-off-by: Rémi Rahir (rar) <rar@odoo.com>
2023-07-24 15:52:08 +02:00
Martin Trigaux 935857e01d [FIX] base: do not remove groups added in implied groups
If a user goes from "Access Rights" (base.group_erp_manager) to
"Settings" (base.group_system) he gets an error telling him he did not
belong to Access Rights group.

The reason was that the modification of accesses on the user profile
page was doing
write({'sel_groups_2_4': 4})
which was transled, after the _remove_reified_group call into
write({'groups_id':[(UNLINK, [2, 4]), (LINK, [4]]})
so the user was temporary in a state where he was in the group_system
but no in group_erp_manager.
When the implied groups where computed, an access error was raised as
the administrator was not allowed to modify res.users record (need
group_erp_manager).

Simplify the _remove_reified_group call to only convert the call to
write({'groups_id':[(LINK, [4])]})

closes odoo/odoo#129335

Task-id: 3265053
X-original-commit: 0ed2fa018a7716f0fb3abe587983209403445fc8
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2023-07-24 15:52:05 +02:00
Ruben Gomes a2b0c9281d [IMP] account: usability improvements
This commit is part of the refactoring and improvement of the html and css of account_reports (enterprise).

Here we:

- Remove blank_if_zero default value of True, it is now False by default. The zeros are now shown in a muted gray color.
- As we had a level of hierarchy 0 that allows for some further styling we needed to adapt _compute_hierarchy_level to take it into account when calculating the increase level. So if the level is 0 or 1, the child will have a level of 3 either way.
- Removed some UPPERCASE column styling.

Task-id 3251726

closes odoo/odoo#129232

X-original-commit: 56a7f7745c5df9b70e6fe5b78f401085ce46284c
Related: odoo/enterprise#44436
Signed-off-by: Olivier Colson (oco) <oco@odoo.com>
2023-07-24 15:51:57 +02:00
niyasraphy 971fc65a7d [IMP] base_import_module: show only zip file to select
before this commit, in the import module wizard the
end user can select any type of file in the upload
file field and clicking import it will say only zip
format is supported.

after this commit, on clicking upload files, only
zip files will be shown to the end user to select,
which will make easy to select the files from
 directory

closes odoo/odoo#128484

Related: odoo/enterprise#44089
Signed-off-by: Luca Vitali (luvi) <luvi@odoo.com>
2023-07-24 12:49:21 +02:00
Antoine Guenet b68e06e20a [FIX] web_editor: properly convert rgba colors to hexadecimal
We currently convert rgb colors to hexadecimal, but not rgba colors.
Unfortunately since many Bootstrap border colors are defined as rgba,
this meant that these were not properly converted for Outlook (which
doesn't support rgba).
To convert rgba while losing the transparency information we need to
"flatten" it by taking in consideration the background color.

closes odoo/odoo#129153

X-original-commit: dc56506cffa5a13508ca24018d4f0a25c5353cca
Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
Signed-off-by: Antoine Guenet (age) <age@odoo.com>
2023-07-24 11:28:51 +02:00
Antoine Guenet 5ea4baa612 [FIX] web_editor: prevent double quotes in font-family style
The `font-family` style can sometimes include double quotes. This isn't
really a problem since these get escaped (`&quot;`) but emailonacid
currently has a bug where the double quotes cause every subsequent style
to be ignored, and the rendering to be incorrect. For the sake of future
testing, this converts them to single quotes. It also removes the style
entirely from image elements since they don't make sense there.

X-original-commit: 03c7e69db63f326c7a3b3085debc5d3a5c95966d
Part-of: odoo/odoo#129153
2023-07-24 11:28:51 +02:00
Antoine Guenet b2f1d72a03 [FIX] web_editor: properly set image width attributes
A semi-colon unfortunately took the place of a double pipe in code that
retrieves an image's width in order to set its width attribute. This led
to some images being wrongly sized.

opw-3299392

X-original-commit: 0a21da39f05ef9ec9d202424e0e648849f44e164
Part-of: odoo/odoo#129153
2023-07-24 11:28:51 +02:00
bve-odoo 7689a79053 [FIX] account_edi_ubl_cii: handle ubl version 2.2 and 2.3:
Customer reported an XML file with an UBL_version 2.2
reported <cbc:UBLVersionID>2.2</cbc:UBLVersionID>
at the beginning of the XML file.

As reported on the wikipedia page of the
'Universal Business Language' (UBL):
- the version 2.2 has been approved&published on July 2018.
- the version 2.3 has been approved&published on June 2021.

opw-3316684

closes odoo/odoo#129043

X-original-commit: 5b011440eb96ab02aaaa3b3754d0475a01a2ef16
Signed-off-by: Baptiste Vergote (bve) <bve@odoo.com>
2023-07-24 11:28:47 +02:00
Hubert Van de Walle (huvw) 877b8a9031 [FIX] web: multisave take manual changes into account with a single record
Steps to reproduce
==================

- Go to documents
- Click on a document
- Add a tag

-> Nothing happens

Cause of the issue
==================

Since https://github.com/odoo/enterprise/commit/e35017719d0996279f362423a7b4b1c6e30b9766 ,
the documents app uses the _multiSave method from the relational_model.

If the selection is of only one record, the changes passed to the method
are ignored.

opw-3393862

closes odoo/odoo#128515

X-original-commit: 7e361761d20ddc64c62b85f3496e1596dc42987b
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
Signed-off-by: Hubert Van De Walle <huvw@odoo.com>
2023-07-24 11:28:45 +02:00