This module didn't worked on mobile: user cannot select the products or
see their cart.
This commit reworks the LunchKanbanWidget template and introduces a
dedicated template for mobile. This template introduces a button at the
bottom of the screen to toggle the "cart" widget on mobile (hiding it by
default).
It tries to make the best use of the existing Bootstrap classes allowing
to have a more responsive layout and reducing the custom CSS required by
this module (both in desktop and in mobile).
This commit adds a decent JS tests-suite (mobile & desktop) to this
module as the existing one left substential parts of the UI untested
(opening wizard when clicking on a kanban record, cart's lines content,
clear cart button, widget structure and content based on the state...).
Those tests are also less based on DOM nodes order/tag names and use
instead dedicated classnames.
It also modifies the LunchKanbanRecord click handling to had a dedicated
event handler instead of overriding the default _onGlobalClick() and
make it more testable.
Task ID: 1945032
Create a record.
Add an attachment, using the widget (aptly named 'add an attachment').
It is not set as message_main_attachment_id.
If you add the message through 'log note', then it is.
We add a hook to make sure that it is set as message_main_attachment_id
when added through the widget.
opw 1950403
closesodoo/odoo#31847
Signed-off-by: Nans Lefebvre (len) <len@odoo.com>
The issue is manifesting for example in the Contact kanban view where the
company image should be displayed in small. Before this fix, the person image
was displayed twice instead.
Following PR #30881 and commit: f78b7a76d6
The fix introduced by the above commit highlighted another issue with the
method: if the `model` and `id` given in parameter are different than the
current record, the method returned the url for the current record instead of
the requested record.
To fix the issue, we return the `raw_value` only if the requested record is the
current record. Otherwise, we return the manually built url.
PR: #31842
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
The widget handle was displayed on x2m fields in form views, even when
the field was readonly, which makes no sense.
It is now correctly hidden.
Fixes#30580
opw-1937833
closesodoo/odoo#31743
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
Before this commit iteration in a t-foreach containing null or
undefined values crashed because they have no attributes.
closesodoo/odoo#31828
Signed-off-by: Fabien Meghazi <amigrave@users.noreply.github.com>
This makes the assets to be recomputed everytime somebody with a different
language load the page.
closesodoo/odoo#31782
Signed-off-by: Olivier Dony (odo) <odo@openerp.com>
Have a list view, apply a group_by and a filter with a sort parameter
Click on one record to access the form view
Have a x2m within it
Before this commit, the x2m records were loaded with a context containing
the keys orderedBy and group_by
It seems harmless at first, but even conceptually those keys should not be here
- they apply on a list of records, and not to individual ones
- they may contain field names not existing in the x2m model
Hence, when accessing another list view through an action button, the list
will try to be orderedBy or group_by with the given context
Which is plain wrong in the first place and may cause crashes
After this commit, the context of a record datapoint (representing a single record)
is stripped from the keys
Read the opw for a concrete use case
OPW 1943583
closesodoo/odoo#31706
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
If the content is too long, it overflows badly.
Since the height is fixed, the flex doesn't work well.
opw 1924145
closesodoo/odoo#31717
Signed-off-by: Nans Lefebvre (len) <len@odoo.com>
Before 11.0 the kanban view used to have its own widget registry. It is not the
case anymore, but there are still leftovers from the past. For example, the
widget `kanban_label_selection` is still used in many views, even though it is
now called `label_selection`.
As we are in a stable version, a fallback has been added for it in the field
registry.
Similar to odoo/odoo@5401c15Closesodoo/odoo#30904Closesodoo/odoo#25928
The departments being already rendered according to the hierarchy,
only the name of the department should be displayed (e.g. 'Direct
Sales' instead of 'Sales / Direct Sales'.
closesodoo/odoo#31353
Signed-off-by: Raphael Collet (rco) <rco@openerp.com>
Since f8b38f64d dictionaries "groupbys" are the same object between the
pivot model instance and the headers menu.
But this causes an issue in 12.0 since when there is no results, the
headers menu groupbys is truncated and now being the same object, the
pivot model instance is also truncated.
So succedding search that find results would possibly have lost the
groupbys which is unexpected and breaks some 12.0 tests not expecting
it.
With this changeset, the groupbys are not truncated anymore.
Without the change, the added test fails with:
Column groupby not lost after reload after empty results
expected: { "pivot_column_groupby": [ "customer" ],
"pivot_measures": [ "__count" ], "pivot_row_groupby": [] }
result: { "pivot_column_groupby": [], "pivot_measures":
[ "__count" ], "pivot_row_groupby": [] }
closes#31644
Signed-off-by: Nicolas Lempereur (nle) <nle@odoo.com>
To reproduce:
1. go on list view
2. open record in form view
3. come back on list view
4. switch to kanban
5. open record in form view
6. click on breadcrumb
Before this rev. we were back on the list view, and not the kanban view.
This is due to the fact that the breadcrumb was not updated when switching view,
(if a controller was already existing) so the form view control panel breadcrumb
was still referencing the wrong (list) controller.
This bug appeared with the control panel refactoring, which is now managed by
the view itself (and not the action manager as previously).
Task 1932646
closesodoo/odoo#31598
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
In 11.0 f8b38f64d improved the column group by managment when reloading
several times by having the same "groupbys" dictionaries between the
pivot model instance and the header menu.
This has been reverted in 12.0 (with c6e7adfb95) because the following
pivot tests failed with the change:
- 'rendering of pivot view with comparison'
- 'export data in excel with comparison'
The failure is because now that the "groupbys" dictionaries are the same
object, the truncated dictionary of a header truncate the one of the
model instance.
So if we search something that has no results, then something with
results, the groupbys could be lost.
This behavior has no reason to be and is changed in 11.0 with #31644,
this commit is the forward-port of f8b38f64d and #31644.
closes#31627
Signed-off-by: Nicolas Lempereur (nle) <nle@odoo.com>
Commit 4960453d added the field signature in field_registry.js and
in signature.js.
closesodoo/odoo#31434
Signed-off-by: =?utf-8?b?R8OpcnkgRGVib25nbmllIChnZWQp?= <ged@openerp.com>
In the recent control panel refactoring, selecting '(no result)' (when using the
autocomplete on a many2one for example) was no correctly handled and was leading
to a traceback.
It is now correctly handled and the search bar is correctly re-rendered.
Task 1936745
closesodoo/odoo#31438
In 187c32c2 some improvements were made for conserving/restoring group
bys on the pivot view.
This introduced an issue on the column group by:
- before reload, if we set manually a column group by (+ icon in the
header) it would be saved and not lost (unless a context or filter
in the search view override it)
- after reload, the following manually set column group by are not saved
anymore on subsequent reload (the column group by at the first reload
are set back)
This behavior is not normal since the behavior (conserving or losing
column group bys) should be the same at first reload or second reload.
The issue was caused by the duplication of group bys that were not
synchronized (one on the column root header, one on the pivot model
instance).
Without the change, the added test failed with: "Column groupby not lost
after second reload" and product_id is hidding from the object
pivot_column_groupby dictionary (having only "customer").
Using _.clone on initialRowGroupBys was necessary change because without
duplication of "groupbys", the initialRowGroupBys would be changed on
expandHeader which is unexpected.
opw-1941095
closes#31407
Let's assume a many2one field with a lot of possible values. The
user clicks on 'Search More...'. In the opened dialog, only 160
records are available (their ids have been obtained with a
name_search, with the optional text the user could have typed in
the many2one input).
Before 4cd379cf, that extra domain on ids was removed automatically
as soon as the user interacted with the search view in the dialog.
This was especially useful when there were more than 160 records.
However, this was rather an happy coincidence than a designed
feature.
From 4cd379cf, the ids selection was added to the initial domain
of the list, so they couldn't be removed from the domain
afterwards. The user was thus stucked with its preselected 160
records.
This rev. doesn't restore the former behavior, but rather improves
the current one, as follows:
- when there is no text in the many2one input (i.e. no value to
filter on), we bypass the name_search, s.t. all records are
available in the dialog
- when there is some text in the input, we perform a name_search (as
before) to get a list of record ids, and we add a special filter
to the search view in the dialog (the filter on those ids), s.t.
the user can remove it if he wants to access the remaining records.
- finally, the limit is now set to 320, to mitigate the problem
Issue reported on the saas-12.1 migration pad.
closesodoo/odoo#31232
Installing the 'lunch' module add css rules to the generic list view
styling, modifying the styling of all the list views by the simple fact
of being installed.
The goal of those rules is that in list view a table cell with the
o_text_overflow class should still be displayed as a table-cell (and not
a block/inline-block).
Without the lunch module a list view's cell with the o_text_overflow
class is narrower and break the alignment between this column and the
headers.
This commit moves the necessary rule (display property) to the web
module and apply them globally.
Remark: module's css rules shouldn't override globally the one from
'web'.
Original commit: https://github.com/odoo/odoo/commit/855c6dac25fccaf9312543022001ed0b360d6e13closesodoo/odoo#31506