Commit Graph

1416 Commits

Author SHA1 Message Date
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
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
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 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
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 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 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 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 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 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 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
Denis Ledoux 98c6e7c3d5 [FIX] web: cherry-pick of 893e426865 & 61207f3f4d 2014-10-15 09:43:26 +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
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
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
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
Martin Trigaux 95cff0ba34 [FIX] view_form: backport of commit 180212b999 (opw 609787) 2014-06-27 15:43:11 +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
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
Christophe Simonis ab9ac783db [FIX] web: many2many field handle "no_create" option 2014-06-05 13:46:53 +02:00
Mohammed Shekha 26cb208903 [FIX]Refixed the issue of o2m record duplication 2014-05-27 19:35:09 +05:30
Mohammed Shekha 477fa85e55 [FIX]Fixe the issue o2m record duplication. 2014-05-27 10:10:06 +05:30
Martin Trigaux fa4e285be7 [FIX] FieldMany2One: avoid error when saving changes in popup from a related fields (opw 606601)
bzr revid: mat@openerp.com-20140418092033-mvqng3thuy61kfoq
2014-04-18 11:20:33 +02:00
Denis Ledoux 7c668d8eac [FIX] web: double click on save button was trying to save the data two times if there is some latency, event target should be used instead of delegate target
bzr revid: dle@openerp.com-20140417101217-3fwnm76qne6f1vwk
2014-04-17 12:12:17 +02:00
Denis Ledoux f928ba4f10 [FIX] web: double click on save button was trying to save the data two times if there is some latency
bzr revid: dle@openerp.com-20140417101000-6gtyxntkm5d7zcoy
2014-04-17 12:10:00 +02:00
Mohammed Shekha 91930b470d [FIX]Fixed the issue of reference field throws traceback that view is undefined, the reason is that reference field passing DefaultFieldManager while creating instance of many2one widget and DefaultFieldManager is eventually extending instance.web.widget not instance.web.form.FormWidget and hence DefaultFieldmanager will nto having view attribute, instead of calling self.view.do_onchange, trigger changed_value which is going to do the same job.
bzr revid: msh@tinyerp.com-20140416083857-sug0k4a28nkvgg27
2014-04-16 14:08:57 +05:30
Mohammed Shekha f9d143c216 [FIX]Fixed the issue of duplicated one2many lines, weired behavior when you add one2many line and then add another line withour filling required field and then click on save, then remove added one2many line for which we didn't filled required data and then save it, you will get duplicated lines.
bzr revid: msh@tinyerp.com-20140403070844-6ogpdursukue2zoh
2014-04-03 12:38:44 +05:30
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
Denis Ledoux 162ad1c0f1 [FIX] web: on record reload (form & list view), use search_read instead of read, to check if the user can still read the record (security rules)
bzr revid: dle@openerp.com-20140326113036-g9yv3jj6yetwxvg8
2014-03-26 12:30:36 +01:00
Martin Trigaux 53922c9593 [FIX] pager: revert of revision 4159, the pager was disapearing when going in editable mode (which is more problematic that the issue rev 4159 was trying to fix)
bzr revid: mat@openerp.com-20140314132854-8ie8sosx9xecuww4
2014-03-14 14:28:54 +01:00
Martin Trigaux 08e07af590 [FIX] pager: do not try to toggle the visibility if the pager do not exists yet
bzr revid: mat@openerp.com-20140314112709-0sqq6tcpmza34q1e
2014-03-14 12:27:09 +01:00
Martin Trigaux 71d8f8f1c4 [FIX] pager: show the pagger earlier to avoid slow loading to mix list and form pagers when fast switching
bzr revid: mat@openerp.com-20140313123811-ej7lu53xp51kn6gu
2014-03-13 13:38:11 +01:00
Xavier ALT c033e5a535 [FIX] web: on SearchPopup creation concat build context even if we have initial_ids
On SearchPopupCreation, if we have initial_ids - 1st search_read() will be
  missing custom context defined on the field.

  1. defined view like this: <field name='my_many2one_field_id' context="{'test': 1}"/>
  2. in we expand the list of available item, name_search() has 'test' in context
  3. in we click on 'Search More', search_read() is missing 'test' in context
  4. if we change filter add/remove item, search_read() will have 'test' in context

  Step 3. is wrong, should also have 'test' in context

lp bug: https://launchpad.net/bugs/1209295 fixed

bzr revid: mat@openerp.com-20140311091522-03imwd5rj3rmwapl
2014-03-11 10:15:22 +01:00
Martin Trigaux 618c8b9100 [FIX] quick create: do not add the id in the form if the form is readonly (eg: clicking on save button will make the form uneditable)
bzr revid: mat@openerp.com-20140307141257-rvusvzm6oq3tel51
2014-03-07 15:12:57 +01:00
Mohammed Shekha (OpenERP) a8943b416a [FIX]Web, Statusbar: Fixed the issue of statubar in chrome is aligned, it is aligned in inline block.
bzr revid: msh@openerp.com-20140213115556-irdodahpw0atgy5u
2014-02-13 17:25:56 +05:30
Martin Trigaux b75c52f3ed [IMP] reference fields: display a more user-friendly window title when open a chosen many2one record in reference field
bzr revid: mat@openerp.com-20140206102409-4lbx7ofsgz8speni
2014-02-06 11:24:09 +01:00
Martin Trigaux 263693e44e [FIX] search: add delay of 250us (was 0) on autocomplete fields in search bar and m2o fields.
This avoids making a search request for each keypressed

bzr revid: mat@openerp.com-20140120160147-q7lg4j93c836ec44
2014-01-20 17:01:47 +01:00
Denis Ledoux 6109102e91 [FIX] web: view_form.js, allow press enter to break line in fieldtextwidget
bzr revid: dle@openerp.com-20140115120844-1z0pbh9pc63tllce
2014-01-15 13:08:44 +01:00
Martin Trigaux 3f4c637674 [IMP] view_form: do not display hugly error message when name_get returns no value but more helpful message (eg: bad default value returns wrong id)
bzr revid: mat@openerp.com-20140114145720-r3lg0qjezqj4p3i1
2014-01-14 15:57:20 +01:00
Xavier Morel 1b76c66930 [MERGE] fixes for non-direct IME
bzr revid: xmo@openerp.com-20131218152626-kexq1wudvjwnh962
2013-12-18 16:26:26 +01:00
Martin Trigaux ad7951214c [MERGE] [FIX] One2ManyListView: reload line data without saving it when m2o record has changed in edition mode (eg: changing product name in sale order line) (opw #600224)
bzr revid: mat@openerp.com-20131211105009-iylczcepd3a0e61l
2013-12-11 11:50:09 +01:00
Michel Meyer 68aac8e855 [FIX] events handling ordering courtesy of Michel Meyer
lead to errors during the validation of rows in list o2ms.

See https://bugs.launchpad.net/openerp-web/+bug/1182101/comments/20
for an extensive description of the events and issue.

bzr revid: xmo@openerp.com-20131209153519-n05bdx15t75dh7gf
2013-12-09 16:35:19 +01:00
Xavier Morel b4c121db71 [FIX] bad interaction of editable list with IME
IME are ways to input language which can't trivially map to a keyboard
(e.g. CJK language) with a standard-ish keyboard. For japanese IME
this is done by entering text phonetically: text is entered in romaji
and automatically converted to hiragana (or katakana) when it matches
the transcription a japanese syllable (~phoneme?) e.g. to (と). The
text is then split and reprocessed with sequences of hiragana being
converted to kanji (or not), and the possibility to pick the right
kanji when multiple kanji match e.g. for "Tokyo" toukyou -> とうきょう
-> 東京.

But to do the edition, keyboard keys are used. For the japanese IMEs
(tested on Windows, OSX and Linux) [Space] will do the initial
conversion from kana to kanji (and allow selecting an other conversion
or a different kana split) and [Return] will validate the current
conversion (removing the underline marking "unvalidated" kana or kanji
groups).

And that's where the problem hit: IME + browser combinations may or
may not suppress part of all of the event. Firefox will trigger a
keydown of the key which "starts" IME input (e.g. "t") and will
trigger a keyup for the validation key (return), except on Linux where
the initial keydown is suppressed. Inbetween these, it will fire no
keydown, keyup or keypress event but will fire input events (at least
on an input element) every time the displayed text changes.

Meanwhile webkit browsers will, for each press on the keyboard during
IME,

* trigger a keydown with the keyCode 229
* trigger a keyup event with the keycode of the key which was actually
  hit
* trigger input events every time the displayed text changes

This include meta-operation uses of [Space] and [Return].

MSIE has the same behavior (including triggering the input event), but
the keydown event is augmented with ``key`` and ``char`` attributes
providing the character matching the key hit to trigger the change.

Although the triggering of the input even is useless for the purpose
of the editable list (especially here, the purpose of validating a
list row with [Return] one fact stands out: keypress is never
triggered during IME operations, hitting the [Return] key outside of
IME will trigger keydow, keypress, keyup but doing so during IME will
only trigger the first and last.

Thus by changing the binding from keyup (return) to keypress (return)
for a line validation, spurious validation during IME text entry
should be avoided. This seems to work correctly on MSIE (Windows),
Firefox (Windows, OSX, Linux), Chrome (Windows, OSX, Linux) and Safari
(OSX), after testing in IE9, IE10, Chrome 31, Firefox 25 and Safari 7,
and a quick test on a task's o2m did not reveal any regression.

note: not all differences between various browser/os combinations were
inspected in details, there may well be further differences which were
not noticed or not relevant to this precise issue.

bzr revid: xmo@openerp.com-20131206124431-q4a9l1gn9wjtmlvz
2013-12-06 13:44:31 +01:00
Mohammed Shekha (OpenERP) b3391cd7fe [FIX]Web: Fixed the issue of immediate update of many2one field when many2one object name has been changed from follow button popup, reloaded the record from database forcefull to update dataaset, do not call form-blur when follow button is clicked, also do not evict record when record is still not created.
bzr revid: msh@openerp.com-20131203123856-gce4li1igo9k1mak
2013-12-03 18:08:56 +05:30
Christophe Simonis 8721307dae [IMP] web: avoid double reload() when clicking on a button on a editable form view.
bzr revid: chs@openerp.com-20131120185337-w8857fmwosa36r4d
2013-11-20 19:53:37 +01:00
Martin Trigaux 8c3cdce539 [MERGE] view form: reduce the number of result in 'search more' view opening to 160 records (performances improvement, not filtering every possible record) (opw 593963)
bzr revid: mat@openerp.com-20131113082806-me6uy7cjj6holn56
2013-11-13 09:28:06 +01:00