Didn't quite work right: on the layout, it would exponentially increase
leading spaces in text nodes. Combined with a bug injecting snippets marks in
the footer (and thus invalidating and re-saving the layout at each snippet
addition) this could blow up the layout template and rendered page to >20MB.
Just keep lxml's standard 2-spaces indent.
LXML is unable to pretty print the layout anyway.
bzr revid: xmo@openerp.com-20140321075419-9w88h232r928xv5f
Didn't manage to find RTE settings to avoid losing leading whitespace of
lines, so reindeint arch after doing all integration, right before saving back
to view's field.
* html.fromstring(parser=HTMLParser(remove_blank_text=True) does not seem to
work, so serialize to XML, and parse back with
remove_blank_text. remove_blank_text necessary for lxml's pretty_print to
work correctly.
* pretty_print only & always uses 2 spaces/indent level. Our files (and the
HTML editor's Format button) uses 4 spaces -> need a second pass to double
indents.
bzr revid: xmo@openerp.com-20140227125934-q8j3z440px2ic6kx
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
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
Temporary desactivated because this breaks most of the snippets
Need to find another way to normalize multilang urls (postprocessing) ?
bzr revid: fme@openerp.com-20131030085425-inwkihpwqmierodx