Commit Graph

126 Commits

Author SHA1 Message Date
Raphael Collet 0304a1eada [MERGE] from trunk
bzr revid: jam@tinyerp.com-20120831045217-xoy25yc9ignfi94v
bzr revid: rco@openerp.com-20120831145305-4wf3sl8un59k61he
2012-08-31 16:53:05 +02:00
Antony Lesuisse b745a2038a [IMP] view_form remove used callback on do_save
bzr revid: al@openerp.com-20120829102300-0a1m4f237wbmqzv4
2012-08-29 12:23:00 +02:00
Jigar Amin - OpenERP 548672a2c3 merge lp:openerp-web
bzr revid: jam@tinyerp.com-20120827044256-engs2hibz5x5fnwh
2012-08-27 10:12:56 +05:30
niv-openerp 5e338c591a [IMP] made a whole-application replace of $element by $el
bzr revid: nicolas.vanhoren@openerp.com-20120824182707-vt91ef40ieeudwyw
2012-08-24 20:27:07 +02:00
Jigar Amin - OpenERP a02de882a2 [USA] Reomved the unxpected lines
bzr revid: jam@tinyerp.com-20120821071842-srbnqutwfia8m5cb
2012-08-21 12:48:42 +05:30
Jigar Amin - OpenERP 09f031cd99 [IMP] If edit = false and trww views Editable shoue not allow edit column instead redirect normal behaviour
bzr revid: jam@tinyerp.com-20120821071702-pknuv44poe1hvlfx
2012-08-21 12:47:02 +05:30
Fabien Pinckaers 3d48b3f877 [IMP] misc CSS improvements, mainly editable lists
bzr revid: fp@tinyerp.com-20120808193842-nxrk13vc8hv9wxlg
2012-08-08 21:38:42 +02:00
Xavier Morel 67518796c6 [ADD] editable flag on list views for fp
bzr revid: xmo@openerp.com-20120808104311-ajrne9fb9emtaoe6
2012-08-08 12:43:11 +02:00
Xavier Morel 741a1541da [FIX] action button on row being *created* in editable list view
Altered action button workflow:

* Action callback (passed to ``do_button_action``) now *takes* a
  record id instead of closing over it, in case the original list does
  not have an id to start with
* ``handle_button`` partially applies the id *it* got to the callback
  via ``_.bind``
* Editable list view override of ``do_button_action`` uses ``id`` it
  got from ``ensure_saved`` in case it got id=false in

bzr revid: xmo@openerp.com-20120807092317-wk0xyfzrhxc89t94
2012-08-07 11:23:17 +02:00
Xavier Morel d8e2bec158 [FIX] state of editor after cancelled cancel() (haha), handling of a record being edited during o2m deletion
bzr revid: xmo@openerp.com-20120806150002-45c8mjq9dk5hck7y
2012-08-06 17:00:02 +02:00
Fabien Meghazi 9c31ba65d9 [FIX] Fixed form's fields autofocus
bzr revid: fme@openerp.com-20120802124909-w4li8dt6y0kktnfh
2012-08-02 14:49:09 +02:00
Xavier Morel 84bf640e67 [IMP] when trying to focus the first visible field in the editable list view, ensure that we only stop when we actually manage to focus a field
bzr revid: xmo@openerp.com-20120802100020-kbmo1s5shjwaof69
2012-08-02 12:00:20 +02:00
Fabien Meghazi 1f1770ffb7 [IMP] Disable autofocus on editable lists
bzr revid: fme@openerp.com-20120802093917-3wc9qgek6e2mba5p
2012-08-02 11:39:17 +02:00
Antony Lesuisse 574f3891a5 [MERGE] trunk
bzr revid: al@openerp.com-20120801104657-cinfl0svpnc8njs5
2012-08-01 12:46:57 +02:00
Xavier Morel de1f6488a7 [CHG] there always is an editor in the editable listview, destroy just before creating the new one
bzr revid: xmo@openerp.com-20120726143320-4cdze45po1g581lu
2012-07-26 16:33:20 +02:00
Xavier Morel bf4c39cdf1 [FIX] arrow keys handling in editable listview field when field is not a text-based input
* Correctly handle HTMLInputElement#selectionStart throwing an error
  (checkbox and radio)

* Correctly handle elements without a selectionStart at all (select)

=> should ~always let the go-to-other-field behavior go through

bzr revid: xmo@openerp.com-20120726123819-74n1gl01p6befgkp
2012-07-26 14:38:19 +02:00
Xavier Morel 46a0370273 [IMP] avoid losing the exact value of tree/@editable when checking for editability status
bzr revid: xmo@openerp.com-20120724171419-czll83665nptk3n3
2012-07-24 19:14:19 +02:00
Xavier Morel 38cb3de518 [FIX] attempt to make editability handling more logical and simpler to manage.
Also less buggy, with a bit o' luck

bzr revid: xmo@openerp.com-20120724170550-150vimuk6bvzh8y8
2012-07-24 19:05:50 +02:00
Xavier Morel df05d2cd20 [ADD] focus previous/next field when using the left/right arrow while at the start/end of a field
bzr revid: xmo@openerp.com-20120724150112-r8liahdyaxmx49o8
2012-07-24 17:01:12 +02:00
Xavier Morel 35bb49701c [IMP] keep focus in the same column when navigating to the previous/next record with up/down arrows
bzr revid: xmo@openerp.com-20120724135655-hjk2l0mxvncker4q
2012-07-24 15:56:55 +02:00
Xavier Morel ac5dc58367 [IMP] focus the clicked field when starting a row edition by clicking on a cell
bzr revid: xmo@openerp.com-20120719095742-lps9xjsrvhn5fnlh
2012-07-19 11:57:42 +02:00
Xavier Morel 85a8641e2c [FIX] cancel edition when deleting a record, so we're not left with a phantom editor for the deleted record on top of an other row
bzr revid: xmo@openerp.com-20120718133115-8cn8wqf1ra8pjrnv
2012-07-18 15:31:15 +02:00
Xavier Morel 65ac59f42a [ADD] when tabbing from the last field in an edition row, go to next edition as if we'd hit [return]
extract common code for 'save current edition and move on to next edition' to a private method

bzr revid: xmo@openerp.com-20120718130751-g8htb78n54z1b9hv
2012-07-18 15:07:51 +02:00
Xavier Morel 0f054b57c1 [IMP] add ability to change row using up/down key while editing list
* Allow asserting state of record being edited (creating or modifying) through Editor#is_editing
* Improve setup_events to also dispatch keydown events

bzr revid: xmo@openerp.com-20120718124359-q0udajwbuhzpqjmi
2012-07-18 14:43:59 +02:00
Xavier Morel 71ede66dce [FIX] handling of @onwrite
extraction was broken: using _.bind/3 will partially apply the
function (first argument) on top of binding it to a context (second
argument), but the partial application will be from the *left* (which
is pretty much the only one making sense, short of kwargs).

handle_onwrite_record took its arguments the wrong way around: the
partially applied one was specified on the right and the "actually
applied" one was on the left, so it used the wrong argument and ended
up blowing up the rest of the code.

bzr revid: xmo@openerp.com-20120718101744-bbbshq60x2kqhob6
2012-07-18 12:17:44 +02:00
Xavier Morel 01e6e3ec07 [IMP] DOWNCASE ALL THE THINGS
apparently and contrary to what I remembered, we're still supposed to use underscore_separated method names, not camelCase

bzr revid: xmo@openerp.com-20120717132308-wvpldtprt33heee3
2012-07-17 15:23:08 +02:00
Xavier Morel 75c2845fb5 [ADD] default_get support on new row creation
bzr revid: xmo@openerp.com-20120716110430-9uv352m46d3mn1bx
2012-07-16 13:04:30 +02:00
Xavier Morel 16559cd6ae [ADD] discard 'link-ish' to editable list view
bzr revid: xmo@openerp.com-20120711142048-covvchmiscjlhji0
2012-07-11 16:20:48 +02:00
Xavier Morel cd02216c28 [FIX] selector for edit-on-click-on-empty-row
bzr revid: xmo@openerp.com-20120711122424-355c6ed4vnmrr69n
2012-07-11 14:24:24 +02:00
Xavier Morel 3efc9c033a [ADD] create new record when clicking on an empty row
bzr revid: xmo@openerp.com-20120711111027-6vtyoxx17fw8dmvc
2012-07-11 13:10:27 +02:00
Xavier Morel 52723ef052 [FIX] monkey around keyboard handling to ensure we don't cancel a cancelled edition or any other such thing.
maybe the form should be explicitly blurred when saved/cancelled?

bzr revid: xmo@openerp.com-20120710143323-fye927s9k455mqls
2012-07-10 16:33:23 +02:00
Xavier Morel 46da3547ca [IMP] move saving a row from per-row buttons to a single global button replacing [Create]
bzr revid: xmo@openerp.com-20120710143228-mqfuaxw894x9khkc
2012-07-10 16:32:28 +02:00
Xavier Morel 079e90afbb [ADD] successor method to list collections, to safely get the "next" record in a nested (groupby) context
bzr revid: xmo@openerp.com-20120710123718-kiot6zzji07a4iao
2012-07-10 14:37:18 +02:00
Xavier Morel 611fc6cc4f [FIX] handling of resize event during edition so form fields don't get all fubar
bzr revid: xmo@openerp.com-20120710103557-584hsyats0fdzpo1
2012-07-10 12:35:57 +02:00
Xavier Morel 9568c463b3 [FIX] conflicts between save-on-blur and action buttons in o2m
bzr revid: xmo@openerp.com-20120710073928-riswpz7f9mddqjgf
2012-07-10 09:39:28 +02:00
Xavier Morel 853c5a70c0 [ADD] 'false' id to newly created records, otherwise format_cell's button rendering blows up
also fix various bits of code looking for an absence of @data-id, so that they look for a false @data-id to match the row of the new record instead

bzr revid: xmo@openerp.com-20120709084652-rt1ffu2ea20scw53
2012-07-09 10:46:52 +02:00
Xavier Morel cd59881b05 [FIX] Editor is not restartable, so don't restart it.
Instead, create a new one at each on_loaded.

Editor is not restartable because the formview wedges itself if its on_loaded is called more than once

bzr revid: xmo@openerp.com-20120709080604-er1l6bn5eespue59
2012-07-09 10:06:04 +02:00
Xavier Morel ee20d56357 [FIX] Create new records as a bunch of empty (false) fields, otherwise Bad Things Happen ~/projects/tiny/web/current
namely, if the list view fields have e.g. attributes associated, the
computation of the domains blow up

also, always create an editor in the listview (if the editable
listview module has been installed), avoids blowing up 'safety' calls
to #ensureSaved. An alternative would be to fix #ensureSaved not to
blow up if there's no editor, but that means third parties which
*know* there may be an editor in the list view can't easily hook up to
it.

Things will have to change anyway as currently toggling a list view
from not-editable to editable after on_loaded has been called will not
work correctly (it won't start the editor), which is shitty.

bzr revid: xmo@openerp.com-20120705143721-4fiz64k7fka4052k
2012-07-05 16:37:21 +02:00
Xavier Morel 09bf459bbc [TESTS] add some
bzr revid: xmo@openerp.com-20120705070854-tsyl27v3hdh7sbds
2012-07-05 09:08:54 +02:00
Xavier Morel 25284686f3 [TEST] saving of record being edited, improve RPC mocking to allow dispatch on ORM method name
bzr revid: xmo@openerp.com-20120704132822-3p4h1c6cyr0qvn2x
2012-07-04 15:28:22 +02:00
Xavier Morel 9c6f8c5335 [FIX] broken keyup handling for return key, incorrect name ($.ui.keyCode uses enter)
bzr revid: xmo@openerp.com-20120704121957-hcwk5ove76kpo7y0
2012-07-04 14:19:57 +02:00
Xavier Morel 039cf85e32 [TEST] start adding some testing to new editable listview, validate structure of editionView in Editor
bzr revid: xmo@openerp.com-20120704095626-j7wtbgdmoti0kjie
2012-07-04 11:56:26 +02:00
Xavier Morel db4aa8dfe7 [REF] remove deprecated & unused methods; extract some other methods
bzr revid: xmo@openerp.com-20120703155305-4bigm8htt3xutkyt
2012-07-03 17:53:05 +02:00
Xavier Morel 7ab7992fd6 [FIX] ensure current edition is saved before performing action
bzr revid: xmo@openerp.com-20120703143126-6ludobg5o75t14ic
2012-07-03 16:31:26 +02:00
Xavier Morel 58d1d6bb39 [FIX] forgot to instantiate deferred
bzr revid: xmo@openerp.com-20120703143035-zi336bg5lheocjpa
2012-07-03 16:30:35 +02:00
Xavier Morel 895dfe2448 [FIX] replace references to parent in editor with delegate, write some basic APIDoc
bzr revid: xmo@openerp.com-20120703133210-kgrj7y10cr3c8hai
2012-07-03 15:32:10 +02:00
Xavier Morel 336443d604 [IMP] hiding of readonly form fields in edition row: don't directly access DOM visibility properties
bzr revid: xmo@openerp.com-20120703110700-k0dqtthwo1g36pod
2012-07-03 13:07:00 +02:00
Xavier Morel ae6c6eb8ec [ADD] save button instead of selector during edition
bzr revid: xmo@openerp.com-20120703102750-1vmoljtbrnnl3lzo
2012-07-03 12:27:50 +02:00
Xavier Morel a5940c4147 [IMP] reload record after cancelling an edition
bzr revid: xmo@openerp.com-20120703102731-mh1gqbglenr4boem
2012-07-03 12:27:31 +02:00
Xavier Morel 1a7ca5f676 [IMP] attempt to tighten concurrent operations during save phase of an edited row
bzr revid: xmo@openerp.com-20120703093200-hxsr9pnwoszbgwgl
2012-07-03 11:32:00 +02:00