Commit Graph

1782 Commits

Author SHA1 Message Date
Denis Ledoux 4a3e5df93a [FIX] web: autocomplete selection not hidden
Appending the autocomplete selection too close from the input field leads to display (hidden) problem in some cases (Many2one inside modals views, many2one at the end of a form view, etc.)

This is related to rev. e1cde4d038

closes #4268
2014-12-16 13:21:07 +01:00
Denis Ledoux a6212d2d20 [MERGE] forward port of branch saas-3 up to e11d1c2 2014-12-11 14:11:33 +01:00
Denis Ledoux e11d1c2b7a [MERGE] forward port of branch 7.0 up to db98434 2014-12-11 12:15:09 +01:00
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 9f9e7ef0e1 [FIX] web: user lang has the priority on partner lang
Potentialy, the timezone too.

On item action click (such as menus in More.. and Print..), the data in form view had the priority on user context (through the sidebar_eval_context)

Therefore, if a field "lang" was present in the form view (like in partner form), the web/action/load xmlrpc call was using the partner language instead of the user language.

Example of wrong use case before the fix:
 - Set the user language in French, then go to a partner form of a partner with English set as language
  - Click on any button of the partner form, such as the "Invoices" button, notice that the last item of the breadcrumb is in English, instead of Frenh (the user language)
  - Click on any menu opening a wizard in the More.. dropdown menu, notice that the wizard title is in English instead of French
  - Print any report from the Print dropdown menu, notice that the report file name is in English. If you print the same report for the same partner but from the list view, the report file name is in French.
2014-12-09 12:52:20 +01:00
Denis Ledoux eba1c56f97 [FIX] web: ensure one2many field destruction on button cancel
The destruction of one2many fields is forced with the event change:effective_readonly
This revision add the forced destruction for cancel(discard) button as well

Otherwise, one2many fields are not properly destroyed when hitting the button "discard" (from save or discard).
This can be problematic for one2many editable list views (such as invoice lines) if you discard while having a mandatory field not filled in the invoice line: You can't recreate an invoice, the one2many editable list is messed up

Use case: Create an invoice, create a line, leave the description, required field, empty. Then, discard. Then, click on create.

opw-616946
2014-12-08 15:42:24 +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
Christophe Simonis ddef2dd10a [MERGE] forward port of branch saas-3 up to 8f13e83 2014-08-20 17:51:20 +02:00
fka-odoo 9247c37de7 [FIX] web: 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).
Replaced by auto, the default value adviced by CLEditor.
2014-08-19 11:55:53 +02:00
Thibault Delavallée 6389181e8f [FIX] web: CharDomain form widget: fixed change selection
button not correctly displayed depending on the effective_readonly
parameter. It is now correctly computed.

Also added a link to see records when in view mode, instead of not
being able to see the selection if not in edit mode.
2014-08-14 13:10:26 +02:00
Denis Ledoux ae65be2b2a [MERGE] forward port of branch saas-5 up to 0739bc4 2014-08-11 15:58:02 +02:00
Denis Ledoux 0739bc4eda [MERGE] forward port of branch saas-4 up to 7ecaab9 2014-08-11 15:31:04 +02:00
Denis Ledoux 7ecaab9fe2 [MERGE] forward port of branch saas-3 up to 2f4be42 2014-08-11 15:30:37 +02:00
Denis Ledoux 2f4be42d8c [MERGE] forward port of branch 7.0 up to 3632949 2014-08-11 15:28:54 +02:00
Denis Ledoux 3632949cff [FIX] web: image fields re-render on next/previous
By default, on binary images read, the server returns the binary size
This is possible that two images have the exact same size
Therefore we trigger the change in case the image value hasn't changed
So the image is re-rendered correctly
2014-08-11 14:39:50 +02:00
Thibault Delavallée 765beaa0c9 [FIX] web: form view: priority and kanban widgets cleaning, now more like classic form widgets (edit mode: use set_value, view mode: perform a write) 2014-08-11 10:44:21 +02:00
Olivier Dony 494ecc620f [MERGE] Foward-port saas-5 up to ee4df1e 2014-08-01 14:24:07 +02:00
Cedric Snauwaert 5ddc0305cd [FIX] web: fix tooltip that were stuck visible
tooltip stuck visible should be removed on click + remove tooltip container except for modal in order to prevent them for staying visible in some rare occasion
2014-07-31 17:33:27 +02:00
Olivier Dony bcd9456db5 [REVERT] 8b41906: disabled all on_change on new record form
This reverts commit 8b41906bf8.
2014-07-25 12:45:21 +02:00
Martin Trigaux 8b41906bf8 [FIX] web: avoid trying to access to deleted record message when change password
The onchange call can be made with empty ids list (which would fail). opw 610810
2014-07-24 12:12:33 +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
Simon Lejeune 239144d519 [FIX] view_form: use the reference of menu from the instance, not from the widget ancestors
Fixes #1024: when using a formview on a non trivial way, the reference of the menu using the widget ancestors may be wrong
2014-07-11 11:51:54 +02:00
Raphael Collet cbe2dbb672 [MERGE] new v8 api by rco
A squashed merge is required as the conversion of the apiculture branch from
bzr to git was not correctly done. The git history contains irrelevant blobs
and commits. This branch brings a lot of changes and fixes, too many to list
exhaustively.

- New orm api, objects are now used instead of ids
- Environements to encapsulates cr uid context while maintaining backward compatibility
- Field compute attribute is a new object oriented way to define function fields
- Shared browse record cache
- New onchange protocol
- Optional copy flag on fields
- Documentation update
- Dead code cleanup
- Lots of fixes
2014-07-06 17:05:41 +02:00
Christophe Simonis 1f57528bc6 [MERGE] forward port of branch saas-5 up to 8dfd5ea 2014-06-27 16:14:40 +02:00
Martin Trigaux 95cff0ba34 [FIX] view_form: backport of commit 180212b999 (opw 609787) 2014-06-27 15:43:11 +02:00
Cédric Snauwaert f909ae9170 Merge pull request #784 from odoo-dev/saas-5-tooltip-fix-csn
[FIX]tooltip: fix various display problems with the tooltip
2014-06-26 13:56:12 +02:00
Cedric Snauwaert 3781167f9b [FIX]tooltip: fix various display problems with the tooltip 2014-06-26 11:19:37 +02:00
tfossoul 45a120d030 [FIX] KanbanSelection: Reload the record_id on form view
When you are on a form view, you click on a left/right arrow(on the top-right of the view) to pass to the next records. If you click on the widget to change the kanban_state, the widget will change the state of the previous record and not for the current because the record_id is not reset
2014-06-26 09:55:26 +02:00
Christophe Simonis e862ff7033 [MERGE] forward port of branch saas-5 up to 4cb5381
Conflicts:
	openerp/addons/base/module/wizard/base_module_upgrade_view.xml
2014-06-22 15:36:10 +02:00
Christophe Simonis 4cb5381dee [MERGE] forward port of branch saas-4 up to 1f20f61 2014-06-22 15:33:22 +02:00
Christophe Simonis 1f20f61ab4 [MERGE] forward port of branch saas-3 up to 75884c3 2014-06-22 15:30:57 +02:00
Christophe Simonis 75884c3e1a [MERGE] forward port of branch 7.0 up to 7e85786 2014-06-22 13:44:30 +02:00
Jacques-Etienne Baudoux 7e85786b83 web: do not select the first result if click on search more
When searching for a record in a m2o field, if we click on 'search more' we loose the focus on the field and select the first suggestion (which triggers potential on_change). This prevents the selection for this case.
2014-06-20 17:41:09 +02:00
Martin Trigaux bccd75796e [IMP] web: allow fields in list view to use the attrs readonly to dynamically show and hide the fields 2014-06-20 14:11:21 +02:00
Mehul Mehta a6b9413a78 [ADD] Add a icon for remove pictures from product and partner 2014-06-20 12:52:24 +02:00
Christophe Simonis eef6330c55 [MERGE] forward port of branch saas-5 up to adf07a9 2014-06-19 16:23:32 +02:00
Christophe Simonis adf07a9490 [MERGE] forward port of branch saas-4 up to 5087612 2014-06-19 16:13:35 +02:00
Christophe Simonis 5087612d1d [MERGE] forward port of branch saas-3 up to bf53aed 2014-06-19 15:44:07 +02:00
Christophe Simonis bf53aeda94 [MERGE] forward port of branch 7.0 up to e5533d0 2014-06-19 15:32:32 +02:00
Denis Ledoux a32e989fba [FIX] web: save date(time) field value on key enter in editable list
In editable list, on keypress enter, the _next method is called, saving the current line and starting the edition of the next one
The _next is triggered before the date(time) field change event, and, therefore, the saved value of the date(time) field is the old one
2014-06-17 12:56:13 +02:00
ged-odoo 74168c4e9d Merge pull request #272 from odoo-dev/master-inline-searchview-ged
[MERGP] Inline Searchview

This task split the searchview in two parts: SearchView and SearchViewDrawer. The drawer is displayed inside the main view and the searchview stays in place.  It also changes the scrolling behavior of the web client: the main view area can scroll without affecting the UI (so the various menus stays in place)

Because of this, other large changes have been made:

the drawer has been redesigned,
the Custom Filter widget has been split in two (Custom Report and SaveCurrentFilter),
the main view is now scrollable, so the UI stays in place and only the view can change
The text 'Group By...' has been changed into 'Group By' (most addons had to be modified)
bootstrap classes are used when it makes sense (for example, badge)
the left menu is also scrollable (separately from the main view)

It is likely that some stupid bugs have been introduced.  Please don't hurt me.
2014-06-12 16:27:11 +02:00
Fabien Meghazi ba3ce4753b Set form views default @version="7.0" 2014-06-11 14:03:20 +02:00
Géry Debongnie af58bc5914 Merge remote-tracking branch 'odoo/master' into master-inline-searchview-ged 2014-06-11 10:10:58 +02:00
Thibault Delavallée 43f9b18183 [FIX] web: form_view: fixed event variable name in chardomain widget (hidden in chrome but make the widget crash in firefox) 2014-06-11 08:56:42 +02:00
Christophe Simonis a7c2125735 [MERGE] forward port of branch saas-4 up to 6b8e972 2014-06-10 13:15:46 +02:00
Christophe Simonis 6b8e9727e5 [MERGE] forward port of branch saas-3 up to 4601d85 2014-06-10 12:29:47 +02:00
Christophe Simonis 4601d85944 [MERGE] forward port of branch 7.0 up to 6fdb783 2014-06-10 11:49:14 +02:00
Christophe Simonis ab9ac783db [FIX] web: many2many field handle "no_create" option 2014-06-05 13:46:53 +02:00
Géry Debongnie 5cc8f9ca42 Merge remote-tracking branch 'odoo/master' into master-inline-searchview-ged 2014-05-28 10:37:16 +02:00
Olivier Dony 04211015fc [MERGE] Forward-port of latest saas-4 fixes, up to 0452851 2014-05-27 20:49:49 +02:00
Olivier Dony fd21abd847 [MERGE] Forward-port latest saas-3 bugfixes, up to 30f43da 2014-05-27 17:18:43 +02:00