Commit Graph
7131 Commits
Author SHA1 Message Date
Christophe Simonis 523d3af131 [MERGE] forward port branch saas-12 up to 16d65a8 2016-07-29 17:55:21 +02:00
Christophe Simonis f670b3b1df [MERGE] forward port branch saas-11 up to 3aea814 2016-07-29 15:33:51 +02:00
Simon Lejeune 3aea814e3c [FIX] web: inputs of an editable list inside a modal are broken
This is triggered by the interaction of the `-webkit-overflow-scrolling` [1]
rule that is set on the top of the modal (div.modal) and the fact that inputs
elements are displayed over the table with an absolute positioning (that's
how the editable lists work).

Indeed, the `-webkit-overflow-scrolling` rule creates a new stacking context [2]
and is inherited by all the children of the modal (and so on), resulting in this
situation:

                                                       .modal
                                                 /             \
                                         ... (new S.T.)    ... (new S.T.)
                                           /                      \
                                  ... (new S.T.)              ... (new S.T.)
                                 /
                       .o_list_editable (new S.T.)
                      /                            \
           .o_form_view (new S.T.)         .table-responsive (new S.T.)
      /            |           \                           \
input            input           input                      table (new S.T.)

This explain why the input are not visible: actually, they are displayed
behind the table. In this case the  document order is used to know which
div should be in front of another div[3], that's what rev odoo/enterprise@304b790004 [4]
tried to change. However, this was not enough for iOS 9.3 / iphone 6
because, for some unknown reason (but probably due to the fixed position
of the modal that seems kind of broken on safari mobile), the inputs where
still displayed under. Note that the fix was ok for ios 9.3 / ipad air 2.

The fact that `-webkit-overflow-scrolling` creates a new stacking context
at every node seems odd, unfortunately removing the rule result in a non
scrolling div at all.

The fix is to explicitely tell the input to appear over the .table-responsive.
This is done by sharing the same stacking context under the common parent
between the form and the list view: .o_list_editable. For that, we prevent
the creation of a new stacking context under .o_form_view by reseting the
`-webkit-overflow-scrolling` to "auto" and we set a dummy z-index to the
inputs element. As they are the only one to have a z-index in this dom
range, they will always appear on top of the table.

With this solution, the `-webkit-overflow-scrolling` is still inherited
correctly and the div is still scrollbale.

This fix unveils another issue with the editable list: if the screen is
too small resulting in an horizontal scrollbar, the table in itself is
scrollable but the inputs aren't.

opw 683169

cherry-pick of odoo/enterprise@35f285e50a

[1] this rule allow a smooth scrolling of the content of a div on iOS
https://developer.mozilla.org/en-US/docs/Web/CSS/-webkit-overflow-scrolling
[2] https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_Positioning/Understanding_z_index/The_stacking_context
[3] https://www.w3.org/TR/CSS2/zindex.html
[4] This commit has been reverted with odoo/enterpise@287cff02c7
and never forward-ported to saas-10.
2016-07-29 14:44:26 +02:00
Christophe Simonis cfb0c0dead [MERGE] forward port branch saas-11 up to 7ae5121 2016-07-25 17:17:15 +02:00
qsm-odoo 5bbe952d30 [IMP] web: simplify deferred chain for form view leaving 2016-07-20 16:08:49 +02:00
Aaron Bohy 1da9f1dc10 [IMP] web: logout client action: prevent toggling app switcher
When the webclient calls do_action from the app_switcher, it toggles it when
the returned deferred is resolved.

The logout client action didn't return anything, so when logging out from the
app switcher, the webclient directly toggled the app_switcher and displayed
the last opened action if any, and a gray screen otherwise.

This commit makes the client action return a deferred which is never resolved,
so the app_switcher isn't toggled when logging out.
2016-07-20 16:06:32 +02:00
Simon Lejeune d1cd293ece [FIX] web: session_info: introduce is_superuser key
This is done in order to enable the tour service only for the
superuser. Commit 6ef1644a7b changed the meaning of `is_admin`
to achieve this but broke the fact that some features of the debug
manager are available to admin and not only to the superuser. Anyway
a `is_admin` key should mean that the user is in the admin group.

We could have checked client side that the uid is equal to 1 but
adding a `is_superuser` key is more elegant and easier to grep.
Also fix the only occurence of a uid check in the weblcient.

This reverts commit 6ef1644a7b.
2016-07-20 14:16:01 +02:00
Thibault Delavallée bcbf4316e6 [FIX] models, mail, *: fix access action crash due to one / multi conversion
get_formview_action and get_formview_id are methods used notably in a
redirection called from a mail controller used in notification emails.
Those methods however are defined as cr, uid, id and are interpreted
as api.one when called by a new-api style method.

With modules being converted into the new API, those methods are called
as api.one and the result is encapsulated into a list.

To avoid having to take the first element of the returned list we decided
to simplify the call chain and migrate the methods as multi methods, using
ids instead of id. Various addons have been updated accordingly. A temporary
support of ids being an int / long has been added to avoid conflict with calls
using id (for example if javascript is not updated).
2016-07-19 16:32:46 +02:00
Christophe Simonis 5858dda75f [MERGE] forward port branch saas-11 up to a62b8cf 2016-07-15 16:34:41 +02:00
Olivier Dony f5eba9e4d8 [FIX] web: repair grouping on date fields in list view
This is a temporary workaround, which probably deserves
further thinking by @ged-odo, as the root cause
stems from commit 96bf5b2656

The problem is that the list view looked for composite group_by
keys such as "create_date:month" within `fields_get`, which
only contains true fields.
2016-07-14 18:48:08 +02:00
Denis Ledoux 18dc5b3b87 [FIX] web: default many2many tags color
When there is no `color` field on the model
e.g. On invoice line taxes
The color class to apply on the badge was set to
`o_tag_color_undefined`
which doesn't exist. It must be set
from `o_tag_color_0` to `o_tag_color_10`
in order have a color.

Because of this, the taxes in the invoices lines
were not visible, because they were written in white
on a white background.

This has been broken by the below revision:
fe66472e2c
removing the or statement (`||`) to set a default
color for models not having a `color` field.

We choose to set `10` as default value, so the color
remains the same compared to the previous release
(light grey). However, if the new behavior chosen
by the usability is to have these in black, it should then
be changed to `0` again.
2016-07-14 18:38:29 +02:00
Christophe Simonis 1fca5e01cb [MERGE] forward port branch saas-10 up to 156dee2 2016-07-14 18:17:30 +02:00
Christophe Simonis 156dee2aec [MERGE] forward port branch 9.0 up to fd9eb2e 2016-07-14 17:17:54 +02:00
qsm-odoo 9b77d76e71 [FIX] web,website,point_of_sale: session.debug value
Now that the debug URL parameter can be equal to "assets", the session
debug variable has to be updated to not only be true or false. Now, its
value is false if the debug parameter is not specified in the url and
a the URL parameter string value otherwise (or 1 if the value is an
empty string).

Also modify all redirection which kept the debug mode to also keep
=assets. Use the $.param.querystring function.
2016-07-13 16:13:04 +02:00
Aaron Bohy ee4c808d2c [FIX] web: debug_manager: update when coming back with breadcrumbs
Before this rev., the debug manager's state was only updated when pushing a new
action but not when coming back to a previous action using the breadcrumbs.
So when the latter case happened, the debug manager was desynchronized with the
action manager and it allowed to edit an action that wasn't the current action.
2016-07-12 15:30:01 +02:00
Fabien Pinckaers 3888301a2e [IMP] web: Quantity is very misleading in reporting views --> e.g. SO Line Quantity is perceived as Quantity of products, whereas it's the count of SO Lines. Renaming to Count 2016-07-07 12:28:57 +02:00
Simon Lejeune cb30d0ef0e [FIX] web: qweb: correctly set preprocess_node on qweb engine
issue: xml template are not translated anymore

rev d56b35e2 moved qweb code inside the `qweb.js` file and also changed
the behavior with the introduction of a `QWeb` factory returning instances
of qweb rendering engine. However, we have to set on the rendering engine
instance a `preprocess_node` function that will translate the qweb
templates.

The solution for this issue (also introduced with rev d56b35e2) was
to set this function on the prototype of the QWeb factory, and it was
obviously not enough as it has to be attached to the rendering engine
instance.

In order to benefit from the fact that the `preprocess_node` function
is attached to the prototype of the QWeb factory, we could attach it to
the rendering engine instance with something like
`qweb.preprocessed_node = this.preprocessed_node`, however i find that
conceptually attaching a translate function to a factory does not make
sense, si i simply made `preprocess_node` a free function and i set it
on rendering engine instance.
2016-07-06 15:49:01 +02:00
Christophe Simonis 05e0bf3f1b [MERGE] forward port of branch saas-11 up to e7190cb 2016-07-06 00:03:49 +02:00
Christophe Simonis e7190cbbbf [MERGE] forward port of branch saas-10 up to 74b51d3 2016-07-05 23:42:12 +02:00
Christophe Simonis 74b51d3d97 [MERGE] forward port of branch 9.0 up to 489ea42 2016-07-05 23:19:50 +02:00
Denis Ledoux 489ea42859 [FIX] web: parsing of date with abbreviated month/day
When using the abbreviated month in the language
date format (`%b`),
e.g. `%d %b %Y`
in some languages, the parsing of the date
from this format to the database format (YYYY-mm-dd)
failed because of a dot `.` added from time to time
to the end of the abbreviated name
e.g., in French, `5 juil. 2016`

This is a bug of `moment.js` < 2.13.0,
handling badly this dot.
This is solved from `moment.js` 2.13.0,
thanks to the below revision
moment/moment@41fdb58572
moment/moment#3078

Unfortunately, we cannot update this library to its latest
release in stable release of Odoo (e.g. 9.0),
as this is seen as an unstable change
(if some API changes occured in the given library)

Instead, if the parsing of the date fails with the
strict mode (meaning the date must respect the format
exactly), we perform a second pass without the strict mode,
so this dot will be ignored,
and the date can be correctly parsed.

The issue can be reproduced by loading the French language,
and setting `%d %b %Y` as date format, and then performing
an advanced search on a date field. The value of the date
in the advanced search will be empty without this revision
(for the months having more than 4 chars,
other than `mars`, `mai`, `juin`, `aout`).

Fixes #11854
opw-682534
2016-07-05 18:04:22 +02:00
Simon Lejeune b0a25e5b0e [FIX] web: translation: don't reset database on set_bundle
set_bundle is called twice (one time by the session, another time
by the web_editor). As the `set_bundle` actually drop the dict of
translations instead of updating it and as web_editor only load
the terms of its module, depending on which call to `set_bundle`
ends first result on having your translations or not.

This commit update the database of translation instead of dropping
it, which fixe the current issue (the dict of traductions empty of
the traduction you really need) but another fix would be to remove
the useless call by web_editor when launched in the backend  (which
is probably there because it was needed when the web_editor was only
working in the website).
2016-07-05 17:48:33 +02:00
Simon Lejeune 06770f53bf [FIX] web: allow on_(attach|detach)_callback callbacks to be called
The `on_attach_callback` and `on_detach_callback` callbacks are
called when an a widget is attached / detached according to the
`is_in_DOM` variable. As the community's action manager cannot
be detached from the DOM, we can hardcode this value to true.

This allow to run these callbacks when needed.
2016-07-05 17:44:56 +02:00
Simon Lejeune 2fdf631809 [FIX] web: control_panel: do not trim breadcrumb's title if undefined 2016-07-05 17:44:56 +02:00
Denis Ledoux 6c85d925c3 [FIX] web: dialog close with a reason
In the below revision:
c0db6aec56

The dialog close `reason` was introduced
to not reload the current form if the dialog
has been closed for a reason
(e.g. a window action was returned by the server).

This is to prevent the record reload, which:
 - Is useless, as another action has been launched
   and the user therefore redirected elsewhere
 - Can fail, in the case the initial action deleted
   the current record
   (e.g. when merging a lead in an opportunity, the
   lead is removed, and therefore this is not possible to reload
   it).

 opw-680180
2016-07-04 18:40:15 +02:00
qsm-odoo 62fb1bb924 [REF] web_editor: code refactoring and simplification
* Remove dead code + optimization
* Use Dialog API from web module
* Reorganize files
* Correct buggy $() function for snippet option class
* Add comments

* Fix the snippet parent navigation :

If a page contained a three level snippet structure (i.e A contains
B contains C), when editing the following bug occured :

If B or C was selected first, parenting buttons were correctly set.
But if selecting A then C, clicking on the parent lead to going back
on A instead of going on B.

* Fix snippet thumbnail layout
* Better isolate ui css from themes
* MediaDialog image list : prevent displaying empty attachments
* ...
2016-07-04 17:23:59 +02:00
Christophe Simonis 5a3a06f26f [MERGE] forward port of branch saas-11 up to d4d09df 2016-07-04 13:16:34 +02:00
Nicolas Lempereur 811dd8f24c [FIX] web: submenu need toggling of .o_hidden
Since dce2a309 submenus where hidden by using the class `o_hidden` but
this was not taken into account when showing them (so opening submenu
was not possible).
2016-06-30 09:30:06 +02:00
Christophe Simonis 2eebef8d41 [FIX] web: pager minimum on next/previous record
Since the deduplication of web addons (977db823c7),
patch 9062c01c02 (freshly forward-ported)
is now useless. Apply odoo/enterprise@26adf4fe2c couterpart.
2016-06-29 13:58:20 +02:00
Christophe Simonis 93e6316029 [MERGE] forward port of branch saas-11 up to 7153077 2016-06-28 18:05:25 +02:00
Christophe Simonis 71530771ea [FIX] web: re-add now usefull variable self 2016-06-28 17:05:11 +02:00
Christophe Simonis 5166fbd21b [MERGE] forward port of branch saas-10 up to 6d51bce 2016-06-28 15:12:06 +02:00
Christophe Simonis 841aa4e208 [MERGE] forward port of branch 9.0 up to 3e15b86 2016-06-28 14:10:35 +02:00
Christophe Simonis 10550aa5a5 [MERGE] forward port of branch saas-6 up to e68ed41 2016-06-28 13:11:35 +02:00
Christophe Simonis b355377a25 [IMP] web: visible default color on tags now visible in kanban view
un-revert of fe66472e2c which have
wrongly been reverted with 977db823c7
2016-06-28 12:01:27 +02:00
Denis Ledoux 9062c01c02 [FIX] web: pager page on next/previous record
When browsing a form with a one2many / many2many field
with several pages, the one2many pager page was not reset
when going to the previous/next record, while the next/previous
record could not have multiple pages on its one2many/many2many,
and the page on which the user was on the former record could
not exist in the newly displayed record.

Besides, even if the page does exist, there is no reason
to display this new record X2many value from its first page.

It's the case anyway when you edit/save, it comes back to the first page.

opw-679092
2016-06-27 16:50:47 +02:00
Christophe Matthieu 5aac400e33 [IMP] qweb: use CDATA in test and remove stringify_children method 2016-06-27 14:29:04 +02:00
Géry Debongnie 96bf5b2656 [FIX] web: fix label for selection fields in grouped list view
Before this commit, the list view, grouped by a selection field, displayed the
'technical' value of the field as group label.  It was basically forced
to do that, because the result of the read_group only contains the
technical value.

This commit changes the list view in a way that it now requires a full field
get, so it can use it to find the correct string.
2016-06-27 14:03:54 +02:00
Martin Trigaux 5abcbf0eb2 [FIX] js: translations and string substitutions
_('foo '+bar) does not work as `bar` is a variable with undefinied content
during translation export (and variable content during evaluation) so a match
will not be found.
Also trailing spaces are stripped during synchronisation with transifex.

The proper syntax would be
_.str.sprintf(_t("foo %s"), bar)
but to avoid breaking existing translations (need to reexport .pot)
use the syntax
_("foo ") + " " + bar
that is more stable friendly.

The 'No value found for the field...' string is not possible to be fixed without
breaking the translations should be split at least twice.
Write it the propre way directly.
2016-06-27 12:05:36 +02:00
Christophe Matthieu 15e1f88a73 [FIX] qweb: fix t-if and t-else and add test
Can not use remove with the loop for in (in _compile_directive_content)
2016-06-27 08:08:00 +02:00
Denis Vermylen (dve) dce2a309d0 [FIX] web: menu: correctly show unfolded submenu
commit 69d4aa363b replaces show()/hide() by classname o_hidden
but the folded submenus were still hidden using .hide()
thus they always remained invisible.
2016-06-24 11:47:46 +02:00
Denis Vermylen (dve) 69d4aa363b [FIX] web: properly hides submenu (ir_actions target=fullscreen)
This commit fixes the action target="fullscreen" in community, where
the submenu on the left would sometimes remain visible.

The fullscreen feature was added in commit : d65d251c57
2016-06-24 10:04:24 +02:00
Christophe Simonis 4030f2fd32 [MERGE] forward port of branch 8.0 up to 297bbff 2016-06-23 16:21:28 +02:00
Christophe Matthieu 025263d3bf Revert "[FIX] web_editor: test jinja content to load editor in codeview"
This reverts commit f38f8930f0.

Revert for internal choice. Odoo want to use qweb in template and remove jinja support on next version.
If users want to use jinja they can change the view to use text widget instead of html widget.
2016-06-23 11:45:17 +02:00
Géry Debongnie 11f88c8cd4 [FIX] web, web_kanban: make qweb default dict configurable
In a previous refactor, qweb configuration was simplified.  However, I
missed the fact that session.js sneakily configure the qweb instance
after the fact. As a result, the kanban view did not have the _s key in
its custom qweb instance default dict.  This commit allow the qweb class
constructor to add default keys to the instance.

Now, kanban view can add _s, and everything is good.
2016-06-23 09:34:49 +02:00
Denis Ledoux b630c199a5 [FIX] web: 2many race condition on fast click on Save / Edit
For `this.viewmanager.active_view` to be set, the view manager
switch mode must be completed, meaning the deferred returned by
the function `switch_mode` must be resolved
(see `this.active_view = view;` in `view_manager.js`, line 146)

In a 2many field, the view manager `switch_mode` deferred is resolved
when `is_loaded` of this field is as well resolved.

Before this revision, clicking fast on Save then Edit
of a vendor bills resulted to a JS error due to a race condition,
because `this.viewmanager.active_view` was undefined when
the field was not loaded / the view manager switch mode not completed.

opw-678097
2016-06-22 18:11:20 +02:00
Christophe Matthieu f38f8930f0 [FIX] web_editor: test jinja content to load editor in codeview
The preview change the content because the browser try to fix the dom.
If a user use jinja and activate the preview, the jinja code is (re)moved by the browser and broke the template.
2016-06-22 14:26:42 +02:00
Christophe Matthieu 8d09a11cea [FIX] web: FieldX2Many must use AbstractManyField is_false method
If the method return false, when a user write require="1" on a x2many field, the content is valid that there have none or a value.

The method was overwrited for a visual change (display the field x2m in readonly mode when they are not value) but is_false is priority use to ensure datas.
2016-06-22 09:25:25 +02:00
Christophe Matthieu a9fac2ea2d [FIX] web: required attribute on one2many field
Require One2many field without any line must show an error like many2many fields.

issue 11782
2016-06-22 09:16:07 +02:00
Christophe Simonis da53a27a5d [MERGE] forward port of branch saas-11 up to c88c70e 2016-06-21 16:24:38 +02:00