Commit Graph

99 Commits

Author SHA1 Message Date
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
Xavier Morel 29e65ff052 [FIX] move 'behavior on save' to handler for [Return] key as it's the only situation where we want to skip to next record
bzr revid: xmo@openerp.com-20120703091058-b7wdebu8ak6gssyb
2012-07-03 11:10:58 +02:00
Xavier Morel 70fa57b9df [IMP] move onwrite handling to ListView (from List)
untested

bzr revid: xmo@openerp.com-20120702135824-ngcx34qfuu3t2kab
2012-07-02 15:58:24 +02:00
Xavier Morel 5df6c47700 [FIX] methods capitalization
bzr revid: xmo@openerp.com-20120702133451-e5b7uozm0p36jbpr
2012-07-02 15:34:51 +02:00
Xavier Morel 13cf266e2c [FIX] next on create/save
* Move prev/next behavior after save to ListView
* Have fetching of row for a record be a method chain on Group/List
* Have edition behavior be fully specified in ListView

bzr revid: xmo@openerp.com-20120702132217-ni1byjkf7t6tr5a4
2012-07-02 15:22:17 +02:00
Xavier Morel d6a9d86e09 [FIX] change event handling for 'new' records (records w/o an id yet)
bzr revid: xmo@openerp.com-20120702111026-twmh5gbg4i1fd4kj
2012-07-02 13:10:26 +02:00
Xavier Morel c262b2d1ae [FIX] shallow-copy info passed into Editor#edit to avoid mutating an object owned by somebody else
bzr revid: xmo@openerp.com-20120702110733-0qp0ki3hbw5b2nd3
2012-07-02 13:07:33 +02:00
Xavier Morel d1eeaaa51e [FIX] better filtering of id-less rows being selected in a ListView.List body
bzr revid: xmo@openerp.com-20120702110658-7t8pu12uso55enrh
2012-07-02 13:06:58 +02:00
Xavier Morel 3cc825994b [TODO] add todo note
bzr revid: xmo@openerp.com-20120702110607-csi1oa4hm6lxtwat
2012-07-02 13:06:07 +02:00
Xavier Morel ac2895fd62 [IMP] don't handle keypresses at the editor level, do that in the view instead
maybe the editor could do it and trigger an event of its own for the view to handle?

bzr revid: xmo@openerp.com-20120702093113-berlms96fqzfjlyg
2012-07-02 11:31:13 +02:00
Xavier Morel f83684265d [FIX] make edition of existing records kinda-sorta work (if the record is 'saved' by clicking on an other one)
bzr revid: xmo@openerp.com-20120628141403-z8kdg24xy5thmg50
2012-06-28 16:14:03 +02:00
Xavier Morel cbba19da67 [IMP] automatically focus first field of edited row
bzr revid: xmo@openerp.com-20120628084547-6fo7fkiy2gh2wb6m
2012-06-28 10:45:47 +02:00
Xavier Morel 94f6eec2ab [BREAK] editable list view
* Introduce overlay form on row edition
* Broken save
* Broken cancel
* (probably) broken o2m
* Broken create

bzr revid: xmo@openerp.com-20120627143228-qku9ku3zo6k59r0f
2012-06-27 16:32:28 +02:00
Xavier Morel 92431bf895 [FIX] usage of retarded API
bzr revid: xmo@openerp.com-20120625145103-bgbll0d9bcco0ikp
2012-06-25 16:51:03 +02:00
Xavier Morel 54a8f9e193 [MERGE] 6.1 changes and trunk
bzr revid: xmo@openerp.com-20120625135215-az1927llmk0vw655
2012-06-25 15:52:15 +02:00
Xavier Morel 3e2cab2aad [FIX] handling of [Return] key to save records being edited in MSIE
* DOM events sequence screwed up, requiring an explicit blur on the
  current target to try and ensure the corresponding form widget would
  register its own change event
* Requirement to stop the default behavior of keypress and keydown on
  [Return] as they would somehow trigger the contextual menu of m2o
  fields on the row, at the wrong place, when in a char field (I don't
  even...)
* Delaying of the actual saving of the form (via `setTimeout`) to try
  and ensure the blur/change event has had the time to propagate
  correctly (and be handled) before we actually save

bzr revid: xmo@openerp.com-20120615055440-yn00uv4q8y29nboq
2012-06-15 07:54:40 +02:00
Xavier Morel acfff868cb [IMP] return deferred from ListView#render_row_as_form indicating *when* the row has been rendered as a form
bzr revid: xmo@openerp.com-20120614123130-1z1vvt62rnr21bpz
2012-06-14 14:31:30 +02:00
Xavier Morel 83eef22856 [FIX] don't break the handling of record index 0 in editable list views: index 0 means something different than index = null
bzr revid: xmo@openerp.com-20120614085009-xuo1ifu2vnlcic72
2012-06-14 10:50:09 +02:00
Xavier Morel 49f6ab9853 [FIX] do not break dataset index (at the wrong moment) when clicking on [Create] row
dataset.index was previously set to ``null`` in handler of [Create]
button (to fullfill contract with form view that dataset.index should
be ``null`` to indicate the creation of a new record with no id).

Issue: after setting the index to ``null``, the list view calls
``render_row_as_form`` which starts out trying to save a row being
edited (case: clicking of the [Create] button after having selected a
row for edition or after having written in a new record e.g. [Create]
-> type -> [Create] type -> ...). This tentative to save the existing
form would be performed in the context of a ``null`` dataset.index,
which the form view doesn't (and shouldn't, index should be that of
record *being edited*) expect.

-> first save in whatever dataset state is the current one, and *right
before* creating the new form (after having saved and/or discarded the
previous one) we have the id of the new record to edit (or ``null``),
find the index for *that* and set ``dataset.index`` to that (or
``null``) so the new form view can be created and opened in the right
context.

bzr revid: xmo@openerp.com-20120613153842-pd6xitjs8n003ogs
2012-06-13 17:38:42 +02:00
Xavier Morel 9f9bbcff33 [FIX] in ensure_saved, discard non-dirty editable rows
if the editable row's form isn't dirty, either nothing has been
entered in a new row or an existing row (being edited) has not been
altered, so can just discard the row (and reload it from cache if it's
an edition).

bzr revid: xmo@openerp.com-20120613153633-ms7i8t9lvdarxqi3
2012-06-13 17:36:33 +02:00
Xavier Morel 632a4dee0c [FIX] correctly forward arguments in _super() call of editable listview's form widgets override
bzr revid: xmo@openerp.com-20120613094037-3iny9dsdhmp7qspi
2012-06-13 11:40:37 +02:00
Xavier Morel 0240ab1682 [CHG] try saving any row under edition when starting an (other) row edition
editable lists should not lose data unless explicitly asked to forget about it by user action

bzr revid: xmo@openerp.com-20120612150820-z97jxme1vcu3x3jd
2012-06-12 17:08:20 +02:00
Xavier Morel eb83b58e32 [IMP] Deferred usage in editable listview
bzr revid: xmo@openerp.com-20120612150708-0z5dsclcrtj29st3
2012-06-12 17:07:08 +02:00
niv-openerp c7e32e7175 [FIX] Problem with SelectCreatePopup, the list view can sometimes be editable
lp bug: https://launchpad.net/bugs/1005812 fixed

bzr revid: nicolas.vanhoren@openerp.com-20120607152301-mu43z3n7q2fonsuk
2012-06-07 17:23:01 +02:00
niv-openerp d70caa73d7 [fix] Put back disk icon in editable lists
bzr revid: nicolas.vanhoren@openerp.com-20120606132035-3zo2ld4q7vycuej6
2012-06-06 15:20:35 +02:00
Hiral Patel (OpenERP) 97d09bbd3c [FIX]display icon of save button.
lp bug: https://launchpad.net/bugs/985715 fixed

bzr revid: hip@tinyerp.com-20120522100448-wslfkjb6j7lj8ipc
2012-05-22 15:34:48 +05:30
Fabien Meghazi 8b95683d20 [FIX] Fix some css, remove useless classes
bzr revid: fme@openerp.com-20120510103513-ejjeab5g3s6tr4tc
2012-05-10 12:35:13 +02:00
Fabien Meghazi 9eb8e07d4f [FIX] Fix empty list menu tips on editable lists
bzr revid: fme@openerp.com-20120510092621-kbjjmo6yct1ndg3c
2012-05-10 11:26:21 +02:00