Commit Graph
10686 Commits
Author SHA1 Message Date
Jigar Patel 9c8c8c4c8b [IMP] web: SearchView: "see result" button should be over the opened dropdown
In mobile search view, filter dropdown was overlying upon
'see result' button.

This button should be over the opened dropdown to make it
visible properly.

Task ID : 1987223

closes odoo/odoo#34022

Signed-off-by: Adrien Dieudonné (adr) <adr@odoo.com>
2019-09-17 08:51:21 +00:00
Adrien Dieudonne 3b3d35e8b9 [IMP] web: SearchView: Allow user to quickly search on mobile
Currently the search panel is nice for a search with filters but
that was not 100% efficient for simple research without filters.

The Search is now integrated in the form view, with the ability
to open the Search panel to apply filters or group by.

Task ID : 1924760
2019-09-16 15:11:28 +00:00
Adrien Dieudonne 8bef7af307 [REF] web: control_panel: breadcrumb and cp_searchview flexible width
1) The size of the left part of the control panel will take free
space left. Normally, the width is always fixed to 50/50 but
now the breadcrumb can take more or less space if needed.
It will be useful on mobile where the search bar is dynamically
sized.

2) Control panel elements are split into two divs;
- breadcrumb and search bar are grouped to be in the top.
- buttons (o_cp_left) and pager (o_cp_right) in the bottom.
Now we can easily add antoher elements in the top or bottom
part of the control panel.

3) Control panel template is likely the same on mobile so
they are now merged.

4) Before this commit, we always had an empty parent even if
the search bar wasn't rendered. Removing it makes the DOM cleaner.
Because of this, we are not able to expose this area used to add
custom elements. Some code need to be adapted.

Task ID : 1924760
2019-09-16 15:11:28 +00:00
Lucas Lefèvre ac00548b28 [IMP] web: Export list view as XLS file
Purpose
=======

Have a quick export feature.

The current export wizard is quite complex.
We want to be able to quickly export a tree view,
with the group by correctly represented, depending on the fields
visible in the list view.

Specification
=============

Add an "EXPORT (XLS)" button in the list view (a little download icon)
- export only columns visible in list view
- export all the records
- while respecting the group by

This should be a generic feature but should be applied to all
the account.move.lines list views.
account.view_move_line_tree_grouped_sales_purchases
account.view_move_line_tree_grouped_bank_cash
account.view_move_line_tree_grouped_misc

Task 2031835

closes odoo/odoo#36943

Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2019-09-16 13:57:40 +00:00
Aaron Bohy 127be68cca [FIX] web: do not disable searchpanel on button clicked
Before this rev., the searchpanel was automatically disabled (not
present) in actions obtained by following links or buttons (e.g.
stat buttons).

This rev. removes this constraint, but adds the possibiliy to
disable it by setting key 'search_panel' to false in the context.

Note that in this case, the active categories are never retrieved
from the local storage (i.e. the last one set). If no default is
given, 'All' is simply selected (no domain).

Task 2069310
2019-09-16 07:29:43 +00:00
fja-odoo 424adb63e3 [IMP] gamification, *: remove KarmaError
* = stock, test_website, web, website_forum, website_slides, base

Replace KarmaError with AccessError and remove the related override made
on crash_manager and ir_http.

task-2069890

closes odoo/odoo#36655

Signed-off-by: Jérémy Kersten (jke) <jke@openerp.com>
2019-09-12 13:49:02 +00:00
Christophe Simonis 5a273e74f0 [MERGE] forward port branch saas-12.4 up to fe59754c52
closes odoo/odoo#36721

Signed-off-by: Christophe Simonis <chs@odoo.com>
2019-09-13 13:32:51 +00:00
Xavier Morel 66df3f0479 [ADD] web: make export FAYT also match technical names
Previously only matched the label / user-visible name.

closes odoo/odoo#36472

Signed-off-by: Xavier Morel (xmo) <xmo@odoo.com>
2019-09-13 10:59:24 +00:00
RomainLibert 4c9624db9d [FIX] web: add context to /report/download
This commit fixes the /report/download route in multicompany

Since the multi company revamp (a5b6f31cf2)
the multi company rules depend on the context.

However the route /report/download was not forwarding any context, this meant
that when trying to read some fields on a record in a company that is different
than the default one, it would crash with the multi company ir.rule

Forwarding the context from the session in the Javascript call is quite simple
however since (521f7d36c1) it also requires to change
the signature of the `report_download` method in order to pass the context to the final
method.

As there was already some code allowing the adding of some context in `report_routes`
this PR reuses this code by simply passing the context as a kwargs.

closes odoo/odoo#36839

Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2019-09-13 10:00:34 +00:00
sri-odoo 94b3e339ba [REF] web: extend ui colours
closes odoo/odoo#36781

Signed-off-by: Géry Debongnie (ged) <ged@openerp.com>
2019-09-12 12:45:53 +00:00
Mathieu Duckerts-Antoine b39affc496 [FIX] web: click on an embedded pivot view cell does not causes a crash
The custom event 'open_view' triggered by the pivot
renderer was not stopped in the pivot controller. This
used to cause a crash because the dashboard controller
also listens to a custom event with the same name but
following another logic.
The present fix simply stop the propagaton of the event.
A test has been added in the module web_dashboard.

closes odoo/odoo#36466

Signed-off-by: Géry Debongnie (ged) <ged@openerp.com>
2019-09-12 13:09:35 +00:00
jbm-odoo 0538dc99fd [FIX] web: Widget timezone mismatch without value.
When employee try to edit his detail using my profile with empty
timezone and click on "Edit" button, it show traceback. It's coming
from the mistmatch timezone widget.

closes odoo/odoo#36593

Signed-off-by: Romain Libert (rli) <rli@odoo.com>
2019-09-10 07:26:48 +00:00
RomainLibert 653cccfd60 [FIX] web: Display event name on calendar popup instead of undefined
Purpose
=======

When you edit a Time Off Request from the dashboard. The title in the header
is undefined

https://drive.google.com/open?id=1vBg9AlVCN7rc5D6DUel8hx2uY-oOfwRs
2019-09-11 09:27:41 +00:00
jbm-odoo 5cddbbf9f2 [FIX] web + hr: Kanban view fix o_text_overflow
Fix o_text_overflow class (in contact for example).
Add class o_text_overflow in hr_employee view to avoid email to
be too long.

closes odoo/odoo#36626

Signed-off-by: Romain Libert (rli) <rli@odoo.com>
2019-09-10 12:20:37 +00:00
Hiral Bhavsar 1d2559ce64 [IMP] sale_expense, web: hide 'search more..' from m2o dropdown
Purpose
========
In expense, we now allow any simple employee (no sales access rights) to
select sales order. Technically, the name_search is done in sudo mode,
to allow simply fetching the name_get of record.

The problem is that the m2o field widget displays the "search more"
option and click on that will open a modal executing a "search_read"
which is causing access error as the user doesn't have read access on
SO.
As we want to restrict the visible information from the SO(only name_get)
to all user, we can't hack the search_read too.

Specification
=============
To prevent user frustration, we need to remove the "search more" option.
Thus, make a private function which one have 'search more..' option
related stuff and create a new widget for sale_expense, override that
function which one is returing values as it is without any modification.

task-2057714

closes odoo/odoo#36152

Signed-off-by: Jérome Maes (jem) <jem@openerp.com>
2019-08-29 12:56:24 +00:00
Lucas Lefèvre 50d2f188f8 [FIX] web: Display archive action if active in view
Since ee5e972, "Achive" and "Unarchive" actions are
automatically displayed in the actions dropdown
if the record has an `active` field.
The "Archive" action is shown if `active=True`, and
"Unarchive" otherwise.

However, if the record has the `active` field but
it's not in the view, the form controller think
`active=False` because `undefined` is falsy.
Therefore, the "Unarchive" action is always shown.

If `active` is not in the view, neither "Archive" nor
"Unarchive" should be shown.

closes odoo/odoo#36551

Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2019-09-10 11:46:01 +00:00
RomainLibert 39e5d93c97 [FIX] web: use New as default value for breadcrumb
Before this commit if `display_name` was in the view, the breadcrumb when
creating a new record, the breadcrumb would display either `Unnamed`,
either the last value of `_title` in `action_mixin`.

The default value when creating a record should be `New`, but the return
was ignored because `display_name` was found in the view

closes odoo/odoo#36565

Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2019-09-09 12:53:52 +00:00
Thanh Dodeur 554c0bce74 [FIX] web: searchPanel style tweaks for the panel selectors
Moves the custom documents search panel style to the search panel
of community to improve usability and fix several visual glitches.

closes odoo/odoo#36496

Task: #2061957
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2019-09-09 11:54:44 +00:00
Kevin Baptiste 9407383a56 [FIX] web: correctly position "no records found" in modal dialog
Before this commit, the message "No records found!" was positioned above
the search filters.

closes odoo/odoo#36537

Taskid: 2067797
Signed-off-by: Romain Libert (rli) <rli@odoo.com>
2019-09-09 07:09:48 +00:00
wan 2ad8d8c964 [REF] web: add public API to open the selectCreateDialog of a many2many
Part of task 2005972
It is used in account_asset, when the o2m field is hidden and at the end of the form, but we need the user to see it at the beginning of the form

closes odoo/odoo#36315

Signed-off-by: Quentin De Paoli (qdp) <qdp@openerp.com>
2019-09-09 14:22:27 +00:00
Vincent Schippefilt 029dd1a214 [IMP] web: edit translations in new dialog
Before this commit, translations were edited in a list view with a filter
on the field that needed to be translated.

After this commit, the translations for each fields are translated in a
dedicated dialog. The changes done to the current language are taken
into account immediately, both ways, from the dialog to the form and
from the form to the dialog.

Translating terms is also available in create mode, the user will be
prompted to save before editing a translation

Task ID: 2028152

closes odoo/odoo#36185

Signed-off-by: VincentSchippefilt <VincentSchippefilt@users.noreply.github.com>
2019-09-09 13:09:53 +00:00
Aaron Bohy 707882497b [FIX] web: tests: load template before FieldColor tests
The ColorPickerDialog lazyloads its template. In the test
environment, nothing was done (except for a single nextTick) to
ensure that the template has been loaded before interacting with
the dialog. This led to non deterministic failing runbot builds.

Also correctly load the signature template before running its tests
instead of doing two chelou nextTick();

closes odoo/odoo#36511

Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
2019-09-06 11:43:40 +00:00
jem-odoo ba05c66e09 [IMP] web: formview auto close dialog
Sometimes when using a form view in a modal (e.i.: in a gantt view), we might
want to have some button in the footer. We expect clicking on buttons to close
the dialog but nothing happens, since the webclient does not know that this is
a modal.
To do so, we provide the `close='1'` attribute on the button, in form view.
This will trigger the event closing the modal.

This is done with the benediction of aab-odoo

Task-2024216

closes odoo/odoo#36493

Signed-off-by: Jérome Maes (jem) <jem@openerp.com>
2019-09-05 20:11:28 +00:00
Kevin Baptiste 2df9d021e1 [FIX] base: Fix zoom on image fields
The goal of this commit is to adapt the zoom on image to the new names
of the fields made by PR #4865.

TaskID: 2049581
2019-09-05 07:34:33 +00:00
Aaron Bohy f60db9b93a [FIX] web: kanban: global click and 'image' widget
Let's assume a kanban view with oe_kanban_global_click className
(i.e. clicks on the card open the record in a form view), and an
image with the 'image' widget. This is for instance the case of the
hr.employee kanban view.

Before this rev., clicking on the image didn't open the record in
form view.
2019-09-05 07:34:33 +00:00
Christophe Monniez 95fefe6cc5 [FIX] web: avoid some external links in click_all test
Since 78565b1dc9 , two menus with an act_url action drive the user to
external websites. This makes the click_all test very fragile.

With this commit the Apps menus "Theme Store" and "Third-Party Apps" are
black-listed in the click_all test.

Also, it happens that a filter which is not supposed to work in some
circumstances is simply hidden. Actually, the click_all test sets that
filter and leads to  a crash.

With this commit, for a more realistic use case, the click_all test does
not activate hidden filters.

closes odoo/odoo#36433

Signed-off-by: Christophe Monniez (moc) <moc@odoo.com>
2019-09-04 13:33:15 +00:00
wan 737eaf9333 [IMP] account: add searchpanel on account.account and account.move.line
Task 2008956

* Add the root of an account (first 2 digits/char) as a searchable model.
* Create a custom searchpanel for this account root on account.move.line
* Add the account_root searchpanel to the account.account view too.
2019-09-04 09:00:03 +00:00
Julien Mougenot eea560060a [FIX] web: list width should not be calculated when invisible
Before this commit, the width of the headers in a list were frozen
only when the list was seen, but the calculation of the width might have
happened while it was invisible (thus giving the headers 0px).

Now, the freeze AND the calculation only occur when the list is visible
and can actually be evaluated.

Task 2061848

closes odoo/odoo#36175

Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2019-09-04 08:19:32 +00:00
Julien Mougenot 52bd5fa461 [FIX] web: list view: allow buttons width
Before this commit, when entering an empty editable list with buttons,
their width would be set to 0px.

Now, they are considered as fields and given a name, allowing the renderer
to give them their proper width (if any) or a default one.
2019-09-04 07:11:01 +00:00
Julien Mougenot 7329014796 [FIX] web: editable list: ignore empty headers
Before this commit :
- resize handles were all attached at the right side of the list
- empty columns were given a resize handle, causing them to be larger than expected

Now :
- resize handles are attached to their corresponding header
- only non-empty columns are given a resize handle

Fix 2060807
2019-09-04 07:11:01 +00:00
Julien Mougenot 5718861b91 [FIX] web: editable list: invisible list width computed on interraction
Before this commit, if an x2many was in an inactive tab of the notebook,
its column headers widths were all set to 0px

Now, inactive x2many lists do not compute their width until they are visible
and interracted with (e.g. add/delete a record, sort columns, etc.)

Fix 2060418
2019-09-04 07:11:01 +00:00
Christophe Simonis 51354fadb0 [MERGE] forward port branch saas-12.3 up to 50e571acf7
closes odoo/odoo#36491

Signed-off-by: Christophe Simonis <chs@odoo.com>
2019-09-11 09:39:33 +00:00
Christophe Simonis 7895044a79 [FIX] web: unpatch test Views earlier
We need to unpatch the view as soon as we correcly applied the
`groupedBy` attribute to avoid sub views to also be patched.

closes odoo/odoo#36486

Signed-off-by: Christophe Simonis <chs@odoo.com>
2019-09-05 13:43:51 +00:00
Christophe Simonis 41f7befb8e [FIX] web: correctly await promises in forward-ported test 2019-09-05 13:41:59 +00:00
Christophe Simonis 02a8490f05 [FIX] web: use defined variable
Oversight of previous forward-port.
2019-09-04 20:14:15 +02:00
Christophe Simonis 7a548569c6 [MERGE] forward port branch 12.0 up to 638eac9bae 2019-09-04 19:32:26 +02:00
Aaron Bohy 0b146aa253 [FIX] web: form: race condition when editing in readonly
... and switching to 'edit' mode before the write RPC returns.

For instance, on a project task form view, in readonly, change the
state by clicking on the bullet, and directly switch to 'edit'
mode: when the RPC returns, the view is switched back in readonly.

Task 2065443

closes odoo/odoo#36400

Signed-off-by: VincentSchippefilt <VincentSchippefilt@users.noreply.github.com>
2019-09-04 07:15:18 +00:00
Lucas Perais (lpe) b7e3469931 [FIX] web: grouped list as grouped list as child
In grouped editable list, get rid of the groups
Edit one record in the editable list
In a M2O, click on search more

In search's list, group by a field
Expand a group in the search's list

Before this commit, it crashes because the event was propagated
onto the first main list

After this commit, it doesn't crash and the group is expanded

OPW 2064156

closes odoo/odoo#36383

Signed-off-by: Lucas Perais (lpe) <lpe@odoo.com>
2019-09-03 14:24:58 +00:00
Aaron Bohy ae50f2cbbb [FIX] web: editable list: edit group with create=0
This rev. disables the 'create' action in the form view reached
when clicking on the 'Edit' button on a group in an grouped list.

closes odoo/odoo#36384

Signed-off-by: VincentSchippefilt <VincentSchippefilt@users.noreply.github.com>
2019-09-03 13:37:47 +00:00
Christophe Simonis 545e6d2034 [MERGE] forward port branch 12.0 up to 52f6e38cea 2019-08-30 17:20:28 +02:00
Christophe Simonis 8bd6a93c74 [MERGE] forward port branch saas-11.3 up to ede253f1b2 2019-08-29 16:45:15 +02:00
Christophe Simonis ede253f1b2 [MERGE] forward port branch 11.0 up to d61873ac4a 2019-08-29 15:22:51 +02:00
Juhil Somaiya d1ee54450a [FIX] web: dashboard_graph disappearing issue on kanban record reload
When we try to change the color of kanban, the kanban record is re-renders,
kanban record is replaced with kanban-box and subWidgets are re-rendered,
reset of all subWidgets are called which will re-render widget but it is not
rendered in DOM as DOM element is destroyed and hence  dashboard_graph widget
can not computed proper height of the canvas element and disappear

Call on_attach_callback after widget reset is called on kanban record, as widget
element is removed from DOM and new element is added in DOM so
on_attach_callback should be called again.

task-2036256

closes odoo/odoo#35254

Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2019-08-28 12:04:59 +00:00
Harpritsinh SisodiyaandAaron Bohy fbbfa6ddca [FIX] web: datepicker: crash on invalid date
There is an open issue on the tempusdominus lib:
https://github.com/tempusdominus/bootstrap-4/issues/223

It occurs when there is a valid value in a date(time) field, and
the user unsets it by setting an invalid one.

This rev. fixes the issue in Odoo by preventing to reach the buggy
piece of code in the lib. In a few words, when the user sets an
invalid date, we reset the previous valid date (which is what the
lib tries to do anyway).

Task 2057009

closes odoo/odoo#36211

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


Co-authored-by: Aaron Bohy <aab@odoo.com>
2019-09-03 12:14:05 +00:00
Alexandre Kühn 7bdcef9c1c [FIX] web: add support for localStorage.key() and .length
These operations on local storage are necessary in order to
loop on all local storage keys.

Closes #36177
2019-09-02 21:37:13 +00:00
Alexandre Kühn 15f6170bed [FIX] bus: background slave tabs should not loose notifications
Before this commit, some notifications may be lost while forwarding
them between browser tabs by means of the local storage (i.e. from
the master tab to slave tabs).

This happened when some slave tabs are in the background and are
throttled by the browser: the master tab writes twice in the local
storage (to notify slave tabs of new notifications), and slave tabs
drops the 1st notification. This is caused by the mismatch between
the new value in the local storage event and the actual value in the
local storage. For example:

```
  t(0) - Master tab receives `message` notification;
  t(1) - Master tab writes notifications (= `message`) in local
         storage;
  t(2) - Master tab receives `message_seen` notification;
  t(3) - Master tab writes notifications (= `message_seen`) in
         local storage;
  t(4) - Slave tab detects new notifications (= `message`)
         from local storage event, but drops it since it does not
         match actual local storage value (= `message_seen`);
  t(5) - Slave tab detects new notifications (= `message_seen`)
         from local storage event, and handles it since it
         matches actual local storage value (= `message_seen`);
  => Notifications received + handled:
        - master tab: `message`, `message_seen`
        - slave tab:  `message_seen`
  => Slave tab lost "message" notification.
```

This commit fixes the issue by letting all tabs handle any local
storage events, regardless of the actual value in the local storage.
In the example above, this means the slave tab will not drop the
notification `message` at t(4).

Task-ID 2044231

Closes #36177
2019-09-02 21:27:13 +00:00
Aaron Bohy 906480093a [FIX] web: 'create' in context and non inline subviews
Let's assume an action with 'create': 0 in the context, and a non
inline subview in the form view. Before this rev., the 'create': 0
was applied to both the form view and the subview.

This rev. applies the same logic as what the server does for inline
subviews: the rule is applied to the subview iff its model is the
same as the one of the form view (with key 'base_model_name' set
in the context).

Task 2035653

closes odoo/odoo#36109

Signed-off-by: Géry Debongnie (ged) <ged@openerp.com>
2019-08-27 10:21:00 +00:00
Lucas Perais (lpe) 90ab752c5f [FIX] base, web, website: force phone number in ltr
Display your website in Right To Left
Go see the phone number of the company
Make that number in the form
```
123[space]456[space]789
```

Before this commit, the blocks of that number were inverted
(intra-group order did not change)
Leaving us with
```
789[space]456[space]123
```

After this commit, we introduce a little class to force Left To Right
display

OPW 2059917

closes odoo/odoo#36115

Signed-off-by: Lucas Perais (lpe) <lpe@odoo.com>
2019-08-27 10:02:27 +00:00
Lucas Perais (lpe) d310cd4478 [FIX] web: selection: required, option present but disabled
Before this commit, a field selection which was required
did not have an empty option
ref: 4dfabb8f7a

This is fine, but overlooked the fact that modules can modify
the required attribute, or even views can do it
So, we may end up in a situation where the field is required but set to false
This configuration is problematic, at least for the timezone selection field
(see OPW)

After this commit, the empty option is just not visible
note that `disabled = True` would not work because val is not accessible

Because of commits:
- 4dfabb8f7a for the selection feature
- d77ce4c2a9 overriding the required attribute of tz in res.user form

OPW 2057913

closes odoo/odoo#35989

Signed-off-by: Lucas Perais (lpe) <lpe@odoo.com>
2019-08-23 14:29:05 +00:00
Aaron Bohy 6602e1cf2d [FIX] web: grouped list with <groupby> node and onchange
Let's assume an editable grouped list view with a <groupby>
node containing subfields, and an onchange. Edit a row to trigger
the onchange. Before this rev., it crashed because the onchange
specs was incorrect: it followed the relation of the many2one
and thus included its subfields (whereas it should only follow the
relation for x2many fields).

For example, go to Accounting > Accounting > Sales and edit the
label of a move line.

Task 2044187

closes odoo/odoo#36001

Signed-off-by: Géry Debongnie (ged) <ged@openerp.com>
2019-08-23 11:08:27 +00:00