This commit solves two bugs:
1. In a grouped empty list view, if you click on a sortable column,
then a crash is displayed.
How to reproduce:
- Go to a grouped empty list view with at least one sortable column
- Click on the sortable column
Before this commit :
A crash is displayed
After this commit:
Nothing happens.
2. In a grouped view with at least one open group, columns that do not
have an aggregates value cannot be sorted.
How to reproduce:
- Go to a grouped list view with at least one open group.
- Click on a sortable column that does not have an aggregates value
Before this commit:
Nothing happens
After this commit:
The records are sorted by the clicked column.
closesodoo/odoo#102143
X-original-commit: 537bbc79fe0ce34fe8b4746bf4cc86f9ebfc8a12
Signed-off-by: Mathieu Duckerts-Antoine <dam@odoo.com>
Signed-off-by: Georis François (fge) <fge@odoo.com>
Keyboard navigation was misleading, and it was adding a box around
focused which was irremovable because it was injected by the browser
closesodoo/odoo#102033
X-original-commit: 519bbe4b55c907bcd71d03e34dbc706d13a2268b
Related: odoo/enterprise#32235
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
Before this commit, in a list view, html fields in readonly mode were
not rendered correctly. It displayed unprocessed HTML.
For the value :
<div>Hello</div>
Before this commit, it was displaying:
<div>Hello</div>
After this commit, we display:
Hello
closesodoo/odoo#101253
X-original-commit: a6292c17b886996c82c797e562b725d63d4a5b7e
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
Before that commit, it was not possible to select some part only
of a input/textarea input in an editable list view.
closesodoo/odoo#102169
X-original-commit: e572c11ecfb994a474ce800e46895e9233fae64b
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
In the conversion of the FormViewDialog from legacy to wowl, we
forgot the feature allowing to display a "Remove" button in the
footer, and to execute a custom callback when this button is
clicked. This is used for instance by the Gantt view.
This commit restores the feature.
closesodoo/odoo#102149
X-original-commit: 3eb126d0297a7e3db0cb98cd1ad9555eefaa0cfa
Related: odoo/enterprise#32281
Signed-off-by: Géry Debongnie <ged@odoo.com>
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
Before this commit, clicking on view buttons with attribute
`close="1"` in FormViewDialog didn't close the dialog once the
button action was performed. This commit fixes that issue, and
ensures we do not reload the record if we're about to close the
dialog.
X-original-commit: 32d211a6fd5c121fa5f556f1d78b79421edc6f68
Part-of: odoo/odoo#102149
Before this commit, creating a new record with the "many2many" widget
did not allow to use a context containing a default value
for the parentID (id of the Record containing the many2many).
This value is ignored.
How to reproduce?
- Go to a form view with a field using the "many2many" widget
with context = {"default_parentID" = ...}
- Click on "Add a new line"
- Click on "Create" (The form view should display the parentID field)
Before this commit:
The parentID field is empty.
After this commit:
The parentID field contains the record corresponding
to "default_parentID".
closesodoo/odoo#102157
X-original-commit: a52eacc5397dc2f98eb052f4cd1e362a97621074
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
Click on the back button in the model field selector popover used to
often remove too many names in the path created via the selector. For
example, starting with "partner_id.name" and clicking on the back button
in the opened popover would give the invalid path "" instead of
"partner_id". We fix that problem.
closesodoo/odoo#102156
X-original-commit: e4a7b63c68a87d7afef987e8d036d7ba9c5b6f96
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
Signed-off-by: Mathieu Duckerts-Antoine <dam@odoo.com>
In a domain selector, have a selection field and the operator "is set"
selected, then change the operator to be "=". A crash occurs. This
happens because the category of operator change and thus the function
onDidTypeChange of DomainSelectorSelectionField is called with no
parameter. The same problem can happen with DomainSelectorDateTimeField.
We fix that by calling component.onDidTypeChange with the right
parameter in any case.
X-original-commit: a01c2473d93d0d123391ba0131ad505775b3c50b
Part-of: odoo/odoo#102156
Before this commit, a virtual record in form view always had the
o_form_dirty class, which is problematic when a tour ends with a virtual record.
After this commit, a virtual non-dirty record in form view doesn't have
the class o_form_dirty, and doesn't have the o_form_saved either as that doesn't make more sense.
closesodoo/odoo#102153
X-original-commit: 0041b9fd8eb75d5b680d94d491e2b9f684b2d0c1
Related: odoo/enterprise#32282
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
A new useDraggable hook is introduced and used in the various components that
use the feature.
It relies on the draggable hook builder which is a generic way to prepare
specific drag and drop features.
X-original-commit: cb1cfe5f5efe1b683d7fdffde3718bd8bf1bcd86
Part-of: odoo/odoo#102153
Have a form arch containing
```
<notebook>
<page class="myClass" />
</notebook>
```
Before this commit, "myClass" did not appear in the final DOM.
After this commit, it does.
X-original-commit: e886adcb38695bcfa8a9f741d4e496229fb199ff
Part-of: odoo/odoo#102153
In which case we just don't render any Renderer.
Useful when we want to render invisible fields.
X-original-commit: e77afa6266a66e9d126d9a0293bb3e0eb8fb0ff3
Part-of: odoo/odoo#102153
The mapping operations between the new RelationalModel API and the
BasicModel is now done in its own file
X-original-commit: 1202610ce6946ee4b2878e19e6ee6038edc9a71e
Part-of: odoo/odoo#102153
The goal of this commit is to fix the behaviour of clicking on a field
with the "many2one_avatar" widget in a list view.
Expected behaviour when clicking on a field with the "many2one_avatar" widget:
- Editable list view: switch row to edit
- Multi_edit list view with selected record: switch row to edit
- Other case: open the many2one_avatar record in a form view
Before this commit, clicking on a field with the "many2one_avatar" widget always
opens the record in a form view.
After this commit, the expected behaviour when clicking on a field with
the "many2one_avatar" widget is respected.
closesodoo/odoo#102146
X-original-commit: ad597d414c59723d3c6af5dfdc1a3a41fd4f4032
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
Adds `width: 100%` on the `.o_field_widget` so the input it can take the
all width in the "Quick Create" form.
Also, this commit fixes the CSS selector for the `margin`
rule as in the "Quick Create" form view there is no `.o_group` anymore
on `.o_inner_group`.
Steps to reproduce:
* Go to project
* Select a project
* Click on the `Create` button => BUG
closesodoo/odoo#102151
X-original-commit: 774213758c7ddf7b74a9b370457f017e09d9bbcf
Signed-off-by: Adrien Dieudonné (adr) <adr@odoo.com>
Signed-off-by: Romeo Fragomeli (rfr) <rfr@odoo.com>
Toggling an optional field was unselecting the row, but didn't correctly
copy the same bahavior than legacy when it comes to the saving and
discarding of the data being edited.
However, by simply removing the line of code unselecting the row, we get
a better ux for no cost. The user can continue the record edition after
adding or removing columns.
Note that the focus will always be reset to the first column though.
closesodoo/odoo#102142
X-original-commit: 63c87eac6173af13ec84f90a7f25f07a074197f3
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
Signed-off-by: Simon Genin (ges@odoo) <ges@odoo.com>
This commit is the revert of #98703.
closesodoo/odoo#102116
X-original-commit: 64c0ed09f058cff9b3cebfe5480a7efd0caa7be6
Signed-off-by: Simon Genin (ges@odoo) <ges@odoo.com>
Signed-off-by: Dardenne Florent (dafl) <dafl@odoo.com>
The event listeners were added to the upload object instead of the xhr
object making them being called before they were supposed to.
closesodoo/odoo#102061
X-original-commit: 804467d7b0a583ab36a47212d482b41d29ca2203
Related: odoo/enterprise#32247
Signed-off-by: William Braeckman (wbr) <wbr@odoo.com>
This commit applies the proper spacing between FormView's buttons in a
Dialog's footer.
Steps to reproduce:
- Open Notes
- Enable debug mode
- In Debug menu, open "Edit View: List"
=> dialog's buttons have no spacing
closesodoo/odoo#101974
X-original-commit: f67a8fff6c86a67ce2f6a162f1de992fe25eefbd
Signed-off-by: Adrien Dieudonné (adr) <adr@odoo.com>
Signed-off-by: Pierre Paridans (app) <app@odoo.com>
Allow our users to modify mail template more easily
- make the list accessible from the settings
- give them a link to update relevant views to update header/footer
- make the list and form of templates more readable
- add a description on templates, allowing to describe their usage
In order to better filter templates, a new category field is added that
is computed based on active flag, description being set and the template
having an xml ID. Master templates are active, with a description and an
xml ID.
Update master data to add description on some templates.
task-2944770
closesodoo/odoo#101730
X-original-commit: dfa867343ee8842f3f127ac62584fd471b41dde1
Related: odoo/enterprise#32079
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
Have a list view with more records that can be displayed with the current
limit. Go to next page and group by some field that produces fewer groups
that the current offset. Before this commit, no group is shown because
the offset is kept when the list reload. The same thing can happen when
the domain is changed.
We fix that bug by setting the offset to be zero when the list reload.
closesodoo/odoo#101975
X-original-commit: bda0bd21c8e6772cbfb0680a2b8b497dbbcfd628
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
Signed-off-by: Mathieu Duckerts-Antoine <dam@odoo.com>
Before this commit, printing an invoice which is not
created yet reloaded the view with a new record.
Now, the view reloads with the current record.
closesodoo/odoo#101947
X-original-commit: 0bad6ae4185d9b25684d0c47c9cee7c098053707
Related: odoo/enterprise#32191
Signed-off-by: Jorge Pinna Puissant (jpp) <jpp@odoo.com>
Currently, the keys passed through the t-foreach for looping over the
groups has a flaw. It comes from a method that works as below:
It checks the group has a value => provide a key as group_key_{value}
if not => group_key_{i} where i is the iteration index
But the {value} is acutally just an id of some model. So in some cases,
with low ids (empty DB, tests, ...), you can run into situations where
the keys are duplicates, making owl crash.
This comit fixes the function to make sure it has no duplicates.
closesodoo/odoo#101925
X-original-commit: aadb38e259c25cea69d54c3c62b21d8e747f9b87
Signed-off-by: Julien Mougenot (jum) <jum@odoo.com>
A rule was missing from the copied legacy rules
Note:
`form-break-table` was not only applied for small screen but also for
other case like quick edit in Kanban.
Steps to reproduce:
* Open Project
* Select a project
* Click on the Create button => BUG
closesodoo/odoo#101930
X-original-commit: de78e8bcbbc02be9024a1dd08379306ae56b0a2a
Signed-off-by: Adrien Dieudonné (adr) <adr@odoo.com>
Setting the attributes `can_create` and `can_write` in views
which are not editable is useless as you cannot edit the record
in these views.
This allow to gain some KB when serving the view to the web client,
as well as making the view cleaner.
e.g. the graph view in the CRM > My Pipeline menu
Before:
```xml
<graph string="Opportunities" sample="1">
<field name="stage_id" can_create="true" can_write="true"/>
<field name="user_id" on_change="1" can_create="true" can_write="true"/>
<field name="color" modifiers="{"invisible": true}"/>
</graph>
```
After:
```xml
<graph string="Opportunities" sample="1">
<field name="stage_id"/>
<field name="user_id" on_change="1"/>
<field name="color" modifiers="{"invisible": true}"/>
</graph>
```
This revision takes the opportunity to port the `editable` concept
from the server to the web client MockServer,
in order to be able to test the removal of these attributes from the views
in the QUnit tests.
The `_editableNode` JS function added here is the translation of the
existing `def _editable_node` method in `addons/base/models/ir_ui_view.py`
https://github.com/odoo/odoo/blob/f5edde3624f4fe40f87cc7fed7dcfc4bbce1f19f/odoo/addons/base/models/ir_ui_view.py#L1282-L1301closesodoo/odoo#101902
X-original-commit: f0beddf534a57e972ac3a7bef6afa1caae1dcff3
Signed-off-by: Denis Ledoux (dle) <dle@odoo.com>
This commit removes unecessary overrides of the Notebook component
styling in the Form and Kanban columns examples.
Additionally, it also moves the most generic styles (like responsive)
into the Notebook component itself.
closesodoo/odoo#101868
X-original-commit: c1b9905b2e17ca0fda3aeb152c2927031d1662c4
Related: odoo/enterprise#32158
Signed-off-by: Adrien Dieudonné (adr) <adr@odoo.com>
*: im_livechat, survey, utm, website_crm_iap_reveal, website_forum,
website_livechat, website_sale, website_sale_comparison
Before this commit all cookies were considered essential.
This commit makes some of them optional. It also makes it possible for
the website visitor to only accept the essential cookies.
task-2800976
X-original-commit: 9a8a9463289a7446e9be0ef62ff895feb37a4de4
Part-of: odoo/odoo#101845
Co-authored-by: Benoit Socias <bso@odoo.com>
Steps to reproduce:
- Go into settings > Configure Document Layout
- Choose layout boxed
- set a company tagline
- click "download PDF Preview"
Issue:
The styling of the company tagline is not the same on the pdf and
the preview
Cause:
Module lxml from etree would not interpret the html the same way as
the browser. In the browser, we would have a 'p' markup inside of the
'h4' for the title. Effectively applying the style from the css
sheet. In the pdf, the lxlm module place the 'p' markup after the
'h4'. Therefore it would not receive the styling of the 'h4'.
Reproduction:
```
>>> from lxml import html
>>> html.tostring(html.fromstring('<div><h4><p>hi</h4></div>'))
b'<div><h4></h4><p>hi</p></div>'
```
Solution:
Modify the structure so we have a `<div class="h4"/>` element that does
not have this issue. In version before 16.0, a CSS hack was used
to keelp the structure the same.
opw-2846247
closesodoo/odoo#101666
X-original-commit: 5aaf60809f596f4ec3ae9c3bc4795b3044da0281
Signed-off-by: Nicolas Lempereur (nle) <nle@odoo.com>
On the invoicing, the subtotal/total element is misaligned due to the
nesting inception of groups. This commit forces to push the element to
the end (`right`) of the line.
Steps to reproduce:
* Go to Invoicing
* Select an invoice => BUG
closesodoo/odoo#101835
X-original-commit: 27119175d89fbb874967816886eced80cf4b22bb
Signed-off-by: Adrien Dieudonné (adr) <adr@odoo.com>
Since the merge of the CSS Grid system in form view, in form view where
there is a "subtotal", it was miss aligned.
In this commit, we fix two point:
* we use the following CSS rules to don't be impacted by the
`float: right` elements (e.g. "Coupon Code") and to push all element
to have the space between.
```css
.o_field_section_and_note_one2many ~ .row.o_group {
clear: both;
justify-content: space-between;
}
```
* we modified the form compiler (group) to not add layout/positiong
CSS rules on the empty `clearfix` element from the ARCH. As before this
commit this `DIV` was also used for the formula to spread the size on
the children of a group.
Steps to reproduce:
* Go to sales
* Select a quotations => BUG
X-original-commit: cdc00b03b77cc08bde14ffbc9e6867650f316ea3
Part-of: odoo/odoo#101835
We don't we to add padding on the listview embedded in a form view.
So we have added a `:not(.o_field_x2many_list) > ...` on the original
rule to avoid adding these padding on `o_field_x2many_list`.
Steps to reproduce:
* Go to Sales
* Select a Quotation => BUG
X-original-commit: c016560b6b199f00e0d248025a81be02caddff54
Part-of: odoo/odoo#101835
Since the `Many2OneAvatarField` field was rewritten in OWL component,
there is a newline between the image and the input.
We apply a `d-flex` on the parent to fix the problem.
Steps to reproduce:
* Go to Helpdesk
* Select a ticket
* The field `Assigned to` is on two line => BUG
X-original-commit: 1c88a43a4332ea4fa21ae2b04fdb8869300250d8
Part-of: odoo/odoo#101835
On large screen, the sheet in form view has too much space around.
This is due as the `max-width` was set to the `width` of the `XL`
container and not the `XXL`.
Note the size in `$container-max-widths` are:
* sm: 540px
* md: 720px
* lg: 960px
* xl: 1140px
* xxl: 1320px
Steps to reproduce:
* Open a form view with a sheet => BUG
X-original-commit: 27450c9c5d76fee9922a4625f5129b91976a6c55
Part-of: odoo/odoo#101835
This commit restores the highlight on the row when we navigate with the
keyboard.
Note we use `:focus-within` to maintain the highlight when we are in a
sub element of the row (e.g. `th`, `td`, some sub `div`, ...)
Steps to reproduce:
* Open a list view
* Use the keyboard to navigate => BUG
X-original-commit: 277fbfadd03133187b6d015f996e5197db5da5b1
Part-of: odoo/odoo#101835
Some overrides of search might allow to sort on non sortable fields like
my_activity_date_deadline on crm_lead. An option allow_order was used
to indicate that to the legacy list view. The new list view introduced
with https://github.com/odoo/odoo/commit/bc0a0cead62edd1e0b299fb9a90cd21792814618
no longer consider that option and consequently the Pipeline list view
of crm can now longer be sorted by my_activity_date_deadline. The same
happens in some other views.
In this commit, we reintroduce the use of that option in the list view
and fix that problem.
closesodoo/odoo#101837
X-original-commit: 52481d55ef857ffc1004d27216cbf6b81a527b14
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
Before this commit, open an act window action asking for a tree view
would cause a crash. We fix that.
closesodoo/odoo#101831
X-original-commit: fa6fd8b079ad3347f3571654f07bf9751834654d
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
Before this commit, with its default props, the SelectCreateDialog
displayed a "Create" button in its footer, but clicking on it does
nothing.
This commit simply opens a FormViewDialog to create a new record
of the given model, like in legacy. This default behavior can still
be overridden thanks to the props "onCreateEdit".
X-original-commit: 3afaad687e8ca8cb34a7bf7121e75a5a583762ed
Part-of: odoo/odoo#101819
Before this commit, in a form view, the state selection button was
placed on the left. It should be on the right.
closesodoo/odoo#101818
X-original-commit: c5f22e1f0b8f1f0eae42666ec5732e590957e21e
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>