Commit Graph
9664 Commits
Author SHA1 Message Date
Thibault Delavallée 6663ff97b6 [IMP] web: add an option to hide archive option in kanban columns
Currently kanban columns propose an Archive / Unarchive option if the
records model has an active field. It allows to directly archive or
restore all records belonging to that column. It is currently not possible
to control whether this option is present or not as it only depends on the
active field being defined on the model.

In some specific cases we want to be able to hide this option even if the
active field exists. For example future commits will hide this option for
leads (crm.lead) as business flow goes through marking them as won or lost
instead of archiving / restoring them.

This commit adds support of a new archivable parameter when defining the
kanban view that hides the archive buttons if it is set to False. Default
value is true so that current behavior is kept as it is by default.

Doc and tests are added.

This commit is linked to task ID 1880051 and PR #26977.
2018-09-21 11:22:01 +02:00
Prakash Prajapati 450efe6b75 [FIX] web: add a minimal width on dropdown box to avoid labels being squeezed
Purpose is to add a width on dropdown 'box' in order to have long labels
like 'Set cover image' being squeezed against the border.

This commit is related to task ID 1884053 and closes PR #26936.
2018-09-21 11:10:20 +02:00
Alexandre Kühn 85820a25d7 [FIX] web: light gray background for search facet
The change of navbar color from blue to purple in community,
also changed the the background color of the search facets were light purple
before this commit.

This commit fixes the background color of search facet to light gray,
which should look almost the same as before the change above.
2018-09-20 17:19:02 +02:00
Alexandre Kühn 2668d695db [IMP] web: purple odoo brand color in community
Task-ID 1878649
2018-09-20 17:19:02 +02:00
Alexandre Kühn 12fd72a621 [IMP] web: increase form sheet max-width in community
Task-ID 1878649
2018-09-20 17:19:02 +02:00
Alexandre Kühn 5af3bcda6d [IMP] web: reduce form sheet padding in community
Task-ID 1878649
2018-09-20 17:19:02 +02:00
Alexandre Kühn 6bfb6ca1c0 [IMP] web: no dropdown icon ('v') next to app menu icon
Task-ID 1878649
2018-09-20 17:19:02 +02:00
Adrien Dieudonne b23a981320 [IMP] web: graph view: design improvements
This commit improves UI of charts:

- Reduce margins of svg
- Put ticks label on right of y axis
- Bigger lines (line chart only)
- ligther area color (line chart only)
- Hide y axis line
- Force charts to begin at y=0
- Hide zero tick on y axes

There is no test because these changes only concerns visual effects.

Task ID: 1877588
2018-09-20 15:20:03 +02:00
Adrien Dieudonne 067754f0f6 [REF] web: Use graph renderer to render pie_chart widget
Before this rev., the pie_chart widget was rendered from scratch
with nv.d3 and we had duplicated code.
In comparison mode, two widgets were instancied and it was a bit
difficult to synchronize the size of these svg graphs.

nv.d3 graphs are attached when the dom is ready because it needs
to calculate the available space. UI bugs can appear if the dom
changes... .update() must be executed on the graph to avoid this
as we already do in graph renderer.

So now, the rendering of the pie_chart widget is done by the
graph renderer.
As comparaison mode is supported by the rendering, only one
widget needs to be instancied.

Task ID: 1835644
2018-09-20 13:30:50 +02:00
Vincent Schippefilt a0ce697b05 [FIX] web: add mouseenter when triggering a dra&drop in tests 2018-09-20 11:10:34 +02:00
Vincent Schippefilt 3092432daa [IMP] web: add a fix on underscore to support cancellableThrottle 2018-09-20 11:10:33 +02:00
Sébastien Theys 4decbcc55c [IMP] account,sale,web: use classes for section and note
Instead of using custom CSS.

PR: #26801
task-1876864
2018-09-19 12:00:37 +02:00
Alexandre Kühn 95331042f1 [FIX] web: do not re-render app menu on every app click
This was necessary because the rendering was always determining
which app item should have the class 'active'.

This was an issue with the 'Click Everywhere Test': at the beginning
of the script, it gets the jQuery element that matches all nodes
`a.o_app` in the app menu. When an app item is clicked, it re-renders
the whole app menu, so that older referenced nodes are detached from
the DOM. As a result, clicking on them no longer works, because it
never triggers the MouseEvent `click .o_app`.

This commit fixes the issue by rendering the whole app menu once.
When an item in the app menu is clicked, it dynamically changes
the `active` app.
2018-09-18 18:12:03 +02:00
Christophe Monniez 98ced5ca88 [FIX] web: fix selector for the menu items in clickEverywhere test
Also clarify a variable name referencing a node instead of a jquery
object.
2018-09-18 16:44:38 +02:00
Christophe Simonis 94aaa2f5b0 [FIX] web: tests: refine selector on values only. 2018-09-18 12:02:12 +02:00
Christophe Simonis a12c4d284c [MERGE] forward port branch saas-11.4 up to a1b384d66b 2018-09-18 11:42:52 +02:00
Christophe Simonis a1b384d66b [MERGE] forward port branch saas-11.3 up to 2de573440e 2018-09-17 19:40:47 +02:00
Christophe Simonis 0942a57b5a [MERGE] forward port branch 11.0 up to f2b8caff07 2018-09-17 18:03:41 +02:00
Alexandre Kühn 19eacf7d23 [IMP] web: new navbar in community
The navbar in community now looks more like the navbar in enterprise.

Here is a sum-up of the changes in community:

- The navbar in community is now in blue, instead of black.
- No more app list that almost fills the whole navbar: there is
  now an "Apps Menu" in the left-most side of the navbar.
- No more sidebar for the menus inside an app: those menus are
  now located in the middle part of the navbar.

The navbar in community does not support mobile (< 768px width),
but it should still somewhat usable on most mobile devices.
As for the website navbar, it has been unchanged and should still
support mobile layout.

Task-ID 1878649
2018-09-17 16:46:53 +02:00
Aaron Bohy c63630d416 [FIX] web: datepicker: correctly use lib
The datepicker lib has been updated to tempus dominus (BS4)
recently, but our code hasn't been adapted correctly to the
requirements of the new version of the lib. As a consequence,
the datepicker didn't close itself when the input was focused
out anymore.

This required a slight change in the DomainSelector widget as it
produced a crash when a focused datepicker widget is removed from
the DOM (before the datepicker is destroyed), e.g. by a call to
html() on one of its parent.

Task 1878254
2018-09-17 15:23:33 +02:00
Alexandre Kühn a6516c3533 [FIX] web, website: root.widget defined even without website
Revision on https://github.com/odoo/odoo/commit/0de5c1f076d7e7d0e5361e08c810c727bd41d9e0

With the commit above, the following error was shown in the devtools
when accessing a frontend page without website that is installed:

  missing module "[root.widget]"

This is caused by the fact that there is no root widget in the frontend
bundle without website installed. This may prevent executing tours
in some cases, because the tour manager needs a root widget to run.

This commit solves this issue by ensuring a root widget in the frontend
even when website is not installed, so that tour manager can run.
2018-09-17 15:22:30 +02:00
Aaron Bohy 8993d6ff79 [FIX] web: x2Many: remove deadlock situation
This rev. is similar to db9b91ff, but treats the x2many case.
Calls to the 'commitChange' function of renderers must not be done
inside a mutex, mainly since 241704536, as they could end up in a
deadlock. For x2manys, it was actually the case in practice in
Inventory > Operations > Inventory Adjustments > Create > select
'One product only' > select a product > try to edit the real
quantity in the editable list > focusout > deadlock.

The reason why the deadlock occurred in this view and not in, e.g.
sale.order, is due to the presence of the field_float_scannable
widget. Indeed, the barcode engine intercepts input events and
manually re-triggers them. As a consequence, the 'change' event is
not triggered on the field, and it does not notify the environment
of its new value by itself, until the field x2many asks it to
commit its value. Note that this might be an issue as well, as
onchanges are thus not triggered.

Task 1878254
2018-09-17 13:32:37 +02:00
Aaron Bohy 4393e48fec [FIX] web: navigate in editable list with custom controls
Rev. f241441 recently added the possibiliy to define custom
controls (instead of the single  'Add a line') in editable list
views. However, it didn't take into account keyboard navigation.

Suppose that the focus is on the field preceeding the list, and
the user clicks on TAB, the code assumed that there was only one
control, and focused it. However, when there were several control,
the last one was focused (which is typically the less common one),
and there was no way to navigate to the others.

This rev. focuses the first control by default, and allows to
navigate through controls with RIGHT and LEFT. Pressing TAB still
moves out of the list, to the next field.

Note that i'm not happy with this fix, as the logic doesn't seem
to be in the right place. Indeed, the notion of controls is the
concern of the editable list, not the x2many field, so the list
should handle this logic by itself. Unfortenately, this is not that
easy to change, as for now the list doesn't even know that we are
navigating to/from its control(s), until we click on it/them.
Changing that will be for later, in master.

We also did a linting pass on the concerned code.

Task 1878254
2018-09-17 13:32:37 +02:00
Xavier Morel 8e17223c26 [FIX] web: remove bootstrap sourceMappingURL
We're not shipping the sourcemap files, and while the assets minifier
strips out the mappings they're getting hit in debug=assets which is
bot useless and problematic when running odoo-bin without a proxy for
static folders: if sourcemaps are enabled (which is apparently the
default in all browsers if devtools are opened at this point) the
browser tries to fetch the sourcemap, which does through the
SharedDataMiddleware which doesn't find them and passes the query on
to the regular Application which goes through the entire dispatch &
NotFound process.

If website is installed, that process ends up rendering website.404,
which can be pretty costly until everything is properly cached:

    # initial request
    "GET /web/static/lib/bootstrap/js/index.js.map HTTP/1.1" 404 - 319 0.198 0.954
    # a few requests later
    "GET /web/static/lib/bootstrap/js/index.js.map HTTP/1.1" 404 - 27 0.022 0.060

And the way sourcemaps are fetched (might be headers, might be the
stampede as browsers will try to fetch a dozen sourcemaps as fast as
possible) seems to make this problem much, much worse: instead of 300+
the requests take 800+ queries each, multiple seconds, and requests
get worse as time goes on (didn't investigate the exact reason for
that) *and* they apparently don't ever get cached (at least they don't
after half a dozen reloads of the client).
2018-09-17 10:44:58 +02:00
Olivier Colson 1656dc5a01 [IMP] web: list controller: put the buttons template name to render in a field of the ListController, so that it can be overridden
This will be used to add the 'Upload' button on the tree view of vendor bills, by extending the regular view.

Was part of PR #26740
Was part of task #1880089
2018-09-14 17:29:49 +02:00
Alexandre Kühn 355054aaa8 [FIX] web:tests: correctly handle parameter 'services'
This commit fixes the handling of the service parameter
in a mocked environment:

- updated docstring: now an object (previously an array)
- no longer used by mocked server (unused parameter)
- enforces default value for this parameter (empty object)
2018-09-14 17:14:33 +02:00
Alexandre Kühn 45d197c208 [FIX] web: tests: adapt JS tests from forward-port 9c77066f34
The test was failing because it was using an old approach to mock
services in JS tests. Also, it provides ajax service in the list
of services, which was not supported in a mocked environment.

With this commit, when an ajax service is provided in the test,
it will use this service instead of using mocked RPCs from the
mocked server.
2018-09-14 17:14:33 +02:00
Alexandre Kühn 9393a0eba8 [FIX] web: missing 'target' parameter in _rpc method
This parameter was omitted in a forward-port to saas-11.5.
Maybe this is due to a missing `git move` from this commit:
https://github.com/odoo/odoo/commit/02ec09cb1c3e2d7bc7968f40c18f2208d7f3f498
2018-09-14 16:51:01 +02:00
Martin Trigaux 14a9b988f4 [FIX] web: graph_renderer: check graph data before rendering
cherry pick of 634de21b76
Before this commit, we had two different errors when data was
unavailable:
The first one is generated by Odoo: "No data to display, try to[...]"
The second one is generated by nvd3: "No Data Available".

We always want the same message.
So now, we always make some checks before rendering
the graph by calling _render.

opw-1874349
2018-09-14 16:15:43 +02:00
MOENS Alexandre b83db27135 [FIX] web: JournalDashboardGraph widget crash Mk.II
Hardening of commit:995610c065bf0242cb5023cfad2940234395739e

The JournalDashboardGraph requires nv, which is lazyloaded.
However it requires nvd3.js which is loaded after nv.d3.js.
A function called in destroy is defined by nv.d3.js,
which can make the crashhappen with the right (wrong) timing.

opw 1873749
2018-09-14 16:13:35 +02:00
Christophe Simonis 9c77066f34 [MERGE] forward port branch saas-11.4 up to 6c103589c1 2018-09-14 16:00:17 +02:00
len-odoo 8179960172 [FIX] web: lock handle when sorting on a different field
The resequence mechanism works if the sequence is sorted by its handle field.
Therefore sorting on another field should lock the handle, while sorting on the
handle field should unlock the handle.

opw 1867049
2018-09-14 14:00:52 +02:00
XavierDo 71663b7f57 [IMP] web: log user_error as info instead of error
Since a console.error will mark a tests as failed, logging user error
as info will allow to test a flow with user error without
marking the runbot red
2018-09-14 13:56:32 +02:00
Christophe Simonis f3fa5a5ef7 [MERGE] forward port branch saas-11.3 up to 1e0a92c996 2018-09-13 19:30:33 +02:00
Sébastien Theys a670f092b9 [IMP] website: improve Optimize SEO and Page Manager
Modal generic:
- Fix footer overflowing buttons by pushing them to a new line.

Page manager:
- Add an SEO column to easily see which pages have incomplete SEO.
- Add an edit SEO column to navigate to the SEO modal on said page.
- Hide "edit in backend" column as debug.
- Generally improve the whole view by adding appropriate titles on icons, etc.

SEO modal:
- Improve general style.
- Add description length alert.
- Restructure the keyword table/suggestions.
- Reset page meta to their initial value on Discard.
- Various small usability improvements.

PR: #26897
task-1850579
2018-09-13 18:18:02 +02:00
Hiral Bhavsar 5373db1487 [FIX] mail, web: open systray menu dropdown in mobile.
Before this commit, it was not possible to open systray menus in mobile.
This is due to popper.js that is wrongly dynamically positioning the
dropdown menu.

This commit fixes the issue by disabling dynamic positioning by popper.js
for the systray menus, so that it uses ou custom styles for dropdown menu.

Closes #26434
2018-09-13 17:49:52 +02:00
Hiral Bhavsar 3ee4390bff [FIX] web: correct mobile screen size.
Revision on https://github.com/odoo/odoo/commit/d91ec258e6a31153beb9eb16cfe8f916546b7688

The commit above reverts a commit when we were using bootstrap 3.
The equivalent of XS in bootstrap 3 is SM in bootstrap 4.
So the correct revert with bootstrap 4 is to use SM.

Also removing useless style on 'o_mobile_menu_opened'.

Closes #26434
2018-09-13 17:49:36 +02:00
Nicolas Lempereur 4ec9b55a79 [FIX] web: background layout landscape no +1 page
The report layout "background" has an image background from bottom to
top. When we transform the report in PDF, we have no idea in the
document of how many page, which orientation, width or height it will
take.

Thus to be able to have the background at the bottom of a page when
there is not enough content, we set a min-height for the body content.
This height was 1000px originally and has been decreased to 900px in
41c75ad0c3 because an empty page was possibly added (since the height of
body + header + footer was bigger than page size).

This issue is about getting a blank page when pdf is in landscape.
For example in A4 with 90ppi has a 1052px height in portrait, but 744px
height in landscape so we always get at least two pages with possibly a
blank one.

With this commit we lower it to 620px allowing 124px headers/footers.

opw-1881059
closes #26962
2018-09-13 12:44:53 +02:00
ThanhDodeurOdoo d12b883155 [IMP] mail, web: attachments & messages in debug actions.
- added two new actions to the form view debug action list,
  both opens list (+ form) views of messages and attachments respectively
  for which the domain is restricted to the current record.

task: 1860031
2018-09-13 11:50:26 +02:00
Géry Debongnie cd62900878 [IMP] web: add fail fast feature to qunit test suite
With this commit, we introduce a new 'fail fast' feature to our qunit
test suite: when it is activated, the qunit test suite will immediately
stop after the first failed test.

It is accessible as a flag in the url (failfast), or by clicking the
checkbox in the UI. It is currently not activated by default.

Note that this commit also change the url for the runbot phantomjs test
in order to activate this feature.  This allows us to increase the global
timeout for the js test suite without fear!

Backport of 611c836a46
2018-09-13 08:56:08 +02:00
Christophe Simonis b1999a0e87 [MERGE] forward port branch 11.0 up to db0e84f3e3 2018-09-12 19:37:17 +02:00
Nicolas Lempereur db0e84f3e3 [FIX] web: revert ignore default_* on group creation
This reverts commit 4cb585ab4f.

When creating from the kanban view:
- crm.stage
- hr.recruitment.stage
- project.task.type
- helpdesk.type
- mrp.eco.stage

We go from a dashboard of eg. "GroupRecord" named "group_id" in the
record. And when a stage is created, "default_group_id" is used. With
the change the stage was not linked to the current "grouping".

We could probably use "search_default_group_id" instead but the behavior
may be present in existing customization.

opw-1884217
closes #26943
2018-09-12 17:43:39 +02:00
Aaron Bohy 18bd4fa749 [FIX] web: remove race condition at webclient startup
Before this rev., there was a race condition making some tours
randomly fail on runbot, when the following steps occurred in that
order:
  - load webclient
  - as soon as the menu is ready and visible, click on a root menu
    which thus leads to a doAction
  - in the meantime, an RPC is done by the webclient to retrieve
    the (optional) default action of the user (if there is no
    state in the url, which is the case for tours in general)
  - when that RPC returns, this action (if any), or the action of
    the first menu is executed, thus leading to a second doAction
  - the ActionManager using a DropPrevious, the first doAction is
    dropped and thus the action linked to the clicked menu is
    never shown, making the tour fail

This rev. uses the state of the ActionManager's DropPrevious to
prevent the default action from being executed if another action
is already being executed, thus removing that race condition.

Note that this fix is temporary, as the community webclient is
currently being refactored.
2018-09-12 13:30:24 +02:00
svs-odoo f339ed6ff6 [FIX] web: avoid annoying xdg-open prompt
Due to the route beginning with 'test: ', it was interpreted like a
protocol and on some OS (ubuntu for example), a xdg-open prompt pops up.
So, the window looses focus and some tests will fail because of that.
2018-09-12 13:17:54 +02:00
Nicolas Martinelli d3d3455e17 [FIX] web: lock handle when sorting on a different field
This makes runbot Enterprise fail. Reverts until a proper solution is
found.

This reverts commit f4f1480a3e.
2018-09-11 21:48:03 +02:00
Aaron Bohy a131373fac [FIX] web: wait for onchanges before saving
Rev. db9b91ff removes a use of a mutex where it could end up in a
deadlock situation (and where the use of the mutex wasn't
necessary). However, it caused an issue as the following scenario
didn't work anymore:
  - in a form view with a one2many with fields A and B (required),
    with an onchange on A setting B,
  - add a row and set a value for A,
  - click on 'Save' directly (before the onchange RPC returns)
  - whereas it should wait for the onchange to return before
    trying to save, it tries to save directly but faces an unset
    required field, and displays a warning to the user.

The reason is that, before saving, the FormController asks all its
widgets to commit their value (through a call to commitChange).
This call was, prior to db9b91ff, done in the mutex. The onchange
RPC being itself done in that mutex, we thus waited for the
onchange to return before calling commitChanges. After db9b91ff,
since there was no longer a mutex, commitChanges was called
directly, and the editable list returned a warning as one of its
required field was unset.

This commit ensures that commitChanges is called once all onchange
RPCs are done, by waiting the mutex to be idle.
2018-09-11 21:05:23 +02:00
Aaron Bohy 0ff2087fb9 [FIX] web: FieldMany2ManyTags: fix broken colorpicker
Before this rev., if the user clicked on a tag to open the color
picker, and then clicked in the dropdown, but not on a color, the
color picker closed itself, and it was no longer possible to open
it again.

This issue came with the migration to BS4 and its following fixes.
As the color picker is now a classical BS dropdown, it closes
itself automatically, so we don't need to manually close it on
focusout.

Task 1878254.
2018-09-11 21:05:23 +02:00
Christophe Monniez 88e935fa01 [FIX] web: remove display none timeout
Since 6dc37ee461 a d-none class was added to hide the menus in the
navbar during the start of the navbar. A timeout was set to mimic the
old behavior and let enought time to bind events on menus.

When the project app was installed alongside with all other apps on the
runbot, there was not enough place in the navbar. This resulted in a
race condition at the begining of the project tour.

With this commit, the d-none class is immediately removed and then the
menu are started (binded to events) before the tour has the hand to
continue its next step.
2018-09-11 20:19:17 +02:00
Hiral Bhavsar 3bb99ff80e [FIX] web: BS4, use a fixed width for datetimepicker
When switching from calendar to hours, the 'auto' width changes and this
is not what was desired.
2018-09-11 15:17:23 +02:00
David Monjoie 955e2bad52 [FIX] web: fix wrong padding css rule
The css rule I introduced in 737ba55 was poorly written, my bad.
2018-09-11 15:02:55 +02:00