Commit Graph
7411 Commits
Author SHA1 Message Date
Nicolas Lempereur 6252c21000 [FIX] web: modifiers computed when x2many ready
Modifiers (eg. required, readonly, ... on a field) are computed after a
record has been changed. When loading a record they could be computed
based on x2many in a inconsistent state.

eg. on res.partner form, by defaut the email is required depending on:
        [('user_ids','!=', [])]
    but when switching from one record to another this was computed
    wrongly based on the difference between the two records.

This change make the x2many when loading a record ready to be used as
soon as it is set to solve this issue.

forward-port: not needed after saas-15 thanks to framework views rewrite

fix #18239
opw-749483
closes #18815
2017-09-19 17:49:43 +02:00
Yenthe V.G 1d769ad5a7 [FIX] web: Don't show buttons when model has readonly access
PR #19314
2017-09-08 09:23:44 +02:00
Goffin Simon ce9bbf6c10 [FIX] web: Setting ir.values for computed fields
Setting ir.values for computed fields is useless as the function onchange
in models.py will set to False all the computed fields with a modified dependence.

opw:767942
2017-09-06 16:30:05 +02:00
Lucas Perais (lpe) b6778ee752 [FIX] account: reconciliation_widget: rounding of reconciliation_amount computation
Use case:
- a tax of 10%, computation method: percentage of tax included
- a account_reconciliation_model with an amount of 90%
- make a statement of 1.31 (or something weird when it comes to digits)
- reconcile it with a counterpart
- prefill that counterpart with the account_reconciliation just created
- push on reconcile

Before this commit, the amount that was computed was not rounded, resulting in making unbalanced account_moves (by 0.001)
This was invisble since the display of monetary is rounded
After this commit, the rounding is done according to the currency's parameters and produces correct move_lines

OPW 751881
2017-09-01 17:15:47 +02:00
Christophe Simonis 22eb3ee971 [MERGE] forward port branch saas-11 up to 428ad2dfe3 2017-08-28 11:30:46 +02:00
Lucas Perais (lpe) 6797d6a7c6 [FIX] web: don't save empty required x2manys
Before this commit, the same function was called at the rendering and at the writing of a field.
It caused a field that should be displayed all the time (field is never false) to ignore its required attribute, in particular with one2many's.

After this commit, we differentiate between the rendering function and the validate to write function, making a type of field both requirable and always displayed even if empty

OPW 766002

Closes odoo/enterprise#1306

Cherry-pick odoo/enterprise@be8e570991
2017-08-23 12:20:24 +02:00
Nicolas Martinelli 388e258ce8 [FIX] web: rotate graph label
When there are too many labels to display on the x-axis, they overlap
and it simply becomes unreadable. By slightly rotating them, this can be
avoided in most cases.

opw-697625
opw-697626
2017-08-23 08:44:12 +02:00
Nicolas Martinelli 7cd2f63705 [FIX] *: cancel settings
To reproduce:
- Go Website Admin > Configuration > Settings
- Change the Website Name
- Click on 'Cancel'

The name is saved.

When the "Cancel" button is clicked, we automatically save the record
(which is a transient model). Since the field is a related to the
company, the name is changed even if we canceled.

opw-760749
2017-08-04 08:25:33 +02:00
Yenthe V.G d82933d8e7 [FIX] web: change exception name from openerp to Odoo
The crash manager still used the old name for the exception. (PR #18522)
2017-07-28 15:44:18 +02:00
Christophe Simonis 0a089f87fb [MERGE] forward port branch saas-11 up to 4bf6f5a7e3 2017-07-26 15:45:37 +02:00
Nicolas Lempereur 69236ada46 [FIX] web: sorted saved filter lost in merge
In 3071ef16c sorted filter was added, but arround the same time with the
change of filter in 6c579354 the js part of the feature was lost.

This commit adds it back.

opw-749422
closes #18361
2017-07-26 12:47:14 +02:00
Christophe Simonis cb01cfe9ff [MERGE] forward port branch saas-11 up to aa578e1bee 2017-06-29 16:34:59 +02:00
Christophe Simonis aa578e1bee [MERGE] forward port branch 9.0 up to 4d4ff7c5e7 2017-06-29 13:12:53 +02:00
Jeremy Kersten 32423169af [FIX] web: namespace the event for Apps Widget.
With the new client web from v9, we start the new action before to destroy the old one.

When we switch from Apps (store) to Update and vice-versa, iframe was not loaded correctly.

In case of the Apps widget, we are binding event of the new iframe during the start,
and when it is ready, we destroy the old ifram and so unbind the listener of 'message.apps'.

Using a uniq id, we ensure to bind new event, and only unbind old event during the destroy.
2017-06-28 14:36:11 +02:00
Christophe Simonis fcc33f3e09 [MERGE] forward port branch saas-11 up to 6ceecffcad 2017-06-12 18:52:53 +02:00
Christophe Simonis 6ceecffcad [MERGE] forward port branch 9.0 up to d9d455bea3 2017-06-12 18:18:05 +02:00
fwi-odoo b6a08dc982 [FIX] web: hide 'duplicate' action for ir.model.fields
It shouldn't be possible to duplicate ir.model.fields. Add attribute
´duplicate´ which can be set to false to hide the duplication option in the
action menu.
2017-06-12 11:14:55 +02:00
Christophe Simonis cd1a8f6252 [MERGE] forward port branch saas-11 up to 1d7260cbcb 2017-06-09 13:08:51 +02:00
Christophe Simonis 1d7260cbcb [MERGE] forward port branch 9.0 up to 77be3d8b39 2017-06-09 12:51:31 +02:00
xmo-odoo 45e94ec756 [FIX] web: CrashManager can crash if trying to show an empty message
If `d.message` is an empty string, `!!d.message` is false and the
crashmanager will try to display `d.error.data.message`… which does
not exist as it's a warning with an empty message not an upstream error.

That causes the crashmanager itself to crash, and even the warning
name/title to be lost.
2017-06-08 14:16:43 +02:00
Jairo Llopis c4c9347b99 [IMP] web: Expose char_domain dialog widget
This simple return allows submodules to be able to know when a dialog is shown and modify something in it.

Note from GED: I am aware that this is a IMP in a stable version, and I really don't like that... But it looks like it really helps many people, as shown by the PR, and the risk induced by this commit is definitely extremely low, so I will make an exception.
(PR: #15579)
2017-06-08 13:53:49 +02:00
bluesoft83 aed5563000 [FIX] web: error setting wraparound on undefined
In function _next, sometimes options parameter is not passed, so setting on undefined is causing error.  (PR #15716)
2017-05-30 16:56:51 +02:00
Carlos Lopez d88dcde4f0 [FIX] web: pivot view should use col_group_by and measures key
For historical reasons, when the pivot view was rewritten, we lost the ability to understand the measure and col_group_by keys from the context.

It was actually a deliberate decision, because we decided that it was not possible to properly handle the colgroupbys in the search views, so we replaced that mechanism with pivot_col_group_by and pivot_measures keys exported by the view, when necessary.

Sadly, we did not properly remove the outdated keys from the xml files.  So, with this commit, we reintroduce those special keys, because 10.0 is a stable version.  Note that this will be removed in master.

 (PR 17119)
2017-05-30 09:12:38 +02:00
Olivier Dony ab8c81a96f [MERGE] Forward-port saas-11 up to 0570033ae7 2017-05-16 10:30:23 +02:00
Aaron Bohy 4e8e546ed7 [FIX] web: DebugManager: open view: search and qweb views
can't be opened that way.

For now, only views that can be opened with a view manager are
supported, i.e. views like form, list, kanban, graph...

So this fix filters out the views of type qweb and search from the
list.
2017-05-11 08:52:24 +02:00
Aaron Bohy 7e98e32959 [FIX] web: traceback when quickly clicking on back button
Before this rev., there might be a crash when the user quickly
clicked several times on the browser's back button. This crash
occurred in the code saving/restoring the scroll position of the
current action.

When clicking fast on the back button, several actions are
executed but don't wait for each other (those actions are triggered
by the hashchange event), so when it is fast, and mainly when the
appswitcher is involved, it may happen that we try to get the
scroll position of an action that isn't loaded yet.

opw~741814
2017-05-09 14:54:15 +02:00
Christophe Simonis d5cdb77717 [MERGE] forward port branch saas-11 up to b7e4ce93c4 2017-05-05 16:01:38 +02:00
Christophe Simonis b7e4ce93c4 [MERGE] forward port branch 9.0 up to c65db01eb7 2017-05-05 15:43:56 +02:00
Nicolas Lempereur 89ad23bc2d [FIX] web: auto_search false and search view
By default auto_search is set to `True` on window actions, this mean
that for example on a list or kanban view the records will be searched
on the view opening without any user action needed.

Setting it to `False` disable this.

Doing this had two drawbacks:

- depending on race condition, the view could be displayed before the
  search view was loaded,

- the code expected `active_search` to be present which was not the case
  in this instance.

Before 151c9074 the second issue would not happen (active_search was set
directly resolved if a search was not to be done) and this commit also
wait for the search view being ready before showing the view.

opw-741186
opw-741546
closes #16805
2017-05-05 13:31:11 +02:00
Nicolas Martinelli be1ca7b100 [FIX] web: min/max integer
In PostgreSQL, a field of type `integer` must be in the range
-2147483648 to +2147483647. If the user enters a lower or a larger
value, a traceback is thrown.

opw-740286
2017-05-02 16:11:01 +02:00
Christophe Simonis c66e454f06 [MERGE] forward port branch saas-6 up to 671864e72b 2017-05-02 12:07:05 +02:00
Christophe Simonis 671864e72b [MERGE] forward port branch 8.0 up to 0b4d01f1d3 2017-05-02 11:40:48 +02:00
Dainius Kaniava 4f9ac6c093 [FIX] web: properly transfer javascript options
Fix options not being passed from view declaration to JS
frontend function. If passing option 'no_create': True,
"Create" button was still visible.
2017-04-28 21:13:28 +02:00
Christophe Simonis 814c550913 [MERGE] forward port branch saas-11 up to a0ff1f2ad8 2017-04-21 14:34:11 +02:00
Christophe Simonis a0ff1f2ad8 [MERGE] forward port branch 9.0 up to 8de514f805 2017-04-21 14:19:05 +02:00
Christophe Simonis 8de514f805 [MERGE] forward port branch saas-6 up to b084ffd7f1 2017-04-21 14:07:02 +02:00
Christophe Simonis b084ffd7f1 [MERGE] forward port branch 8.0 up to 716ceede16 2017-04-21 14:05:52 +02:00
Nicolas Lempereur 716ceede16 [FIX] web_enterprise: kanban_state_selection ie
On IE (from 9.0 up to at least IE EDGE 14) we have this behavior
for the method serializeToString of XMLSerializer:

> (new XMLSerializer()).serializeToString($('<b>"</b>')[0])
  '<b xmlns="http://www.w3.org/1999/xhtml">"</b>'
> (new XMLSerializer()).serializeToString($('<b>"</b>')[0].firstChild)
  '&quot;'

Whilst browser such as chromium or firefox have:

> (new XMLSerializer()).serializeToString($('<b>"</b>')[0])
  '<b xmlns="http://www.w3.org/1999/xhtml">"</b>'
> (new XMLSerializer()).serializeToString($('<b>"</b>')[0].firstChild)
  '"'

Hence for IE9 and over, if in a `<t t-extend/>` a `t-jquery`
sub-directive (without `t-operation`) is available, we can have
broken javascript if a " is transformed into an &quot; at a unfortunate
location.

This commit favour node.data over XMLSerializer serializeToString to
avoid the possibility of this issue when a text node is processed.

opw-727283
2017-04-20 17:08:17 +02:00
Christophe Simonis 9e159ef204 [MERGE] forward port branch saas-11 up to f830c7c3e3 2017-04-12 18:51:16 +02:00
Christophe Simonis d4d5181285 [MERGE] forward port branch saas-6 up to 271067f50c 2017-04-07 15:11:50 +02:00
Christophe Simonis 271067f50c [MERGE] forward port branch 8.0 up to 3128e84243 2017-04-06 14:46:56 +02:00
Nicolas Lempereur 0b2fd60041 [FIX] web: editable list view regression bc031379 (9.0)
In 9.0 in some particular instances with embedded views, if:

- an x2many list view is editable,
- we go from a form view of an existing record to creating a record,
- the timings of deferred resolving are in a certain order

the x2many list view could be tought as loaded whilst in reality it is
the 'editable list view' row editing 'form view' that has been loaded.

This could cause sometimes issues after bc031379 because the onchange
computation would happen before the list view is really loaded.

This is probably an issue with the deferred system in one of the views,
but it would be rather hard and dangerous to change it.

So this fix introduce an additional test which ignore relational views
if there is an embedded view.

opw-726701
opw-726768

note: only needed for 9.0, the relational views have been changed as of
saas-11 and this issue is not present.
2017-04-04 17:29:53 +02:00
Denis Ledoux 759492167a [FIX] web: textarea of editable list above everything
When expanding a textarea of an editable list,
by putting a long description for instnace,
with multiple lines,
some elements were put above the textarea,
making the content partially hidden

opw-709894
Closes #16083
2017-04-03 17:23:58 +02:00
qsm-odoo 2b81636e39 [FIX] web: fix export dialog design on IE
As the export dialog has always lots of content, the design was made
so that it always takes 100% of the viewport height. This allowed to
design the dialog content so that the fields panels do not overflow
the modal and are individually scrollable and so that the buttons are
vertically centered.

The problem is that this was not properly working on IE. Indeed, the
`.modal-body` element overflowed the `.modal-content` one. The solution
is in two parts:

 1) IE does not properly distribute heights when combining flex elements
    with max-height containers. The `.modal-content` has to be forced
    to `height: 100%;` for this to work. This is done in javascript as
    there is no way to detect `.modal-content` elements specific to
    export dialogs.

 2) IE does not properly render `flex: 1 0 0;` elements. The rule is
    supposed to tell the browser "render the element as if it was of
    dimension 0 and was able to grow to fill its parent container".
    Fortunatly, a workaround with `flex: 1 1 auto;` combined with
    `min-height: 0;` seems to achieve the same behavior for this
    case (by telling "render the element by shrinking or growing
    it to fill its parent container, without caring of its minimum
    size").

opw-725391

Cherry-pick of odoo/enterprise@dd059f0af7
2017-03-28 17:37:33 +02:00
qsm-odoo 72fa3e8bda [FIX] web: properly display tooltips with much data
When there is a lot of texts to display in a tooltip, it will overflow
the viewport vertically as the max-width of the tooltip is set at 200px
(bootstrap default). This commit increases the max-width to the
viewport full-width.

opw-725804
2017-03-28 16:45:35 +02:00
Christophe Simonis c37f1f6cb9 [MERGE] forward port branch saas-11 up to 8bab7aebd6 2017-03-28 16:17:09 +02:00
Christophe Simonis 8bab7aebd6 [MERGE] forward port branch 9.0 up to e876becada 2017-03-28 16:14:34 +02:00
Christophe Simonis e876becada [MERGE] forward port branch saas-6 up to 7bcfa2b52a 2017-03-28 16:01:05 +02:00
Christophe Simonis 7bcfa2b52a [MERGE] forward port branch 8.0 up to 5fc3979262 2017-03-28 15:22:58 +02:00
Jairo Llopis 5fc3979262 [FIX] web: Avoid double-fetching many2many tags in list views
Before this patch, #15920 was happening. The problem was that calling `render_cell` produced a call to [`record.set(column.id + '__display', value)`][1], which triggers the `change` event, which called `render_record` the first time, which called again `render_cell` and produced the 2nd data fetch.

After this patch, `render_record` is only called if there is some place where to put the result, which does not happen in those situations.

There is still the problem that there is one call to name_get for each many2many widget found in a list view (instead of one per full view rendering), but at least they are not two calls!

[1]: https://github.com/odoo/odoo/blob/5d17749ff47c02294d5ff2ae56bbcef9d082562e/addons/web/static/src/js/view_list.js#L1125
2017-03-28 15:12:56 +02:00