Commit Graph

28 Commits

Author SHA1 Message Date
niv-openerp 42e493e73e Added Gruntfile with jshint and corrected most js errors
bzr revid: nicolas.vanhoren@openerp.com-20130725100749-0i82gf3k3nvt4r44
2013-07-25 12:07:49 +02:00
Martin Trigaux 7e4776f2f2 [FIX] pyeval: be more fault tolerant to avoid wrap null values
bzr revid: mat@openerp.com-20130702141600-4s7oan9yidjrlmcc
2013-07-02 16:16:00 +02:00
Xavier Morel 11a0ece543 [FIX] evaluation context structures not being round-tripped through eval
JS objects are converted to py.object when passed in through the
evaluation context. py.object are not serializable by default (because
that doesn't really make sense), which breaks when the input is
intended as a dict and returned (e.g. o2m values, which are triples of
(int, int?, dict?)).

Intuitively, JS objects passed as part of the context should be mostly
JSON-ish and thus dicts, but that turns out not work work as some
addons use attribute accesses within contexts (e.g. parent.access in
account/account_invoice_view.xml)

=> Temporarily solve by converting raw js objects to an "attributed
dict" which acts as both a dict and an object and can be converted to
JSON.

Ideally, py.js should provide for a pluggable conversion, or should
use an attributed mapping internally. See issues 21 and 23.

lp bug: https://launchpad.net/bugs/1182101 fixed

bzr revid: xmo@openerp.com-20130624055929-3rtkgqrp4o87pvau
2013-06-24 07:59:29 +02:00
niv-openerp c55de6996f [FIX] small problem with m2o, does not uses context when opening them in read-only mode
bzr revid: nicolas.vanhoren@openerp.com-20130319102719-0gdwvmix4d3x8th5
2013-03-19 11:27:19 +01:00
Xavier Morel ac5008abc9 [FIX] pyeval: argspec of relativedelta
bzr revid: xmo@openerp.com-20130318105244-qkgvi69do0219lkk
2013-03-18 11:52:44 +01:00
Xavier Morel b87102f22e [FIX] Inject user context in all domain and context evaluation
Custom keys from user context may be used in action contexts (not just
e.g. searchview filters). For instance, have a custom key
context_salesteam (in the user model) and an action defining some
search default as a function of the salesteam.

In that case, the action's context evaluation (view.js:~275) will blow
up.

Ensure that does not happen.

Note: eval_contexts already injects user_context in the reduction of
contexts to evaluate. It should be possible to alter the reduction
function to avoid having to inject instance.session.user_context
through pyeval.context(), maybe by _.extend-ing ``result_context``
into ``evaluation_context`` at the *top* of the reduction function
rather than at its bottom?

bzr revid: xmo@openerp.com-20130128130640-ksyvxvx6rlc4820n
2013-01-28 14:06:40 +01:00
Xavier Morel 5d313f1754 [FIX] styllistic fixes
bzr revid: xmo@openerp.com-20121130103638-8r77jpmb3hhmo8dt
2012-11-30 11:36:38 +01:00
niv-openerp 94dca54e38 [IMP] removed date.today() in pyeval
bzr revid: nicolas.vanhoren@openerp.com-20121130095228-mffq2407lq7tf8jj
2012-11-30 10:52:28 +01:00
niv-openerp f9b9e7c4cb [IMP] added context_today()
bzr revid: nicolas.vanhoren@openerp.com-20121129160746-c3c691zk5fxhzse0
2012-11-29 17:07:46 +01:00
niv-openerp cc6f0aa20a [FIX] potential problem with pyeval datetime/date today()/now() methods. Now only returns the same timezone than server (UTC).
bzr revid: nicolas.vanhoren@openerp.com-20121129153601-vtpnvkc0vylo9hux
2012-11-29 16:36:01 +01:00
Xavier Morel 89d9cd5910 [FIX] use py.js 0.7 API
bzr revid: xmo@openerp.com-20121128110542-nplg9o3e5jpxmqic
2012-11-28 12:05:42 +01:00
Xavier Morel 929a656619 [IMP] allow eval'ing a single context or domain
bzr revid: xmo@openerp.com-20121126084229-wgpjszmquhibbrpf
2012-11-26 09:42:29 +01:00
Xavier Morel 6b2b2d889c [IMP] move nonliteral domains and contexts to JS test case
bzr revid: xmo@openerp.com-20121123114923-t4047w6jztria91x
2012-11-23 12:49:23 +01:00
Xavier Morel 709f2506ff [REM] server-side eval_domain_and_context
bzr revid: xmo@openerp.com-20121123113932-siz0u2vp2u7z6wk2
2012-11-23 12:39:32 +01:00
Xavier Morel 49bd834725 [IMP] deferred init style
bzr revid: xmo@openerp.com-20121123101822-inox7gkxvd0gtqbp
2012-11-23 11:18:22 +01:00
Xavier Morel 7c09e23de7 [ADD] todo notes
bzr revid: xmo@openerp.com-20121123101658-xoynynruwnuzyrv3
2012-11-23 11:16:58 +01:00
Xavier Morel 242a5da5a9 [REM] stray logging
bzr revid: xmo@openerp.com-20121123095824-xg6afc1l01t3y48y
2012-11-23 10:58:24 +01:00
Xavier Morel 328537a7ba [ADD] arithmetics between date and timedelta
bzr revid: xmo@openerp.com-20121123095206-dtvoiignb7xnzsl0
2012-11-23 10:52:06 +01:00
Xavier Morel 815b908759 [ADD] partial but sufficient (I think) implementation of datetime.timedelta
bzr revid: xmo@openerp.com-20121123075938-oazwt4bn2l639r3a
2012-11-23 08:59:38 +01:00
Xavier Morel 9105afcd68 [FIX] put evaluation context in evaluation context
so you can access the context while you're accessing the context

bzr revid: xmo@openerp.com-20121122124130-t8j6sggtnl4f0b8r
2012-11-22 13:41:30 +01:00
Xavier Morel e6b77eb820 [IMP] shortcut call to eval_domain_and_context to be evaluated on the JS side, also add some offline-evaluation of contexts and domains in rpc call methods
bzr revid: xmo@openerp.com-20121011100532-5ihje0maslp37zpf
2012-10-11 12:05:32 +02:00
Xavier Morel b94e9c30a7 [FIX] after discussions with odo, date/datetime/time for locally-evaluated contexts and domains should be local, not UTC
bzr revid: xmo@openerp.com-20121011075759-qfwkfws5tu9yidab
2012-10-11 09:57:59 +02:00
Xavier Morel 1fa00288b2 [FIX] add 'context' free variable in evaluation contexts for domains and contexts
bzr revid: xmo@openerp.com-20121010145945-16shdry3udum0mn1
2012-10-10 16:59:45 +02:00
Xavier Morel 894bd34e62 [REM] timedelta, because pain
bzr revid: xmo@openerp.com-20121008125523-ed1g42vjxbcfo62r
2012-10-08 14:55:23 +02:00
Xavier Morel 7bcbadb099 [FIX] update py.js to 0.6, port existin classes to it, attempt to implement timedelta
bzr revid: xmo@openerp.com-20121008120619-lhmexjnujjrigjn9
2012-10-08 14:06:19 +02:00
Xavier Morel 10bc6ddfe4 [ADD] groupby eval tests
bzr revid: xmo@openerp.com-20121005142808-yx6o8nfnn0o4ms56
2012-10-05 16:28:08 +02:00
Xavier Morel 0e101c63a3 [FIX] evaluator: connection -> session
bzr revid: xmo@openerp.com-20121005131205-ffk746ac5xrua62j
2012-10-05 15:12:05 +02:00
Xavier Morel 6f4abdfbd5 [IMP] move eval functions for domains, groupbys and contexts outside of corelib, as well as the standard evaluation context building (and related objects)
bzr revid: xmo@openerp.com-20120806094627-8c9lwtfkbfws2bmj
2012-08-06 11:46:27 +02:00