Commit Graph

54 Commits

Author SHA1 Message Date
Thibault Delavallée f4bb798cb8 [CLEAN] ir_qweb: removed commented and now dead BUILTINS
bzr revid: tde@openerp.com-20140116183315-g5ootf670kwx1z1z
2014-01-16 19:33:15 +01:00
Thibault Delavallée c76a3aba8f [CLEAN] ir_qweb: simplified and cleaned QWebcontext implementation
- now using openerp.tools.safe_eval, instead of a custom eval with custom builtins
- removed undefined_handler, hardcoded to a lambda function that returns None for
a missing attribute

tools.safe_eval: added a parameter locals_builtins. This allows to copy the builtins
in the locals. This hack is due to the fact that the locals always returns None, allowing
to simplify templates. Otherwise we would have to test the existence of each variable
before actually using it.
However as the locals always return None for every key, the globals are never checked.
Copying the builtins inside the local allows to have a complete locals, but sligtly
break the globals/locals separation.

To be reviewed and approved.

bzr revid: tde@openerp.com-20140116182750-1rnw8iljt5a9gb4u
2014-01-16 19:27:50 +01:00
Fabien Meghazi 130fff6241 [REM] Removed QWeb's useless t-escf and t-rawf
bzr revid: fme@openerp.com-20140115183346-qhifdt2ta9am7tj7
2014-01-15 19:33:46 +01:00
Xavier Morel 58ff276887 [FIX] pillow-compatible import
bzr revid: xmo@openerp.com-20140114124843-zpg2qzua90uq1pxu
2014-01-14 13:48:43 +01:00
Xavier Morel 4a3a7130fb [IMP] replace setattr with direct attribute setting
bzr revid: xmo@openerp.com-20140108102118-virpiwarr0t0ojek
2014-01-08 11:21:18 +01:00
Christophe Matthieu 3d618cd6b4 [IMP] ir_qweb: add groups evaluation when a qweb view is rendered
bzr revid: chm@openerp.com-20140107151227-837ecc075be2prp8
2014-01-07 16:12:27 +01:00
Fabien Meghazi 51c53cb396 [IMP] QWeb: set template information on 'iterator not found' exception
bzr revid: fme@openerp.com-20140107105452-qrthkboh5wearljb
2014-01-07 11:54:52 +01:00
Fabien Meghazi b72b74864a [IMP] QWeb: set template information on template not found exception
bzr revid: fme@openerp.com-20131217135618-0l1emdsz6brviosm
2013-12-17 14:56:18 +01:00
Xavier Morel f6a5800d59 [ADD] ability to disable fields escaping
bzr revid: xmo@openerp.com-20131216092330-2v50c8uzzsb3qp8q
2013-12-16 10:23:30 +01:00
Thibault Delavallée 806c6866bd [FIX] ir_qweb: do not perform dict operation on context without being sur it is not None (next one)
bzr revid: tde@openerp.com-20131206102714-7lrhyk156sywvvea
2013-12-06 11:27:14 +01:00
Thibault Delavallée 0926b1717f [FIX] ir_qweb: do not perform dict operation on context without being sur it is not None
bzr revid: tde@openerp.com-20131206102555-rys582neghxi2x21
2013-12-06 11:25:55 +01:00
Xavier Morel 745ecc9d25 [FIX] qweb: incorrect propagation of t-field options through rendering methods
bzr revid: xmo@openerp.com-20131205111530-nj26muxxep1yey79
2013-12-05 12:15:30 +01:00
Fabien Pinckaers dc35f14d32 [IMP] Removed 1 SQL query for each t-field monetary or float
bzr revid: fp@tinyerp.com-20131203211903-p5uo3shhon8i4umw
2013-12-03 22:19:03 +01:00
Xavier Morel 103cea2da0 [FIX] change ManyToOne converter to use read on parent record and pass the browse_record's context through
avoids access rights issue, can be used for automagical formatting of address on res.partner

bzr revid: xmo@openerp.com-20131202095638-hoj7sxvax5808irc
2013-12-02 10:56:38 +01:00
Xavier Morel 228938ccba [ADD] formats support to date and datetime converters
bzr revid: xmo@openerp.com-20131202073313-tu79esduu5bvyaai
2013-12-02 08:33:13 +01:00
Xavier Morel c457c2197a [REF] inline server formats in date & datetime converter methods
bzr revid: xmo@openerp.com-20131129103943-1ba1jbm3xxk1p42t
2013-11-29 11:39:43 +01:00
Xavier Morel 71b25c5add [ADD] relative datetime qweb widget
bzr revid: xmo@openerp.com-20131129085256-dwpcy0rd5v6bls9d
2013-11-29 09:52:56 +01:00
Xavier Morel ea56dece85 [ADD] duration widget
bzr revid: xmo@openerp.com-20131128153630-pouwmygw6vgyuj1l
2013-11-28 16:36:30 +01:00
Fabien Meghazi 14d552cd48 [FIX] qweb#render() should honor browse record calling
bzr revid: fme@openerp.com-20131125131811-3blovguwiearewqb
2013-11-25 14:18:11 +01:00
Fabien Meghazi bbac9f0f23 [ADD] Add hook for qweb preprocessing
bzr revid: fme@openerp.com-20131112140822-7p37hu8gd82ta5aj
2013-11-12 15:08:22 +01:00
Antony Lesuisse a17a49e130 [FIX] qweb exception hiding
bzr revid: al@openerp.com-20131102165515-4p7401k5tl95l4lg
2013-11-02 17:55:15 +01:00
Antony Lesuisse a9f9cd06c7 [FIX] typxmo
bzr revid: al@openerp.com-20131030220738-zkf0kfa049iof2ld
2013-10-30 23:07:38 +01:00
Xavier Morel 94cbff3b7b [FIX] unset fields should render to empty, not the literal False
bzr revid: xmo@openerp.com-20131030154105-hqsalqnoa1nv1txy
2013-10-30 16:41:05 +01:00
Xavier Morel d06d6f7fd9 [FIX] m2o t-field rendering: use uid 1 for name_get
This is done automatically on a read(), but t-field uses a browse,
which does not do access-rights bypassing. We've already browsed the
root record so we should have the rights to the reading, and we just
want the textual representation for the child m2o.

bzr revid: xmo@openerp.com-20131025124720-i10eywz70o9c9dpc
2013-10-25 14:47:20 +02:00
Xavier Morel fc8ab0df05 [FIX] numbers formatting to correctly apply user locales
bzr revid: xmo@openerp.com-20131022085436-5845r3q51g9pl2ct
2013-10-22 10:54:36 +02:00
Xavier Morel b9dfef2fab [ADD] formatting of date and datetime t-field
bzr revid: xmo@openerp.com-20131021152639-2o2j2knhuppdlbzm
2013-10-21 17:26:39 +02:00
Xavier Morel 61b306edc0 [ADD] format floating-point values (including monetary values) according to user lang
bzr revid: xmo@openerp.com-20131021125723-66rc4w5ist6rx22o
2013-10-21 14:57:23 +02:00
Xavier Morel 3eae335a9b [ADD] comment to ir.qweb.field.monetary to explain its workings/purpose
bzr revid: xmo@openerp.com-20131021100543-wlsc93puu23qnv8c
2013-10-21 12:05:43 +02:00
Xavier Morel a348a5e92f [ADD] hook in qweb.field.float for overriding precision
bzr revid: xmo@openerp.com-20131021091607-mirzojqhsbskx57g
2013-10-21 11:16:07 +02:00
Xavier Morel b50e90607f [ADD] context all the things!
bzr revid: xmo@openerp.com-20131021083120-6v6xy0bm4w686d2m
2013-10-21 10:31:20 +02:00
Xavier Morel 5a257c5318 [FIX] recursive qweb render calls to pass (void) cr and uid
both are already in the qwebcontext passed as last argument

bzr revid: xmo@openerp.com-20131018144838-xvtg0f7uoxf360zr
2013-10-18 16:48:38 +02:00
Xavier Morel 55c38976c0 [ADD] cr, uid, context to qweb.render & qweb rendering context
bzr revid: xmo@openerp.com-20131018144546-p693x1iur5gm98ez
2013-10-18 16:45:46 +02:00
Xavier Morel b6c7adced6 [FIX] import/reference warning
bzr revid: xmo@openerp.com-20131018143659-e9tapiu7c5tf5t2i
2013-10-18 16:36:59 +02:00
Christophe Matthieu aeb0125c84 [IMP] ir_qweb: better exception with message, node, template
bzr revid: chm@openerp.com-20131018113927-vnsk2mj1g8gsl5hs
2013-10-18 13:39:27 +02:00
Christophe Matthieu 4c1076420c [IMP] ir_qweb: add a class QWebException and raise a better exception message
bzr revid: chm@openerp.com-20131018095913-7ut45k9r9c1qp2wf
2013-10-18 11:59:13 +02:00
Xavier Morel 0ed91c4b29 [FIX] move loaded templates storage to context
Didn't think of the _t attribute storing loaded templates when qweb
was moved from a Python object instantiated every rendering to an
openerp never reinstantiated. This unexpectedly moved _t from the
status of a per-render cache (to avoid reloading sub-templates or
recursive templates a billion times) into a permanent cache with no
invalidation.

Move _t to QWebContext.templates, which should be per-render, for now.

bzr revid: xmo@openerp.com-20131015152858-u89wx46e0ngh58of
2013-10-15 17:28:58 +02:00
Fabien Meghazi 392776523b [ADD] QWeb: t-keep-query
bzr revid: fme@openerp.com-20131014150442-7gn82i8bb8p6tfi7
2013-10-14 17:04:42 +02:00
Xavier Morel 625f4e253f [IMP] correctly handle empty m2o field serialization
bzr revid: xmo@openerp.com-20131014105621-mwiucen7glajccea
2013-10-14 12:56:21 +02:00
Fabien Meghazi 9cf7418b18 [FIX] Temporary fix for xmlid
bzr revid: fme@openerp.com-20131014100753-3pk226p4gsa6zrec
2013-10-14 12:07:53 +02:00
Xavier Morel a720eec77c [FIX] monetary field rounding, QWebContext in tests
bzr revid: xmo@openerp.com-20131014093657-wl00zhbgk5b1zs0o
2013-10-14 11:36:57 +02:00
Xavier Morel 64ea89e3be [MERGE] from parent
bzr revid: xmo@openerp.com-20131014085215-qoqytud1mkpdqbz0
2013-10-14 10:52:15 +02:00
Xavier Morel 29d10fd8ea [REM] conversion in monetary widget, turns out to be a misunderstood need
bzr revid: xmo@openerp.com-20131011142512-3j5vuik1o4k6q6jj
2013-10-11 16:25:12 +02:00
Xavier Morel 20f89a8d85 [IMP] change monetary t-field options, make them more sensible and flexible
bzr revid: xmo@openerp.com-20131011111620-sitjaxoykgjp2175
2013-10-11 13:16:20 +02:00
Xavier Morel ef848653af [FIX] rename currency widget to monetary to match views
bzr revid: xmo@openerp.com-20131008122006-k7xjv2lkd0t7lza7
2013-10-08 14:20:06 +02:00
Xavier Morel 273f62bc78 [IMP] move translate flag out of base qweb rendering
bzr revid: xmo@openerp.com-20131008092207-m27ox8pebl36a45p
2013-10-08 11:22:07 +02:00
Xavier Morel 5e1c17a3a7 [ADD] docstring about qweb usage
bzr revid: xmo@openerp.com-20131008070742-4k1egtvmdvz3pv6e
2013-10-08 09:07:42 +02:00
Xavier Morel 47fc0a1093 [ADD] apply currency's rounding to currency widget values
bzr revid: xmo@openerp.com-20131008064226-ry22z6w23d88szr8
2013-10-08 08:42:26 +02:00
Xavier Morel a6e4951886 [ADD] currency prefix symbol
bzr revid: xmo@openerp.com-20131007150330-sys0320gaui2crtt
2013-10-07 17:03:30 +02:00
Xavier Morel 727b0e27c5 [ADD] currency qweb field widget, postfix currency
bzr revid: xmo@openerp.com-20131007145346-a3hlb6xjdwroyvzb
2013-10-07 16:53:46 +02:00
Xavier Morel a30a4640c2 [IMP] add some docstrings, split out fetching the converter model in ir.qweb in its own method
This way, it's possible to inherit from ir.qweb and override converter discovery

bzr revid: xmo@openerp.com-20131007125155-5j0xeov213sz4ccq
2013-10-07 14:51:55 +02:00