Commit Graph

398 Commits

Author SHA1 Message Date
Nicolas Lempereur 69925ca6f0 [FIX] web: display prev/next arrow after grouping
On a list view, if we group records the arrows and changing page
feature are disabled. But if then we removed the grouping, the arrows
never reappeared.

note: not necessary as of 9.0 it was already solved in 1280bf251

opw-760956
closes #18596
2017-08-01 13:56:26 +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]: 5d17749ff4/addons/web/static/src/js/view_list.js (L1125)
2017-03-28 15:12:56 +02:00
Nicolas Lempereur 5d17749ff4 [FIX] web: repair length field in view list
Underscore method _.each expects an array like object when a "length"
property is present.

This was an issue with a record having a numeric "length" field set to a
non-negative value. When changing a line the change would not appear on
blur.

This issue was fixed with 0e664c9e9 but introduced back with f0e331e00.

opw-691070
2016-10-24 13:25:58 +02:00
Jeremy Kersten d3609f7f19 [FIX] web,crm: list view, don't fallback on group_operator declared in python
Partial revert of odoo/odoo@633780a
2016-10-12 18:03:51 +02:00
Jeremy Kersten 633780a00c [FIX] web,crm: view_list respect group operator defined in the view.
Remove useless avg defined on crm view.

If you define avg='Average Values' in a view, now we see in the footer of list view the average.
2016-10-11 11:50:24 +02:00
Nicolas Lempereur 1da79b872e [FIX] web: keep m2m value in list view
Currently, when rendering a list view cell with a many2many we would
empty the list of ids, and fill it again once a name_get is resolved.

But in some instance, the code could use the data when it has been
emptied out.

For example, if we set the tax_id field (inside the order_line list view
inside the sale.order form view) as requred, if we modify the order line
and save directly (without clicking outside of the list view) we can get
an incorrect error saying that the "Order Line" is not valid.

It has been reproduced when saving with CTRL + SHIFT + S on google
chrome and firefox, and there have been reports that for some
configuration it also happen when clicking on the "Save" button.

This commit change the behaviour so the value is kept whilst the name_get
is ongoing, and just use a default "false" value for the name during this
interval.

closes #13478
opw-668067
2016-09-14 15:52:48 +02:00
Xavier Morel ceb87b78f0 [REV] usage of m2m listview for o2m
Turns out to break way more than it fixes.
2016-04-05 11:32:59 +02:00
Peter Hahn c2abdbbc37 [IMP] Make many2many widgets in listview usable for one2many
Existings many2many widgets in ListView can be used also for one2many if
the supplementary data is provided for the column.

closes #11282
2016-03-25 16:54:32 +01:00
Christophe Simonis 83a4a582fa [MERGE] forward port of branch saas-3 up to 513cea6 2015-12-08 12:28:41 +01:00
Christophe Simonis 47b2f7ea9e [MERGE] forward port of branch 7.0 up to 3a1c693 2015-12-08 12:16:00 +01:00
Cedric Snauwaert d179a94da6 [FIX] web: list_view, context when doing name_get call in m2m was not compute correctly
this is a backport of commit fd56268c6ca4e8a6f94f16de9129bd12be87303f
2015-11-26 10:25:15 +01:00
Stefan Rijnhart 33a65c2b8e [FIX] web: binary fields in one2many widgets
Don't retrieve the binary contents just to display the size, but pass context
with bin_size=True instead
Always pass filename in download link

Combination of patches from the bug report from Enrico Ganzaroli, Cedric Le
Brouster and Holger Brunn
Fixes #4899, lp:1167429
2015-06-25 11:45:47 +02:00
Christophe Simonis 416f0246ac [MERGE] forward port of branch saas-3 up to 4a3c471 2015-03-09 12:03:22 +01:00
Christophe Simonis 4a3c4713e9 [MERGE] forward port of branch 7.0 up to 209ce6f 2015-03-09 11:24:32 +01:00
Aaron Bohy e73a3c6898 [FIX] Web: view_list.js: pager next and previous actions
When the number of records n and the limit l were such that n%l = 0
(e.g. 16 records total, 8 displayed per page), clicking on the
previous button on the first page, or on the next button on the
last page produced a bug because the total number of pages
computed for this edge case was incorrect.
2015-02-25 14:35:19 +01:00
Denis Ledoux ca7036776d [FIX] web: do not apply default_order if list grouped
If the list view is grouped (with a groubpy filter),
the default order must always be the order of the groupby
2015-02-09 14:44:45 +01:00
Xavier Morel 93fa43f900 [REV] 54e75b02: excessive breadth makes all falsy values disappear from lists
Empty checkboxes are supposed to be displayed.

Fix specifically and only in the binary field.
2015-02-05 14:39:40 +01:00
kevin wang 54e75b0286 [FIX] Empty binary column download error
In case of an empty inline column, a Download link inviting the user to
click would still be rendered (erroring out if the user eventually
clicked on it)

fixes #3684
2015-01-29 16:06:22 +01:00
Julien Legros 26bf35260d [FIX] web: reordering in editable list views
Broaden the set of conditions where reordering is allowed. Lists can be
reordered when they are sorted by sequence (or sequence ASC)

opw-619465
2014-12-19 15:18:31 +01:00
Christophe Simonis 5ca7fa18fc [MERGE] forward port of branch 8.0 up to 31a01ea 2014-12-03 19:24:57 +01:00
Christophe Simonis 2ed212dcbf [MERGE] forward port of branch 7.0 up to d6daf5f 2014-12-03 17:51:06 +01:00
Martin Trigaux a765876ffb [IMP] web: do not fully hide pager in grouped view
When the list view is grouped, the page count should be hidden as irrelevant.
However if it's fully hidden, the limit can no longer be changed.
Instead of hidding the pager, this commit hides the arrows and replaces
the content by the current limit to allow to be changed.
2014-12-03 15:02:36 +01:00
Christophe Simonis d37dd37059 [MERGE] forward port of branch saas-3 up to e1e7dc0 2014-12-01 15:42:51 +01:00
Christophe Simonis e1e7dc0af9 [MERGE] forward port of branch 7.0 up to 419d934 2014-12-01 15:33:48 +01:00
Géry Debongnie 29f895f947 [FIX] fix editing one2many in some cases (web)
See issue #3964 for more detail.  Main problem was caused by commit
f0e331e005.  It set the key name+'__display' to false when reloading
a record for all field types, but it was only concerned with many2many.
2014-12-01 10:29:00 +01:00
Denis Ledoux e347011f24 [MERGE] forward port of branch 7.0 up to 2080ea0 2014-11-27 13:27:37 +01:00
Pierre Verkest f0e331e005 [FIX] correctly update many2many in listview (web client)
Fixes the issue #1216 (follow the link for more information). The issue
was caused by a hack in list view: the magical suffix __display is used
in render_cell to determine if a many2many field should be updated. This
commit simply makes sure that old many2many fields + __display keys are
cleared.

A better way would be to redesign/refactor the list view to avoid that
hack in the first place.  But this would be a much more complex task.
2014-11-26 15:42:34 +01:00
Raphael Collet 53ff84493f [IMP] fields: allow sorting on inherited field in list views 2014-10-01 16:00:44 +02:00
Raphael Collet 2ad092b5e5 [ADD] doc: new documentation, with training tutorials, and new scaffolding 2014-08-22 17:51:20 +02:00
Olivier Dony e11eddf753 [MERGE] Forward-port of saas-5 up to 20cc18d 2014-08-13 20:46:47 +02:00
Denis Ledoux b49755b545 [MERGE] forward port of branch saas-3 up to 591326c 2014-08-13 10:29:14 +02:00
Denis Ledoux 8a7728790b [MERGE] forward port of branch 7.0 up to 60ab6f1 2014-08-12 17:49:12 +02:00
Denis Ledoux 60ab6f111e [FIX] web: on switch form (from list & kanban) do not load record if empty dataset 2014-08-12 17:45:05 +02:00
Martin Trigaux f9d43e83c6 [FIX] web: correct rev 680f955
Missing backport of commit f652402 for buffered dataset
Again, should not be forwardported
2014-07-23 12:31:25 +02:00
Anaël Closson 680f9554b4 [FIX] web: reload after wizard when record has been removed cause exception
If an action unlink the current records (e.g. unreconcile on account.move.reconcile), trigger history_back to avoid errors when trying to reload inexistant record (opw 607883)
This is a partial backport of saas-4 code (rev c0db6ae, 162ad1c) and should not be forward ported.
2014-07-22 13:18:00 +02:00
Christophe Simonis 1f57528bc6 [MERGE] forward port of branch saas-5 up to 8dfd5ea 2014-06-27 16:14:40 +02:00
Christophe Simonis a4bc65cdba [MERGE] forward port of branch saas-3 up to bdc4dd4 2014-06-27 16:06:37 +02:00
Christophe Simonis bdc4dd4a65 [MERGE] forward port of branch 7.0 up to 95cff0b 2014-06-27 16:00:28 +02:00
Martin Trigaux 30ac7248d6 [FIX] view_list: hide pager in view group
Displaying the pagert in view group does not make sense as it's not updated when changing filter and every group (even if more than 80) is displayed in view group
2014-06-27 15:28:34 +02:00
Christophe Simonis 1eaa69d342 [MERGE] forward port of branch saas-5 up to 9e8e365 2014-06-25 12:44:13 +02:00
Christophe Simonis f68c83545a [MERGE] forward port of branch saas-3 up to a66f3dd 2014-06-25 12:33:17 +02:00
Denis Ledoux 8e83dbff5d [MERGE] Forward-port of 7.0 bugfixes up to 7d3453d119 2014-06-24 12:27:09 +02:00
Géry Debongnie 5f09c7dedc [IMP] improves sorting mechanisms in datasets
Create a deserialize_sort method and add a set_sort method to
datasets.  The set_sort method is useful to avoid duplicating code
in lists and kanban views (to set the initial default order)
2014-06-16 10:44:23 +02:00
Géry Debongnie cb7450acec [IMP] improves the default order parameter
It is renamed 'default_order' and now supports the usual syntax for
sorting fields: for example 'field1, field2 desc, field3 asc'
2014-06-13 14:55:26 +02:00
Géry Debongnie 4c0222355d [IMP] add default order parameter to list views
List views can now be sorted by default with a simple keyword 'order'.
For example

...
<field name="arch" type="xml">
    <tree string="Product Variants" order="name">
        <field name="name"/>
        ...
2014-06-13 11:57:18 +02:00
Sandy Carter 3594dc56da [FIX] Add context propagation for m2m list view
Fix bug https://bugs.launchpad.net/openerp-web/+bug/1279885 :
    Many2many fields in Tree views will not get translated.
    If you check the context for a name_get of a m2m field, it is passed as
    None.

Add context propagation to m2m fields in list views.
Fix translation issues when viewing a a many2many field in a Tree view.
2014-05-16 17:42:20 -04:00
Thibault Delavallée a74eb749ae [MERGE] Sync with trunk
bzr revid: tde@openerp.com-20140401100513-e4iglorrxnj0ne8j
bzr revid: tde@openerp.com-20140403122017-zl668mpi0w5gwps0
bzr revid: tde@openerp.com-20140408083733-8plf5daah4c8yxxx
2014-04-08 10:37:33 +02:00
Denis Ledoux f652402dd7 [FIX] web: read_ids of data.js use method search_read if check_access_rule option is true.
This fix is related to revision 3985 revid:dle@openerp.com-20140326142040-pls0dk2kd03z55ro, which did not worked for buffered dataset (virtual one2many line in view form
search_read is used instead of read to not return records for which we lose the access rights

bzr revid: dle@openerp.com-20140327112456-iyceuf9dnn07hwke
2014-03-27 12:24:56 +01:00
Denis Ledoux 7acaaf5894 [FIX] web: use search_read instead of read on form reload and record reload in list, to check if the user can still read the record
bzr revid: dle@openerp.com-20140326142040-pls0dk2kd03z55ro
2014-03-26 15:20:40 +01:00
Denis Ledoux 649ef3ed21 [REVERT] 4164 revid:dle@openerp.com-20140326113036-g9yv3jj6yetwxvg8: this fix actually works in saas-3, but not in 7.0, as search_read method is not part of the orm
bzr revid: dle@openerp.com-20140326123513-jkful2m1n2zjgdmv
2014-03-26 13:35:13 +01:00