Commit Graph

47 Commits

Author SHA1 Message Date
Raphael Collet f2e4a10e1a [IMP] use model._fields instead of model._all_columns to cover all fields
The old-api model._all_columns contains information about model._columns and
inherited columns.  This dictionary is missing new-api computed non-stored
fields, and the new field objects provide a more readable api...

This commit contains the following changes:

 - adapt several methods of BaseModel to use fields instead of columns and
   _all_columns

 - copy all semantic-free attributes of related fields from their source

 - add attribute 'group_operator' on integer and float fields

 - base, base_action_rule, crm, edi, hr, mail, mass_mailing, pad,
   payment_acquirer, share, website, website_crm, website_mail: simply use
   _fields instead of _all_columns

 - base, decimal_precision, website: adapt qweb rendering methods to use fields
   instead of columns
2014-11-04 13:47:57 +01:00
Denis Ledoux 639174bc53 [FIX] website: prevent editing contact address with qweb contact widget
Because, currently, it copy the whole address in the contact name. The address is therefore duplicated
2014-10-16 18:39:37 +02:00
Xavier Morel 2ffcff8fa9 [ADD] qweb: handling of t-att=mapping
Changed render_att_att to return an iterable of pairs instead of a pair, and
dispatched t-att on whether its result is a Mapping.

Also changed qweb test runner so it uses ordereddict for JSON mapping in
params, otherwise iteration order (and thus order of attributes in output) is
unpredictable and results don't/can't match expectations (as both are
strings).

Note that this relies on JS implementation details wrt iteration order of
mappings. Tests would probably be somewhat less brittle if rendering output
was parsed to XML... if that's possible (?)
2014-10-06 19:13:44 +02:00
Fabien Meghazi 51477fb4f6 [IMP] Brought back /website/image route w/filename hinted in headers
Also added support for this route in widget Image#from_html()
2014-09-17 16:54:08 +02:00
Fabien Meghazi bc5e6fa2cb [ADD] Helper for /website/image (allows to use aggressive cache) 2014-09-16 19:54:59 +02:00
Fabien Meghazi 5e6e1303e3 [IMP] pretty urls for /website/image 2014-08-28 16:37:38 +02:00
Xavier Morel b18d83c0e0 [IMP] convert qweb to use lxml instead of minidom
should be >20x faster at parsing document strings and gain close to 40s on crawling
2014-07-02 16:01:36 +02:00
Xavier Morel 56009e8804 [FIX] website: missing timezone conversion back to UTC
In t-field, datetime fields (formatted and not formatted versions) are
converted to the context/user's timezone (through
fields.datetime.context_timestamp) when displayed, but were saved without
converting back so the next display would go forward (or back) of the user's
tzoffset.

Fix that by applying context_timestamp's conversion backwards, from the
context/user's timezone back to UTC, before saving the field's value.
2014-06-18 16:09:02 +02:00
Olivier Dony 6b85d80f23 [FIX] Wrap werkzeug.utils.escape() to accomodate signature change in 0.9
We always want to escape quotes (") as part of the process of
generating HTML output. This option (quote=True) turned into
an implicit flag with a DeprecationWarning in werkzeug 0.9.0
It is likely to disappear in a future release of werkzeug too.
A wrapper avoids this warning without loss of compatibility
2014-06-10 18:46:40 +02:00
Xavier Morel 4362c6127f [IMP] use url_encode when building url query string
I have no idea why I originall implemented that crap via string munging.
2014-05-23 15:03:23 +02:00
Richard Mathot 1d70ecd80d [IMP] website: add max_height and max_width options to image Qweb widget 2014-05-23 11:55:48 +02:00
chm@openerp.com 4dc3b139f3 [IMP] ir_qweb, ir_ui_view: can use id insead of xml_id; can render ir.ui.view many2one with widget='qweb' in template
bzr revid: chm@openerp.com-20140409104427-ut3r5acavyjsp6bj
2014-04-09 12:44:27 +02:00
Christophe Simonis 0fad8159f3 [MERGE] forward port of branch saas-3 up to revid 9380 chs@openerp.com-20140407144439-10n8fs6zovodwwtx
bzr revid: chs@openerp.com-20140407163318-hh3jwfkj3o2c83lk
2014-04-07 18:33:18 +02:00
Olivier Dony f120d6ffb7 [FIX] ir.qweb: avoid errors with function fields of type datetime
bzr revid: odo@openerp.com-20140401160623-loj5nsph7tfnn1us
2014-04-01 18:06:23 +02:00
Simon Lejeune 50fda546e2 [REF] Moved qweb contact from website to base and removed the from_html method (it never worked)
bzr revid: sle@openerp.com-20140324135933-f21heo0sz0tzjbv3
2014-03-24 14:59:33 +01:00
Fabien Meghazi 326c35aecd [IMP] Merge bananas and cumcumbers in order to prepare the t-href|t-action removal
bzr revid: fme@openerp.com-20140128201417-1elmttz8qen9q3ws
2014-01-28 21:14:17 +01:00
Christophe Matthieu 43044d8ee7 [IMP] event,event_sale: refactoring; remove crappy 9999 hardcoded values; remove visibility; add constraints
bzr revid: chm@openerp.com-20140127135828-z848mvpis5d9xyh8
2014-01-27 14:58:28 +01:00
Fabien Meghazi f0606d3cc0 [FIX] Contact field encoding issue
bzr revid: fme@openerp.com-20140124132304-4kmjd9k4k2xgjecv
2014-01-24 14:23:04 +01:00
Christophe Matthieu 4ff1af4d01 [FIX] website: display or not editor edit button; website_sale: test tour; website: contact qweb widget
bzr revid: chm@openerp.com-20140121123912-0ya4ziusj09efti3
2014-01-21 13:39:12 +01:00
Xavier Morel 3f8c2d0bad [FIX] conversion from html to values for text field
see html_to_text comment

bzr revid: xmo@openerp.com-20140110152024-yp2out0jg1gx1uhs
2014-01-10 16:20:24 +01:00
Fabien Pinckaers ba2689e70c [FIX] don't crash on empty dates [IMP] default dates on demo tracks
bzr revid: fp@tinyerp.com-20131222230021-9a03x3eiwi4e780x
2013-12-23 00:00:21 +01:00
Xavier Morel e04983ae69 [IMP] conversion back from m2o t-field to openerp value
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
2013-12-18 15:09:17 +01:00
Xavier Morel 90a9e522f3 [ADD] placeholder support on t-field
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
2013-12-18 12:49:01 +01:00
Xavier Morel 87c3b6ac72 [FIX] disabling of field escaping
bzr revid: xmo@openerp.com-20131216092343-0e6t7nvse3r0p2zs
2013-12-16 10:23:43 +01:00
Christophe Matthieu d0b813a016 [IMP] fix website_hr_recruitment, website_event, and create contact qweb widget
bzr revid: chm@openerp.com-20131206133003-to4lbgoynvviifq5
2013-12-06 14:30:03 +01:00
Xavier Morel a1ecb6923b [ADD] saving of oddly localized/formatted stuff
bzr revid: xmo@openerp.com-20131205113908-9tr575ejn7hanhi7
2013-12-05 12:39:08 +01:00
Xavier Morel 52b1ac6a3e [FIX] alteration of image field without actually changing the image URL
UI allows changing corner even though corners are not saved...

bzr revid: xmo@openerp.com-20131202111720-oabkjado7n1jrt66
2013-12-02 12:17:20 +01:00
Xavier Morel b45dfac7fe [ADD] correct handling of setting local urls (pre-existing images from /thing/static) in t-fields
bzr revid: xmo@openerp.com-20131127104638-ooyuu8dobhzc9a7f
2013-11-27 11:46:38 +01:00
Xavier Morel 411cd6aa21 [IMP] add img and img-responsive to image fields
bzr revid: xmo@openerp.com-20131122104148-dpo63pg6mpn1315c
2013-11-22 11:41:48 +01:00
Xavier Morel 82b40bf84c [FIX] urlparse.parse_qs returns a dict *of lists*, eq test on values with a string is always false
bzr revid: xmo@openerp.com-20131121121235-hafy7n61h3v6kb0k
2013-11-21 13:12:35 +01:00
Fabien Meghazi 557d887496 [IMP] preprocess static @href|src|action, static url doesn't need t-href anymore
you need to pull server branch

bzr revid: fme@openerp.com-20131112144442-y9bw5q6kkoym8o1i
2013-11-12 15:44:42 +01:00
Xavier Morel b702a9887c [IMP] remove /website/attachment, make attachments go through /website/image
bzr revid: xmo@openerp.com-20131024103401-yik03je9qm1ge0tp
2013-10-24 12:34:01 +02:00
Xavier Morel 1eb3d3269c [ADD] parsing of localized date & datetime t-fields
turns out we use a bunch of them in the events section thing

bzr revid: xmo@openerp.com-20131023145729-tglusl27mt6ajwzn
2013-10-23 16:57:29 +02:00
Xavier Morel 13777d3a79 [ADD] parsing of localized monetary t-field
bzr revid: xmo@openerp.com-20131022090843-pcr6orrumzm4hf6a
2013-10-22 11:08:43 +02:00
Xavier Morel 1687668026 [ADD] parsing of locale-formatted floats
bzr revid: xmo@openerp.com-20131022085450-mhymubsywkonepjx
2013-10-22 10:54:50 +02:00
Xavier Morel 730d0c69fe [IMP] ensure we don't unwittingly save wrongly formatted dates and datetimes
bzr revid: xmo@openerp.com-20131022073326-gxmcfd60ytq2f1oc
2013-10-22 09:33:26 +02:00
Xavier Morel 9da0ead28d [ADD] support for formatted date and datetime t-field in website
bzr revid: xmo@openerp.com-20131021152651-ner2zggjfofb5rc4
2013-10-21 17:26:51 +02:00
Xavier Morel fbd72c436a [ADD] context to t-field conversion methods
bzr revid: xmo@openerp.com-20131021082840-1tdbxhpy4ut1uoif
2013-10-21 10:28:40 +02:00
Xavier Morel 3e349a2bf7 [ADD] conversion back from HTML to monetary field
bzr revid: xmo@openerp.com-20131011142528-oruyq6r7vf962lqn
2013-10-11 16:25:28 +02:00
Xavier Morel 1208a5bcf5 [ADD] monetary widget use in website_sale
bzr revid: xmo@openerp.com-20131011131147-plqmc1r5ok4tcrge
2013-10-11 15:11:47 +02:00
Xavier Morel c6c0609577 [IMP] add notes and timeout to urlopen call
bzr revid: xmo@openerp.com-20131010122652-ukjof14x2d0y3h89
2013-10-10 14:26:52 +02:00
Xavier Morel 9cdbe94ce5 [ADD] saving of image fields
bzr revid: xmo@openerp.com-20131010103005-mp0afaps3ssqacm8
2013-10-10 12:30:05 +02:00
Xavier Morel eaef36c910 [FIX] move conversion code from ir.fields.converter into website.qweb structures
bzr revid: xmo@openerp.com-20131009133112-05dglhptiw019838
2013-10-09 15:31:12 +02:00
Xavier Morel a3f7cfd669 [FIX] renaming of currency widget to monetary to match view
bzr revid: xmo@openerp.com-20131008122039-tzw7nq8cx0y0zh5p
2013-10-08 14:20:39 +02:00
Xavier Morel 426757ad92 [ADD] linked image fields
bzr revid: xmo@openerp.com-20131008120456-r8tqd5iyq1zfsdvi
2013-10-08 14:04:56 +02:00
Xavier Morel d8c837ef5b [IMP] promote part of the website.qweb docstring to module-level
bzr revid: xmo@openerp.com-20131008092612-oqaesax6qjl6bse0
2013-10-08 11:26:12 +02:00
Xavier Morel 510a4f51d2 [ADD] customizable qweb rendering, add translate flag on fields through this
bzr revid: xmo@openerp.com-20131008092233-9su66923zthl9jyg
2013-10-08 11:22:33 +02:00