Commit Graph

1782 Commits

Author SHA1 Message Date
Christophe Matthieu 0ba248aeda [FIX] web: prevent default value changes
Load record use values as dataset and change object value (for eg: add virtual id in the default value object).
2015-12-01 13:41:28 +01:00
Nicolas Lempereur 15b0596c31 [IMP] web: remove onchange on m2o one remove record
These onchanges were needless since it was already done by the
BufferedDataSet when we use alter_ids to add/remove ids/virtual ids from
the recordset.

The onchanges this commit remove were introduced with 6b907bb4d in
juliet 2012 whilst the onchange in the BufferedDataSet when using
dataset alter_ids was with dd747c096 in october 2012.

closes #8273
fixes #7595
opw-644706
2015-11-10 12:38:04 +01:00
Christophe Matthieu ee2b550f3c [FIX] web: radio button display empty value when change record
When a selection field with widget="radio" is False, the form view display the previews value for this field.

1 - Create a selection field (ex: [("1", "1"), ("2", "2")]), and display it on a form vue.
2 - Go to the form view (all the record have False value for this field).
3 - Change the value of this field for one record.
4 - In readonly mode, all other records now wrongly display this value (still False in DB or when "edit").

#opw-652002
2015-10-29 07:21:36 +01:00
Christophe Simonis d744923b63 [MERGE] forward port of branch saas-3 up to 1783a7d 2015-08-27 18:01:52 +02:00
Christophe Simonis 1783a7d005 [MERGE] forward port of branch 7.0 up to 411a07a 2015-08-27 18:01:14 +02:00
Nicolas Lempereur 411a07a64e [FIX] web: enable default_focus on html field
closes #8244
opw-647578
2015-08-27 13:20:41 +02:00
Holger Brunn f204c76f23 [FIX] web: keep the context we got in Many2ManyDataset
This bug causes binary fields in many2many lists being presented as a data url,
even though bin_size is passed.

Closes #6966
2015-07-08 13:42:59 +02:00
Nicolas Martinelli b4efb4eeb3 [FIX] web: on calendar with date and time, focus in the field only when hidden
The behavior of the datetime widget was to focus in the field every time a date
is chosen. This causes an issue if the datetime widget is called from an
editable list. Indeed, the list editable will consider that the value has been
set, and therefore the value will not be changed anymore if the user choses
another date.

The new behavior is to put the focus only when the date picker is hidden,
therefore the editable list will consider the value set only when the selection
is done.

opw-644062
Fixes #7463
2015-07-07 11:19:27 +02: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 b8bf1e0905 [MERGE] forward port of branch saas-3 up to ea659cb 2015-06-24 12:37:08 +02:00
Christophe Simonis ea659cbd87 [MERGE] forward port of branch 7.0 up to 16a545b 2015-06-24 12:34:03 +02:00
Nicolas Lempereur 1942522969 [FIX] base: update File Content for binary field
To distinguish two ir.attachment 'File Content', we base it on the file
size (this I imagine is for efficiency).

This is done by setting bin_size in the context. Doing this, the
returned db_datas field will be the file size of the converted to base64
content (if no filestore).

But this size is returned in string format, so "get_nice_size" (in
openerp/osv/fields.py) which gets this size calculates the length of the
string. e.g: if the size is '2142' get_nice_size will return 4.

This fix solves this by converting the string to an integer, thus
unifying it with the filestore case (where we use os.path.getsize which
return an integer).

Also, the field presenting the issue (FieldBinaryFile) has been changed
so it is always updated even if the size is the same (as it was already
done by 3632949 for FieldBinaryImage widget).

closes #7223
opw-643071
2015-06-23 15:20:33 +02:00
Nicolas Lempereur 71aa34fb54 [FIX] web: see selection didn't show selection
This fix gives the domain to the "See selection" view opened from a
FieldCharDomain.

In Odoo 8.0, this widget is available at two places:

- mass_mailing: Marketing > Mass Mailing | Mass Mailing > (any
  newsletter) > "See selection".

- gamification: Settings > Gamification Tools > Challenge > (any
  challenge) > "See selection".

With this fix the "Selected records" view display selected records.

closes #6463
opw-633201
2015-04-28 09:22:07 +02:00
andreparames d4aa2decde [FIX] web: onchange compare changes using === operator
The onchange handler is doing a weak comparison between the values received from
the onchange() method and the current field value, which leads to a falsy value
such as "0000" being treated as equal to False.
This patches changes the operator to enforce non-coercive equality.
Fixes #6405
2015-04-23 16:02:21 +02:00
Luc De Meyer f8a2a64ade [FIX] web: onchange on field binary
If a onchange is set on a binary field, the name of the file (filename attribute
defined in the view) is still the name of the previous file.
Fixes #2427, opw 617109
2015-04-20 16:42:15 +02:00
Martin Trigaux 6262e3479b [FIX] web: onchange on field binary
When setting a value to a field binary, a char field can be set as 'filename'
that needs to be recomputed to specify the new file name.
Before new api, the _internal_set_value method would trigger a onchange but it's
no longer the case now (so onchange on filename field was no longer executed).
Instead, manually set the value using set_value method which do trigger the
onchange.
Fixes #2427, opw 617109
2015-04-20 16:33:55 +02:00
Christophe Simonis 3540ec53e4 [MERGE] forward port of branch saas-3 up to 6b70b80 2015-03-25 18:00:08 +01:00
Christophe Simonis 6b70b80a0e [MERGE] forward port of branch 7.0 up to 881c10b 2015-03-25 17:41:53 +01:00
Christophe Simonis 77a75d4e1f [FIX] web: remove leftover `future_display_name`.
see 694fe1f
2015-03-21 15:59:05 +01:00
Nicolas Lempereur d539be329e [FIX] view_form: add context to search_count
Currently, the view_form search_count doesn't propagate the context, so when
searching on a translated field, the count can be different than the one we
would expect and get with a search in a current language different than en_US.

opw-628792 opw-630212 closes #5825
2015-03-20 10:39:33 +01:00
Christophe Simonis 7780004f95 [FIX] web: correct many2one dropdown visibility.
The dropdown should only be append to visible elements.
2015-03-19 18:41:45 +01:00
Nicolas Lempereur b97578f689 [FIX] view_form: sequence at item creation
The sequence for new items in some models is simply set to a constant 10.
Hence if 3 items had after reordering sequences 10, 11 and 12. If a new item is
added, it would get after saving at the second position.

This fix set the sequence of a new item to the maximum+1 or minimum-1 sequence
of current items sequences (max if tree has editable="bottom", min if tree has
editable="top").

opw-627830
2015-03-19 09:56:12 +01:00
Olivier Dony 694fe1fb3f [FIX] web: remove deprecated hack for future_display_name
This temporary patch was used to simulate the presence of a
`display_name` field in all models. It is not needed anymore
as of version 8.0, which comes with the actual magic to make
`display_name` work everywhere.
2015-03-18 14:10:18 +01:00
Christophe Simonis c0496ed03a [MERGE] forward port of branch saas-3 up to f8a9405 2015-03-10 18:00:43 +01:00
Christophe Simonis f8a94057e5 [MERGE] forward port of branch 7.0 up to a5e3269 2015-03-10 17:51:16 +01:00
Nicolas Martinelli 2cc09e86af [FIX] web: on_change event on one2many fields was not fired if an attribute is mandatory (courtesy of Christophe Matthieu)
opw: 626974
2015-03-09 16:20:36 +01: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
Denis Ledoux c9a72b79e4 [FIX] web: size of text fields textarea when invisible by default
Text fields, or char fields having widget="text",
were not sized correctly when the field was not
visible by default, ans was set visible thanks
to attrs and other fields values.

opw-629394
2015-03-04 17:56:05 +01:00
Christophe Simonis 128de187a3 [FIX] web: KanbanSelection and Priority widgets
Use directly datarecord id instead of previously stored value which may
not be up to date.
2015-02-27 17:18:06 +01:00
Denis Ledoux 25bf2674d5 [FIX] web: prevent set value of priority if readonly
The priority widget did not handle the readonly concept
It was therefore possible to set the priority of
an issue (for instance) even if the field was marked
as readonly.

opw-628960
2015-02-26 17:21:10 +01:00
Martin Trigaux e2fa66b05d [FIX] web: avoid incoherent actual_mode after refresh
When accessing an existing record in form mode directly (enter the url or refresh a page), the daterecord has not been initialized yet. This means that the value of actual_mode will be set to 'edit' before loading the current record (method _actualize_mode() called from do_show()).
This was problematic for one2many fields that we loaded in edit mode, showing add/delete icons/buttons in readonly views. (opw 607910)

Backport of 7ec7f1ba40 for 7.0 and saas<6. (opw 627885)
2015-02-26 13:55:48 +01:00
David Monjoie 1581c43026 [FIX] web: revoke last_search when the user made his choice
Without this, if the user creates a second line (or more) with another search query and presses tab (or clicks somewhere else) quickly, it will take the previous search result instead of the new one because the new one did not occur yet.
With this fix, if the search did not have time to process, the Create a product modal appears, just like it already did for the same behavior on the first line.
Fixes 620679.
2015-02-18 13:52:36 +01:00
Raphael Collet 2067a206ec [FIX] models: process onchange methods on new records in the order of the view
The onchange() on new records processes fields in non-predictable order.  This
is problematic when onchange methods are designed to be applied after each
other.  The expected order is presumed to be the one of the fields in the view.

In order to implement this behavior, the JS client invokes method onchange()
with the list of fields (in view order) instead of False.  The server then uses
that order for evaluating the onchange methods.

This fixes #4897.
2015-02-10 13:12:40 +01:00
Denis Ledoux 534d4e3e07 [MERGE] forward port of branch saas-3 up to a8fdc60 2015-02-09 17:58:28 +01:00
Denis Ledoux a8fdc60b88 [MERGE] forward port of branch 7.0 up to 1d76586 2015-02-09 17:57:39 +01:00
Denis Ledoux 1d76586a1b [FIX] web: context lang & active* in action buttons
This reverts rev. 9f9e7ef0e1

As explained in 9f9e7ef0e1,
if a field "lang" is present in the view, clicking in any action item
in the more menu leaded for the action title to be translated
in the lang value of the form, such as in the partner form.

9f9e7ef0e1 fixed the issue,
but has as side-effect to not update correctly the active* keys.
So, if "active_id" was used in the context of the action button,
and the active_id was set in the dataset context, for example
because you come from another form, trough another action button
(For instance, Customers > Opportunities > Logged Calls),
the active_id was not updated with the current id of the record.

opw-620293
opw-617321
fixes #3462
2015-02-09 17:53:11 +01:00
Olivier Dony 801a8b8fa9 [MERGE] Forward-port latest saas-3 bugfixes, up to c9b690f6b6 2015-01-29 13:54:13 +01:00
Olivier Dony c9b690f6b6 [MERGE] Forward-port latest 7.0 bugfixes, up to 4c2706d685 2015-01-29 13:50:51 +01:00
Denis Ledoux 4c2706d685 [FIX] web: saveas_ajax, correct filename when data passed directly
In cases where data is directly given to the saveas_ajax controller,
the filename was not correctly set, as no read method was performed.
(The read call is useless as the data is already avaiable in such a case)
In such cases, the filename must be given in advance

opw-626707
2015-01-29 12:51:47 +01:00
Martin Trigaux 4f14290670 [FIX] web: rounding of fields
round_precision expects a decimal (e.g. 0.01) while digits contains the number
of digits (e.g. 2)
replace by round_decimals
2015-01-21 16:04:29 +01:00
Adrien Peiffer 37e85a1e35 [FIX] view form: Use digits to round float values on client side 2015-01-21 10:38:32 +01:00
Denis Ledoux 87dd06c941 [MERGE] forward port of branch saas-3 up to 8c150c6 2015-01-15 14:43:32 +01:00
Denis Ledoux a692c6e934 [MERGE] forward port of branch 7.0 up to f406847 2015-01-15 11:49:28 +01:00
Denis Ledoux 275367581b [FIX] web: view is not always defined when a many2one is rendered
This rev. is associated with rev. 38aa984f31

closes #4660
2015-01-13 12:45:47 +01:00
Denis Ledoux 38aa984f31 [FIX] web: avoid rendering fields on one2many list validation
This rev. reverts 91911159f5

The above rev. was a good idea, except that internal_set_value expects the raw value, while the records attributes can be tuples(for instance, many2one are tuple(id, name) or list of command(one2many, many2many).

set_value must be use here, as all fields (js) override set_value in order to handle their value repr (for instance, many2one fields handle the tuple (id,name).

Besides, avoiding the re-render provides a huge performance improvment, as rerendering fields can lead to xmlrpc calls (for instance, re-rendering a many2one field implies calling the name_get method)

opw-620111
opw-622108
2015-01-09 18:10:38 +01:00
Denis Ledoux 4c1908088c [MERGE] forward port of branch saas-3 up to 879fca0 2015-01-06 19:00:08 +01:00
Denis Ledoux 879fca0856 [MERGE] forward port of branch 7.0 up to 9191115 2015-01-06 18:56:10 +01:00
Denis Ledoux 91911159f5 [FIX] web: editable list, no re-rendering on field validation
When adding several lines in an editable list (adding 7 lines to an invoice for instance), then clicking on the first row direcly after having filled the last line, the value of the cell sometimes had the value of the last line. Just a display bug, but still.

Using internal_set_value avoid the re-rendering of the cell, and solve the above issue

opw-620111
2015-01-06 18:53:33 +01:00
Aaron Bohy 3505dcce70 [FIX] web: view_form.js: radio buttons bug fix
Clicking on a checked radio button doesn't uncheck it anymore
2014-12-24 15:37:50 +01:00