Commit Graph

1727 Commits

Author SHA1 Message Date
Denis Ledoux e1cde4d038 [FIX] web: 558efacead not working for modals.
The above revision, which was already a patch for rev. a8f94a59cd, did not work properly for modals, like the use template many2one field of the mail.compose.message wizard.

We therefore append the ui-menu selection nearer to the input field.

$el.parent().parent() looks odd, but the goal is to append this selection ui just after the parent of the field, but as jquery ui autocomplete only accepts appendTo (and not after()), we append it to the parent of the field parent.

This fix has been verified for
 * many2one fields in classic form view (with or without sheets)
 * many2one fields in editable list view (embedded in form view or not-
 * many2one fields in wizard modals
 * many2one fields of the bank statement reconciliation widget
2014-12-10 21:45:28 +01:00
Denis Ledoux 558efacead [FIX] web: retro compatible patch for a8f94a59cd
Some views are not appended to the element oe_view_manager_body, such as client actions views.
For these cases, we append the element to the view manager element

Besides, we set the appendTo option of jquery ui autocomplete after a first initialization, because of a Jquery ui bug:
http://bugs.jqueryui.com/ticket/8858
2014-12-10 16:10:00 +01:00
Denis Ledoux a8f94a59cd [FIX] web: scroll handling for many2one selection
If the many2one selection height was too big (bigger than the browser page), it wasn't possible to see all options, because the body is set as overflow: hidden;

Moreover, if you opened a many2one selection and then scrolled the page, the selection moved with the scrolling, while it should be sticked to its input field
2014-12-09 14:41:26 +01:00
Denis Ledoux 9996668bad [FIX] web: get conditional user defaults
This is possible to set field conditional defaults, if the field has the attribute "change_default".
The defaults are set by the web client, by calling the method "get_defaults" of ir.values model, when the onchange is triggered on the field on which the condition is.

In 7.0, all onchanges were triggered clientside, one by one. On creation, the defaults of default_get method were pushed in the form, and then, as the values of the fields were changed (from null to the default value), all onchanges on which there was default value were triggered.

In 8.0, onchanges are performed server side, all at once. On creation, the onchange method is triggered by default (wether or not there is a default value for them), for all fields (widget param of method do_onchange of view_forms js is undefined, meaning the onchange is not triggered on a specific field, but on all fields). In such a case, we must call the get_defaults method of ir.values model for all fields (having change_default attribute), in order the conditional defaults to be set in the form view.
2014-12-05 17:41:11 +01:00
Denis Ledoux 45551cf78c [FIX] web: use mutex to wait for onchanges
This fix is related to c12a2e1d16

Mutex allow to wait sequentially for mutex
Besides, if one of the onchanges deferreds fails, it does not resolve the mutex until all deferreds of the mutex are resolved.

Besides, we now wait for the onchanges mutex between each field commited value (line 596) in case the commited value leaded to a new onchanges, that we should wait for before commiting the rest of the values.
2014-11-28 13:39:47 +01:00
Denis Ledoux d9e48bae42 [MERGE] forward port of branch saas-3 up to 7ab4137 2014-11-14 16:58:24 +01:00
Denis Ledoux 7ab413724a [MERGE] forward port of branch 7.0 up to da15c9d 2014-11-14 15:59:33 +01:00
Denis Ledoux da15c9d27b [FIX] web: do not set the one2many dirty on field validation
This rev. 06104ba553

Added the dirty flag on the o2m field when the editor of the editable list was enabled (meaning that the editable list has been altered)) because the dirty flag was not set correctly by the one2many during the edition, at the time.

It looks like this is now the case

Besides, as now, we valid all the editable list of the form, wether or not the editable list was altered, we must not set the o2m as dirty anymore.
2014-11-14 15:52:58 +01:00
Denis Ledoux 2da7b11c36 [MERGE] forward port of branch saas-3 up to c8df9fc 2014-11-06 16:30:33 +01:00
Denis Ledoux c8df9fcc7d [MERGE] forward port of branch 7.0 up to ae99a93 2014-11-06 16:30:00 +01:00
Denis Ledoux ae99a93b88 [FIX] web: many2many_binary widget upload
once widget extended with ReinitializeFieldMixin, the event binding with the binary file input and the on_file_change method can be done in initialize_content instead of start

This fix is related to d36c8b5c9b
2014-11-06 16:26:32 +01:00
Denis Ledoux b7c912ec68 [MERGE] forward port of branch saas-3 up to 22f2728 2014-11-06 15:03:43 +01:00
Denis Ledoux 22f2728d22 [MERGE] forward port of branch 7.0 up to d36c8b5 2014-11-06 14:56:45 +01:00
Denis Ledoux d36c8b5c9b [FIX] web: FieldMany2ManyBinaryMultiFiles must extend ReinitializeFieldMixin
The add attachment button should be displayed while being in edit mode, but not in view mode
As the widget depends on the form actual mode, the widget should be re-rendered each time the actual mode changes

This is the point of the ReinitializeFieldMixin class
2014-11-06 14:51:21 +01:00
Denis Ledoux 89716cb4d6 [MERGE] forward port of branch saas-3 up to c666030 2014-11-05 13:40:30 +01:00
Denis Ledoux c666030539 [MERGE] forward port of branch 7.0 up to cd69dee 2014-11-05 13:39:41 +01:00
Denis Ledoux cd69dee3f2 [FIX] web: inhibit on change flag when validating editable list
To valid all editable list line, we iterate on the lines and set the editor form with the line value, using set_value.
The _inhibit_on_change_flag should be set to True to avoid triggering on changes events

opw-617395
2014-11-05 13:38:49 +01:00
Denis Ledoux 7582f91e1b [MERGE] forward port of branch saas-3 up to c11451c 2014-11-05 10:29:51 +01:00
Denis Ledoux c11451c7e8 [MERGE] forward port of branch 7.0 up to 9a37e5a 2014-11-05 10:29:27 +01:00
Denis Ledoux 9a37e5a59a [FIX] web: regard the view_list has valid if not yet loaded
This fix is related to df845940ed

Fixes #3469
2014-11-05 10:28:57 +01:00
Denis Ledoux f7723037d6 [MERGE] forward port of branch saas-3 up to 8c4a7cb 2014-11-04 12:30:01 +01:00
Denis Ledoux 8c4a7cb371 [MERGE] forward port of branch 7.0 up to 5035c76 2014-11-04 12:19:58 +01:00
Denis Ledoux df845940ed [FIX] web: on editable list save, valid all records
opw-617036:
In my current timesheet, if you add a a required field on the timesheet ids lines, and add data in the summary tab, it was possible to validate the timesheet lines while requried fields were missing.
2014-10-31 17:40:56 +01:00
Martin Trigaux 7ec7f1ba40 [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)
2014-10-24 15:36:58 +02:00
Denis Ledoux 6feb5f70e9 [MERGE] forward port of branch 7.0 up to 98c6e7c 2014-10-15 09:44:31 +02:00
Denis Ledoux 98c6e7c3d5 [FIX] web: cherry-pick of 893e426865 & 61207f3f4d 2014-10-15 09:43:26 +02:00
Denis Ledoux 893e426865 [FIX] web: even if there is no view, the field has to be rendered
This is related to ÿ07f3f4d9206d4c1a3e484eb89f09d2258977a
2014-10-14 16:59:13 +02:00
Denis Ledoux 61207f3f4d [FIX] web: push render value deferred only if the field is in a form view 2014-10-14 16:28:47 +02:00
Christophe Simonis 2e3f59181d [MERGE] forward port of branch saas-3 up to db75994 2014-10-14 15:13:14 +02:00
Christophe Simonis db759948ff [MERGE] forward port of branch 7.0 up to 75d3ea6 2014-10-14 14:36:45 +02:00
Denis Ledoux 5e1a5b7dbc [FIX] web: wait for deferreds when actualizing mode
In edit mode, in a *2many with many2many_tags, when adding a new tag when none was set, discarding the form let the new tags displayed while it shouldn't (only a display issue, the tag wasn't added in database)

Fixes #2926
2014-10-13 18:24:57 +02:00
Xavier Morel 9cd2693286 [FIX] JS tutorial 2014-10-07 10:23:50 +02:00
Denis Ledoux 7aa5d397c8 [Revert] cb30783aba & 6349048ba0
[FIX] web: avoid force_reload in list editable
[FIX] web: force load record after reload page

These fixes prevent to open existing record form
2014-10-03 14:03:12 +02:00
Martin Trigaux cb30783aba [FIX] web: avoid force_reload in list editable
When creating a new record in list editable, due to previous commit 6349048, the load_record was called twice and the first record of the current list view (self.dataset.index) was used to fill the new record.
With this, we make sure a new record is indeed created.
Fix the web test to have a default_get call in mock models and increase the number of default_get assertions (for creations in list editable, the default_get is then called twice, not optimal but due to the absence of distinction between empty datarecord and filled with default values).
2014-10-03 11:41:00 +02:00
Martin Trigaux 6349048ba0 [FIX] web: force load record after reload page
When reloading a page, the _actualize_mode is called before the record is loaded and the form is displayed partially in edit mode (o2m fields with delete/add icons).
This patch forces to trigger a load_record when the datarecord has not been loaded yet in the do_show merthod (opw 607910)
2014-10-03 09:29:22 +02:00
Christophe Simonis e2e60bf4eb [MERGE] forward port of branch saas-3 up to fe8106f 2014-09-26 12:53:59 +02:00
Denis Ledoux c57ca80a5b [MERGE] forward port of branch 7.0 up to 9c77f79 2014-09-23 19:01:11 +02:00
Denis Ledoux 9c77f794b4 [FIX] widget html: rendering issue in mail composer on Firefox
The cleditor width does not include the margins. Setting 100% will make the editable area too large (104%) on Firefox (opw 611700).
This issue was already fixed in newer releases, from commit 9247c37de7
Nevertheless, it introduced a new issue: while editing the form, the content of widgets html which were located in hidden notebook pages weren't displayed when displaying the page content.
opw-614448
2014-09-23 18:53:17 +02:00
ptr 130873f0f6 [FIX] web: form: quick create: name is now required to avoid creating records with a void name 2014-09-19 11:55:54 +02:00
Denis Ledoux c12a2e1d16 [FIX] web: failing onchanges should not prevent to save
This patch is related to 82adba4714

With the above patch, it wasn't possible anymore to save if an onchange failed. This isn't the expected behavior.
Besides, $.when.apply($, defs) is rejected as soon as one def fails, without waiting other defs to be either resolved or rejected.

This new patch allows to save if onchange fails, and wait for onchanges sequentially.
2014-09-08 18:27:05 +02:00
Denis Ledoux 82adba4714 [FIX] web: wait onchanges to be processed before save 2014-09-04 17:22:04 +02:00
Martin Trigaux e95aeb659c Forward port of branch saas-5 up to 9a7f48a 2014-09-02 14:50:51 +02:00
Martin Trigaux 9a7f48a0e2 Forward port of branch saas-3 up to c3f5289 2014-09-02 13:59:55 +02:00
Denis Ledoux c3f52899dd [FIX] web: no_create, if loose focus do not open quick_create 2014-09-01 16:10:40 +02:00
Christophe Simonis 8046b7367d [MERGE] forward port of branch saas-5 up to 7e117b1 2014-08-28 16:51:11 +02:00
Christophe Simonis cf4cbd5d3b [MERGE] last forward port of branch saas-4 up to a65a95f 2014-08-28 15:23:14 +02:00
Cedric Snauwaert a65a95fbf7 [FIX] web: fix blur problem in FieldMany2One widget when clicking on autocomplete option inside a wizard 2014-08-26 11:26:28 +02:00
Christophe Matthieu b3aad9f511 [FIX] product: don't display 'create and edit' option on many2many_tag to create variant on product_template. The quick create is confusing for users 2014-08-22 14:20:14 +02:00
Christophe Simonis 5dff035878 [MERGE] forward port of branch saas-5 up to 39bee35 2014-08-20 20:33:17 +02:00
Christophe Simonis c3131317d7 [MERGE] forward port of branch saas-4 up to ddef2dd 2014-08-20 17:57:22 +02:00