Instead of doing a name_get on the edited value and trying to find out
an m2o to assign back (which there's pretty much no chance of given
there's no autocompletion or anything), alter the m2o record in-place
by setting the provided edited value to its _rec_name.
Ideally, both features could be supported via more advanced m2o
edition widgets which would allow selecting an existing m2o, creating
a new m2o record from scratch or (maybe) editing the existing m2o's
display_name if possible, somewhat similar to what the form view
provides.
Without these though, the only action which makes any sense is to edit
the user-visible "value" where it is found, as with more normal
fields.
bzr revid: xmo@openerp.com-20131218140917-4eo2o55yfcumzhov
A placeholder is looked up:
1. in the field's options ("placeholder")
2. on the t-field node itself (@placeholder)
3. on the field's column (.placeholder)
The first one found is used as the @placeholder of the resulting node
(in-HTML), and displayed when the field is empty and unfocused.
If no placeholder is found, an empty field just gets a small padding
in order to be easier to see & focus.
bzr revid: xmo@openerp.com-20131218114901-xi3ye11x5pysq2a2
Before, would save view section itself (including root element). But
branding distribution (and thus editability) are set on the last
programmatic root, thus the root element may well be generated
e.g. <span t-att-foo> will define the span itself as editable.
Saving this would remove the programmatic content on the node, and
thus break the view section altogether.
Fix the issue by only saving the root's content in the previous root.
bzr revid: xmo@openerp.com-20131217112034-nbxbg919cffv4w51
old version of @website.route would wrap the base method within a
decorator, and endpoint_is_enumerable had to dig into the decorator to
get the original function (and be able to inspect it).
@website.route has been simplified and no longer wraps the function,
just adds a pair of attributes to it (and so does the base
@http.route), so don't dig into anymore, inspect rule.endpoint
directly.
bzr revid: xmo@openerp.com-20131202102525-8jsondrr1649c8t8
# Through the menu
Rather than output a generic error (500 due to an IntegrityError),
return a templated 409 letting the user either visit the
page-which-already-exists-with-the-name-he'd-picked or open the page
creation dialog again for a second round.
An alternative would be to promote the website.prompt use to
full-blown dialog as a result of selecting "New Page" and handle the
"page already exists" case without even closing the dialog.
# Through the link dialog
Added an RPC call to check if a page already exists (essentially a
cheaper version of opening /page/whatever and checking whether it's a
200 over JSON-RPC), if the page matching the completion term already
exists, do *not* add the choice of creating the page, only provide
completions from existing pages.
bzr revid: xmo@openerp.com-20131126160148-wrk4zvz9istscwa0
After discussion and addition of support for the methods parameter (on
@route), it's been determined that:
* POST endpoint must set up method correctly
* **kw on GET endpoints must be completely optional, mandatory query
arguments should be added as formal parameters without a default
values
* URLs can thus be generated for methods with **kw, simply by ignoring
it entirely
bzr revid: xmo@openerp.com-20131119154254-vp0zfnzjvi451vv0