Commit Graph
9968 Commits
Author SHA1 Message Date
Priyanka Kakadiya 5f35819fff [IMP] web: remove 'ID' field from custom groupby dropdown
purpose of this commit is to remove ID from the fields to group by on the
searchview as it does not work nor does it make sense.

removed field 'ID' from custom group by on search view.

task-2028105

closes odoo/odoo#34752

Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2019-08-28 08:43:03 +00:00
Hardik Prajapati 272b041e53 [FIX] web: keep nocontent tooltip in center
Before this commit: nocontent tooltip was not diplayed in center

After this commit: nocontent tooltip will be displayed in center,
toggle o_list_view class which should not be added if nocontent
help is displayed, as there is no listview to display so remove
o_list_view class

task-2008371

closes odoo/odoo#34178

Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2019-08-28 07:25:32 +00:00
Mohammed Shekha 6952ee18bc [FIX] web: crashmanager wrong syntax of arrow function
arrow function used for error handler and error function is defined
inside inner function so this will get changed, need to use self,
also arrow function doesn't have its own arguments object,
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Functions/Arrow_functions

Issue raised from following commit:
https://github.com/odoo/odoo/commit/2d6dc75a2cb5fa81189920d0f7fdc7b7f12132ab

task-2052484

closes odoo/odoo#35788

Signed-off-by: pimodoo <pimodoo@users.noreply.github.com>
2019-08-27 12:13:43 +00:00
Pierre ParidansandDharmang Soni 9c8902ed57 [IMP] web: add extension hooks to Dialog
This commit adds two methods as hooks to customize the way Dialog deals
with its buttons :

* _setButtonsTo() : to render and set the buttons into a container
element;
* _setRemoveButtonOption() : to define the remove button and
set its destination zone (header, footer)

Task ID: 2038324

closes odoo/odoo#35474

Signed-off-by: Pierre Paridans <pparidans@users.noreply.github.com>


Co-authored-by: Dharmang Soni <dpr@odoo.com>
2019-08-26 14:13:06 +00:00
Julien MougenotandGery Debongnie 7812aec9c1 [IMP] web: editable list view resize
Added a resizing feature to all non-empty editable lists:
- added a handle to each column header, allowing resize
- column width will expand/shrink the table width
- resized columns will reset when reloading the list or sorting columns
- only available when the list contains data

closes odoo/odoo#35975

Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>


Co-authored-by: Gery Debongnie <ged@odoo.com>
2019-08-26 07:49:28 +00:00
Julien Mougenot 38910befdf [REF] web: add style tests for list view
Added tests for:
- monetary field in 'fixed width' test
- height and width consistency between edit/redonly
- textareas word-breaking on long words
2019-08-26 07:36:28 +00:00
Aaron Bohy 85bfef9ced [FIX] web: editable list: widths when toggling fields
Let's assume the following situation:
 - an empty editable x2many list with date field (or any other
   fixed width field) and optional fields
 - add a record to the list, but discard it directly
 - toggle an optional field

After those steps, the date field doesn't have its hardcoded,
absolute width anymore.

This rev. fixes this issue by clarifying the way the stored widths
are erased when the columns change, preventing to reach a corner
case in which we have stored widths, but we can't apply them, and
thus let the browser uniformly divide the space amongst columns.
2019-08-23 06:28:35 +00:00
Aaron Bohy e35c5e044e [FIX] web: editable list: force min-width to some columns
Columns with an absolute width (e.g. '120px') must always have a
width of at least that value. When there are records in the list
the column's widths are computed by the browser according to the
content (in readonly). However, for some field types, the rendering
in edition is a bit wider (e.g. date(time) fields because of the
caret).

This rev. sets a min-width to those fields such that the rendering
is also correct in edition.
2019-08-23 06:28:35 +00:00
Aaron Bohy f00f7bf00d [FIX] web: grouped list: correctly compute col widths
Before this rev., a grouped list view with all groups folded
behaved like a list with records w.r.t. the computation of column
widths, whereas it should behave like an empty list, as there is
no record to help the browser to compute the optimal width for each
record.
2019-08-23 06:28:35 +00:00
Aaron Bohy dddaff8418 [IMP] web: list: keep widths when removing last record
When there were records in the list (and the browser computed the
optimal column widths according to them), and the user removes
them, we want to keep the widths as they are instead of forcing
them according to the field's types.
2019-08-23 06:28:35 +00:00
Aaron Bohy 1824020cc2 [IMP] web: list: keep columns width when adding records
Mainly, when adding the first record to the list, as this is when
we switch from forcing the column's widths (when there is no data),
to letting the browser optimally divide the available space.

Some other cases had to be handled, like the multi edition.
2019-08-23 06:28:35 +00:00
Aaron Bohy 4393b012a5 [REF] *,web: list: merge width and width_factor attrs
Having two attributes for this was probably overkill. We now have
a single attribute 'width' which can specify either a fixed width
(e.g. '120px') or a factor (e.g. '2.5').
2019-08-23 06:28:34 +00:00
Aaron Bohy b2c09b4d3d [FIX] web: list: determine width according to widget
On a list with no data, the width of each column is determined by
a heuristic. Before this rev., the heuristic was based on the field
type. It now takes the potential widget set in the arch into
account, and fallbacks on the field type.
2019-08-23 06:28:34 +00:00
Géry DebongnieandAaron Bohy bf3c1d3e0c [IMP] web: editable list: column's widths
This rev. refines the way we compute column's widths in editable
list views.

When there are displayed records, we let the browser compute the
width of each column (which is thus optimal with respect to the
content), and we then freeze those widths s.t. it doesn't flicker
when we switch a row in edition.

When there is no record, we keep the former heuristic based on
absolute and relative widths (depending on field types). However,
we set the same weight for all fields having a relative width (i.e.
all but boolean, date(time) and numeric), such that the remaining
space is evenly distributed between them.

Co-authored-by: Aaron Bohy <aab@odoo.com>
2019-08-23 06:28:34 +00:00
Aaron Bohy 43ad74798f [REF] web: list renderers: lint code 2019-08-23 06:28:34 +00:00
Jigar Patel 4a771a6763 [FIX] web: use correct avatar field for many2many_tags_avatar field widget
The issue has occurred after rename image fields https://github.com/odoo/odoo/commit/58a2ffa26f1a3b0f9630ce16d11b758d18e20a21

closes odoo/odoo#35596

Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2019-08-09 11:21:09 +00:00
Géry Debongnie f926318a78 [IMP] web: keep dirty fields dirty
Before this commit, a simple optimization was done: if a field was
modified in such a way that the new value is the same as the initial
value, then it is not considered changed.

However, with the new changes in the ORM, it may be an issue, because
doing so loses the intent of the user.  If an onchange changes a field,
then the user changes it back, the server is not aware of that fact.

With this commit, we simply keep the field in the list of changes to
send to the server.

opw #2057230

closes odoo/odoo#35890

Signed-off-by: Raphael Collet (rco) <rco@openerp.com>
2019-08-21 08:27:42 +00:00
Parth Choksi ebaa132d5d [IMP] various: Clean settings UX (back2basics)
TaskID: 2028958

closes odoo/odoo#35551

Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2019-08-21 12:12:33 +00:00
Christophe Simonis 3faea8fbf8 [MERGE] forward port branch saas-12.4 up to f26de445e5 2019-08-21 10:10:11 +02:00
Christophe Simonis f26de445e5 [MERGE] forward port branch saas-12.3 up to 6f55fd65da 2019-08-20 12:17:04 +02:00
Christophe Simonis 168e54d488 [MERGE] forward port branch 12.0 up to 32039b2ab4 2019-08-19 18:57:08 +02:00
Aaron Bohy a32aa05a6b [FIX] web: list: break words in text fields
closes odoo/odoo#35713

Signed-off-by: Julien Mougenot (JUM) <Arcasias@users.noreply.github.com>
2019-08-16 06:37:07 +00:00
Aaron Bohy cf318ad90c [FIX] web: list: tweak columns weight 2019-08-16 06:37:07 +00:00
Christophe Simonis b2872e9bab [MERGE] forward port branch saas-12.3 up to 499d3efa7c 2019-08-13 10:08:12 +02:00
Jorge Pinna Puissant cb3c2e64c3 [FIX] partner_autocomplete, web: autocomplete error when suggested company has a country
- Change the company's country to Finland;
- Go to Contacts and click on Create;
- Tick the Company box above the Name field;
- Start typing into the Name field;
- Click on a company with a VAT number under its name.

Before this commit, a Traceback appears. This occurs because the
response of the request with the suggested company has the fields
'company_name' and 'company_code' and these fields are not in
res_partner.

Now, the suggested company is parsed to correctly field the country
field.

opw-2049636

closes odoo/odoo#35631

Signed-off-by: Simon Goffin (sig) <sig@openerp.com>
2019-08-12 08:39:07 +00:00
Jinal PatelandMohammed Shekha f0fdfbf44e [FIX] web: add support for TRUE_LEAF and FALSE_LEAF in ModelFieldSelector
before this commit, domain selector widget does not support
TRUE_LEAF and FALSE_LEAF i.e. [(1, '=', 1)] and [(0, '=', 1)] respectively,
the reason is the chain part of the domain i.e. field name has value 1/0 and
we don't have field name like 1 and 0 in domain and hence ModelFieldSelector
don't accept it

after this commit, domain selector can handle this special two domains which is
[(1, '=', 1)] and [(0, '=', 1)], add support for chain with 1/0 in ModelFieldSelector

task- 1998145

closes odoo/odoo#35603

Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>


Co-authored-by: Mohammed Shekha <msh@odoo.com>
2019-08-09 12:32:27 +00:00
Christophe Simonis 6e35cbc7ef [FIX] web: correct design of numeric column header
Oversight of previous forward-port.
2019-08-08 14:33:33 +02:00
Christophe Simonis b792ba7d9a [MERGE] forward port branch saas-12.3 up to 752b2553c6 2019-08-08 11:52:13 +02:00
Mathieu Duckerts-Antoine ba4ce71bf5 [FIX] web: favorites have unique descriptions
In the favorites menu, it was possible to create two
favorites with the same name (contrarily to the
specifications). The root cause of the problem was that
the submenus of the favorites menu were not updated at
all. This commit fixes that situation.

closes odoo/odoo#35495

Signed-off-by: Géry Debongnie (ged) <ged@openerp.com>
2019-08-07 15:24:06 +00:00
Mathieu Duckerts-Antoine 691a8a690c [FIX] web: toggle favorite correctly updates other filters status
When toggling a favorite filter, the options used by
the active date filters/groupbys and the field created
via autocompletion were not correctly cleared, leading
to strange situations. This is fixed by this commit.
2019-08-07 15:10:57 +00:00
qsm-odoo e5235747c5 [FIX] web, website: start public widgets after all lazy loadings
Bug introduced with
https://github.com/odoo/odoo/commit/1f5c9e363b6f7cb9a2770e6247536803fd13e3f0

Before this commit, the public/website root was started as soon as
the bundle it is in was lazy loaded. It then started all the registered
public widgets. The problem was that some of those may be registered
by other lazy-loaded bundles. The public root would then not start
those if those bundles were lazy-loaded with a too long delay.

This commit fixes the bug by starting the public/website root once all
known bundles are fully lazy-loaded.

closes odoo/odoo#35118

Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2019-08-06 11:09:43 +00:00
Christophe Simonis c687bd9aed Revert "[FIX] web: hide dashboard tooltip on page change"
Mow that the Journal Dashboard use Chart.js, this patch is unneeded.

This reverts commit 6d9dabd5d9.

Oversight of previous forward-port.
2019-08-07 16:29:42 +02:00
Christophe Simonis 7d04dc1c7c [MERGE] forward port branch saas-12.2 up to 9e74730a26 2019-08-06 18:48:24 +02:00
Christophe Simonis 0fadd586fa [MERGE] forward port branch 12.0 up to ff9ddfdacc 2019-08-06 15:57:57 +02:00
Christophe Simonis ff9ddfdacc [MERGE] forward port branch saas-11.3 up to 97d81f1220 2019-08-06 12:13:19 +02:00
Nicolas Martinelli 91399aed95 [FIX] web: RTL on list view
- Set the user language to a RTL language, e.g. Arabic
- Open a list view containing float or monetary fields, e.g. the invoice
list view

The numbers are left aligned while the corresponding columns headers are
right aligned, making the list view confusing.

The header alignment is hardcoded at rendering rather than in the SCSS.
Therefore, `rtlcss` doesn't affect it.

Instead of hardcoding the alignment, we use a proper CSS class so it is
adapted by `rtlcss`.

opw-2044019

closes odoo/odoo#35414

Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
2019-08-05 08:18:34 +00:00
Julien Castiaux e26a5e46ff [FIX] web: spam new event creates multiple modals
On the Time Off, spam click to create a new event, each click opens a
new event form modal.

When the modal form fields have not been cached yet, the frontend
fetches them and delay the modal form opening after those fields have
been fetched. As the interface is still available. It is possible to
re-click multiple time during the fetch, each click schedules a new
modal form. When the first finally shows, they all stack on screen.

opw-203577

closes odoo/odoo#35098

Signed-off-by: Lucas Perais (lpe) <lpe@odoo.com>
2019-08-02 11:42:27 +00:00
Christophe Simonis 4ac13f85f4 [MERGE] forward port branch 11.0 up to 593f631e5e 2019-08-02 12:41:55 +02:00
Xavier Morel df1aa689be [FIX] web: race condition in export widget
Looks like the race condition dates back to the introduction of
"default" export fields but #32339 made it into a hard error (rather
than silently not load the fields): setting / selecting the default
fields waited in the exports lists to be loaded, but the exports lists
are just predefined lists of fields, that's got no relation to the
loaded or default fields, which are loaded (somewhat implicitly) by
_onChangeCompatibleInput.

As a result, if the lookup of the ir.exports was faster than fetching
the model's fields, we'd execute "select the fields from the list
view" before the exports widget knew anyting about the model's own
fields.

Because the old code iterated on the loaded fields and checked if they
were to enable it would just do nothing (as it would iterate an empty
object). Because the new code iterates on the defaults fields and
looks them up in the records map, it gets an undefined and triggers an
error.

Fix by waiting on the proper RPC call.

Reported-by: Andreas Stauder (@BT-astauder)

closes odoo/odoo#35837

Signed-off-by: Xavier Morel (xmo) <xmo@odoo.com>
2019-08-20 09:26:07 +00:00
Romeo Fragomeli 6e04e59ec5 [REF] web: calendar: allow to override popover
This commit move some code to be able to override
Bootstrap popover in web_enterprise for mobile.

Task ID: 2052506

closes odoo/odoo#35727

Signed-off-by: Adrien Dieudonné (adr) <adr@odoo.com>
2019-08-19 06:10:27 +00:00
Julien Mougenot 955856abf4 [FIX] web: no selected records after multi edition
After editing multiple record, we want don't want any
record selected. This commit ensures that.

closes odoo/odoo#35678

Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2019-08-16 09:03:49 +00:00
Julien Mougenot dd27b2e9c6 [FIX] web: multi edition in editable listviews error handling
Fixed crashes/incorrect behaviours in multi edition in the list views.
The solution to these problems was mainly to refactor the function
used to save multiple records.

Before this commit:
- Cancelling the confirmation dialog in multi edition caused
the edited record to be editable but disabled
- Saving an empty field in multi edition triggered a JS error
- Static confirmation message ("saving 0 valid records")

After this commit:
- Ability to cancel confirmation
- Proper error display when trying to save empty fields
- Message consistent with the situation
2019-08-16 09:03:49 +00:00
Julien Mougenot 291dad6bc8 [FIX] web: fixed crash in editable grouped lists
Adding a line in grouped listviews caused a crash in some cases.

Steps to reproduce:
- go in any grouped editable list view
- click on any "Add a line" cell, but not on the link itself
- press ENTER

Before this commit:
A crash occured. Unable to add a new line. Needed to refresh the page.

After this commit:
Line addition functionnality properly working even when selecting the outer cell
2019-08-16 09:03:49 +00:00
Julien Mougenot 4817c7f08f [REF] web: fix typos and incorrect variables
In this commit:
- removed an unused event handler
- fixed an overriden variable used in a subfunction
- fixed a variable mismatch

No bug was induced by these issues until now so it doesn't impact
any behaviour. This is just an extra security for the future.
2019-08-16 09:03:49 +00:00
Julien Mougenot 3c372d1da8 [FIX] web: prevent unwanted click on enter keypress
Pressing ENTER on a button element triggers an additionnal 'click' event.
Since this 'unwanted' click caused some issues in a few cases, we prevent it.
Moreover, there isn't currently any known case in which this event is useful.

Before this commit:
No modification of the initial behaviour on ENTER key

After this commit:
ENTER key pressed in abstract fields has its default behaviour suppressed
2019-08-16 09:03:49 +00:00
Julien Mougenot f88577ec70 [FIX] web: correctly display styles in list view
Before this commit, there was a slight offset preceding list selectors,
and the red border of invalid fields was not shown in community.

Now list selectors are correctly displayed as well as invalid fields.
2019-08-16 09:03:49 +00:00
Julien Mougenot b416c15a77 [IMP] web: dialog triggers custom callback on close
Added an option in the Dialog class to give it a function to run
when it's closed by other ways than by its buttons.
Its default value is the "cancel" callback if given, or none.

Before this commit, there was no way to add any callback to run
when the modal wasn't closed by a button.

Now, when exiting the modal by other means (e.g.: "Escape" key),
it will run a given callback.
2019-08-16 09:03:49 +00:00
Julien Mougenot bec84c10a1 [IMP] web: keyboard navigation between searchbar and renderer
This change allows direct keyboard navigation between the current action
searchbar and renderer.

Focus can now be toggled using DOWN arrow when focusing the searchbar
or the UP arrow when focusing the top cell/record of a kanban or a list.
2019-08-16 09:03:49 +00:00
Christophe Simonis 140ee6b8f0 [MERGE] forward port branch saas-12.4 up to 98a55917a6 2019-08-14 16:48:10 +02:00
Hetashree Chauhan 59f838d5b1 [IMP] web: Show all kanban records of same size
task-2042304
closes - https://github.com/odoo/odoo/pull/35482

closes odoo/odoo#35482

Signed-off-by: Simon Lejeune (sle) <sle@openerp.com>
2019-08-14 12:13:27 +00:00