Commit Graph

217 Commits

Author SHA1 Message Date
Denis Ledoux f652402dd7 [FIX] web: read_ids of data.js use method search_read if check_access_rule option is true.
This fix is related to revision 3985 revid:dle@openerp.com-20140326142040-pls0dk2kd03z55ro, which did not worked for buffered dataset (virtual one2many line in view form
search_read is used instead of read to not return records for which we lose the access rights

bzr revid: dle@openerp.com-20140327112456-iyceuf9dnn07hwke
2014-03-27 12:24:56 +01:00
Olivier Dony e80a179d02 [FIX] search widgets: m2o autocompletion had been disabled when @operator or @filter_domain were set, but it was actually useful
Was disabled at rev 3878 revid:xmo@openerp.com-20131107111231-nkrllqv0afqdmix6

bzr revid: odo@openerp.com-20140326170818-sc5hqnmq89ayufso
2014-03-26 18:08:18 +01:00
Denis Ledoux 7acaaf5894 [FIX] web: use search_read instead of read on form reload and record reload in list, to check if the user can still read the record
bzr revid: dle@openerp.com-20140326142040-pls0dk2kd03z55ro
2014-03-26 15:20:40 +01:00
Xavier Morel cdc83a0763 [FIX] dataset.read_ids should always return records in the order of the parameter ids
BufferedDataSet.read_ids assumes the input and output orders are the same, and
returns wonky results when not the case, which in turns fucks up its cache as
it associates ids and records incorrectly.

bzr revid: xmo@openerp.com-20140225162813-8ofxpiy1012eehgk
2014-02-25 17:28:13 +01:00
Xavier Morel e9a3d8bcec [FIX] enable jsonrpc-auth tests, remove stray log
bzr revid: xmo@openerp.com-20140131154147-oi30v8u8h3c3htx7
2014-01-31 16:41:47 +01:00
Antony Lesuisse f051043a26 [MERGE] trunk-website-al
bzr revid: al@openerp.com-20140131005202-sjsfy3tc8ys1a325
2014-01-31 01:52:02 +01:00
Antony Lesuisse 698d02e3b5 web disable jsonrpc test
bzr revid: al@openerp.com-20140131003956-jo9grgfizich2dlu
2014-01-31 01:39:56 +01:00
Martin Trigaux 802d64ca92 [MERGE] [ADD] ways to correctly handle local datetimes in e.g. domains
* Alter datetime.now(), generate a local datetime (add utcnow() which generates a UTC datetime)
* Implement datetime.replace() to manipulate local datetimes
* Implement date.today(), generates a local date
* Implement datetime.toJSON(), returns a javascript Date (assumes datetime attributes are local)
* Add conversion hook in JSON and JSONP handlers, automatically converts a Date object to a UTC datetime formatted according to server formats

Should allow the generation of correctly working (from the end-user's POV) [Today] filters, amongst other things.
Eg: a local expression in a domain for 'Today 00:00:00' would now be expressed as 'datetime.datetime.now().replace(hour=0, minute=0, second=0)' (no .strftime) and will be converted to UTC when sent to the server

bzr revid: mat@openerp.com-20140128133706-4yp610pp5w06tcia
2014-01-28 14:37:06 +01:00
Xavier Morel 5b7ade9db1 [ADD] ways to correctly handle local datetimes in e.g. domains
* change datetime.now() to generate user-local naive datetimes
* add datetime.utcnow() behaving as the old now()
* add date.today() generating a user-local date (for the current day)
* add datetime.replace() to replace any specific attribute of the
  datetime object (except tzinfo, for now)
* datetime.toJSON() now returns the equivalent javascript Date object
  (warning: uses the datetime attributes directly, since datetimes are
  naive if they were created with utcnow() the Date result is going to
  be complete nonsense). With the previous commit datetime.now()
  generates a user-local now() which is converted to the correct UTC
  datetime when sent to the server.

This means it becomes possible to generate datetime bounds for the
user's local today with either

    datetime.datetime.now().replace(hour=0, minute=0, second=0)

or

    datetime.datetime.combine(
        datetime.date.today(),
        datetime.time())

and once send over JSON-RPC the server will get the local datetime
in UTC to the server's format.

nb: user-local means "in the timezone of the user's browser" in this
context.

bzr revid: xmo@openerp.com-20140122151911-akn1nr6e739eg92s
2014-01-22 16:19:11 +01:00
Gery Debongnie c0c686cd15 [FIX] changes test definition to have the correct number of assertions (addon web)
bzr revid: ged@openerp.com-20140113080856-7h6cnlh675vgi8s2
2014-01-13 09:08:56 +01:00
Gery Debongnie 716d888aaf [IMP] separates a facet test into smaller tests to have better information (addon web)
bzr revid: ged@openerp.com-20140110150836-xgk11tcimhmgpl9z
2014-01-10 16:08:36 +01:00
Xavier Morel fb911b1d43 [FIX] don't provide autocompletion to m2o fields when a custom operator or filter_domain is provided
bzr revid: xmo@openerp.com-20131107111231-nkrllqv0afqdmix6
2013-11-07 12:12:31 +01:00
Christophe Simonis 88292396c7 [MERGE] forward port of branch saas-2 up to revid 3865 chs@openerp.com-20131031111945-u3wi11e4rykpslme
bzr revid: chs@openerp.com-20131030183314-d75tbpxjjk3u79er
bzr revid: chs@openerp.com-20131031144026-09f3eqfwfj2bcefs
2013-10-31 15:40:26 +01:00
Christophe Simonis 12e262e5c9 [FIX] web: correct "date(time) on 31" tests
bzr revid: chs@openerp.com-20131031111945-u3wi11e4rykpslme
2013-10-31 12:19:45 +01:00
Christophe Simonis d9ca536396 [FIX] web: correct date and datetime parsing at end of month.
As `new Date()` return the current date, when we are the 31,
setting the month to a month with less than 31 days will change
the date to next day (1st of next month). This result to a date(time)
object one month ahead of the wanted date(time).

bzr revid: chs@openerp.com-20131031103333-vt68132ptj9sbr04
2013-10-31 11:33:33 +01:00
Denis Ledoux 6bf5d02627 [MERGE] Forward-port of latest saas-2 bugfixes, up to rev. 3859 rev-id: dle@openerp.com-20131023110926-tc2n3oqg0l2ga138
bzr revid: dle@openerp.com-20131023113414-mlwppd4d7vyh1tyj
2013-10-23 13:34:14 +02:00
Denis Ledoux 3279b24128 [MERGE] Forward-port of latest saas-1 bugfixes, up to rev. 3748 rev-id: dle@openerp.com-20131023103308-18pj2gqq3imrcir7
bzr revid: dle@openerp.com-20131023110926-tc2n3oqg0l2ga138
2013-10-23 13:09:26 +02:00
Denis Ledoux 4e0530f16c [FIX]web: test testing the customer filter save was wrong, was using wrong method text() instead of val() to set the filter name
bzr revid: dle@openerp.com-20131022165318-2imkhgb6iecalbbi
2013-10-22 18:53:18 +02:00
niv-openerp 6475f3225d Removed jsonprpc2 test because it fails in phantomjs
bzr revid: nicolas.vanhoren@openerp.com-20131011133208-gjz0iprk63447qub
2013-10-11 15:32:08 +02:00
niv-openerp 083d3fc91e Added tests about timeouts and implemented it in jsonprpc2
bzr revid: nicolas.vanhoren@openerp.com-20131011133054-0dx3wxqcqbdocnlf
2013-10-11 15:30:54 +02:00
niv-openerp e059b1c5c0 Added test with openerp sessions
bzr revid: nicolas.vanhoren@openerp.com-20131011123416-wsfr0g1pusa0wftp
2013-10-11 14:34:16 +02:00
Olivier Dony a382a62555 [FIX] Revert data.js test that was not reverted along with the corresponding patch in previous commit
See also reverted commit revid:nicolas.vanhoren@openerp.com-20130805130458-21w806v9wc456oq4

bzr revid: odo@openerp.com-20130906154422-jkdf2v2stgcd6akx
2013-09-06 17:44:22 +02:00
niv-openerp 2e6d38f068 [IMP] Moved the date formatting functions in openerpframework.js
bzr revid: nicolas.vanhoren@openerp.com-20130808134520-v0n2b29vuffstyu0
2013-08-08 15:45:20 +02:00
niv-openerp c63a86c593 [IMP] Merged corelib.js and coresetup.js into core.js
bzr revid: nicolas.vanhoren@openerp.com-20130806122623-pq6bpkjk65jx0fnp
2013-08-06 14:26:23 +02:00
niv-openerp cb55e11c70 Put everything in the framework directly in the openerp namespace instead of the openerp.web namespace.
bzr revid: nicolas.vanhoren@openerp.com-20130806085812-ek8v8k0x4m7ocu4f
2013-08-06 10:58:12 +02:00
niv-openerp ab4d080450 Desactivated some tests that, once again, do not work in the runbot
bzr revid: nicolas.vanhoren@openerp.com-20130805140404-x15shdy1a4b3zqvk
2013-08-05 16:04:04 +02:00
niv-openerp 07617fef45 Added tests for the models
bzr revid: nicolas.vanhoren@openerp.com-20130805134548-n6j48iv7823u3eh7
2013-08-05 15:45:48 +02:00
niv-openerp 226b142ac6 Simplified a little the Query class by removing a reference to a controller and using call_kw instead
bzr revid: nicolas.vanhoren@openerp.com-20130805130458-21w806v9wc456oq4
2013-08-05 15:04:58 +02:00
niv-openerp 70e3af6312 Desactivated some tests because the phantomjs runner crashed
bzr revid: nicolas.vanhoren@openerp.com-20130805125045-q1x1bciwcdyabg8v
2013-08-05 14:50:45 +02:00
niv-openerp 14fccd0a4e Even more tests
bzr revid: nicolas.vanhoren@openerp.com-20130805114034-7xcpjmses5aodjhr
2013-08-05 13:40:34 +02:00
niv-openerp a6ea300848 Added some tests about authentication
bzr revid: nicolas.vanhoren@openerp.com-20130805113928-yldn5qh2lm0vc8j9
2013-08-05 13:39:28 +02:00
niv-openerp 22c56b1dd8 Ported some authentication methods to the Session class
bzr revid: nicolas.vanhoren@openerp.com-20130805111250-ws23n3b6os54qsp3
2013-08-05 13:12:50 +02:00
niv-openerp 85b2238472 minor improvements
bzr revid: nicolas.vanhoren@openerp.com-20130805101849-rqqx4jcmbymv5hfl
2013-08-05 12:18:49 +02:00
niv-openerp ab03d9c280 Make the three jsonrpc protocols work correctly with and without session overriding and added tests for all the cases.
That's one small step for a man, a giant leap for all the poor programmers that would have to use that shit one day.

bzr revid: nicolas.vanhoren@openerp.com-20130802150815-k2yuf0b3ku5fvx7a
2013-08-02 17:08:15 +02:00
niv-openerp adc722348c Made the 2-steps jsonp rpc work more or less
bzr revid: nicolas.vanhoren@openerp.com-20130802143223-49mf5dayd8ape1a5
2013-08-02 16:32:23 +02:00
niv-openerp cc04d9463e Added more tests
bzr revid: nicolas.vanhoren@openerp.com-20130801164207-wwv34s2fgtlxbzxz
2013-08-01 18:42:07 +02:00
niv-openerp 49f20eb39e Added some tests for jsonrpc
bzr revid: nicolas.vanhoren@openerp.com-20130801163221-uat5w2j1p5t9m5ve
2013-08-01 18:32:21 +02:00
Xavier Morel adfe3e7ec9 [FIX] reinstate basic grouping test, replace strictEqual call on widgets by ok(===)
There seems to be a problem with QUnit's serialization routines when
applied to complex widgets (the view here) while running inside
PhantomJS. It does not seem to be cycles in datastructures (that is
handled) but looks related to complex objects linked from multiple
"children" (skipping any object already serialized makes the issue
disappear).

The bug leads to unbounded memory growth, and on runbot to the process
being summarily terminated (likely by the OOM killer) not even
resulting in an OOM error (which is displayed locally). The issue can
not be observed within browsers. This may be a difference in GC
strategy.

The serialization is applied by the driver on high-level comparison
methods (e.g. strictEqual) so the caller can display the structures if
desired.

Replace the strictEqual(a, b) call by ok(a === b) to avoid any risk of
such serialization.

bzr revid: xmo@openerp.com-20130801091326-u2q9e163zls4k8ad
2013-08-01 11:13:26 +02:00
Xavier Morel e57e50fdfa [FIX] unneeded & dangerous start call in async test
bzr revid: xmo@openerp.com-20130801091130-vx7ow7vxifu7ak84
2013-08-01 11:11:30 +02:00
niv-openerp 46869ba52d [FIX] desactivated test creating random false positive
bzr revid: nicolas.vanhoren@openerp.com-20130731133504-vt2fx11jziyad47e
2013-07-31 15:35:04 +02:00
niv-openerp 4ec2906626 [FIX] attempt to solve false-positive in js tests on the runbot
bzr revid: nicolas.vanhoren@openerp.com-20130731131933-ur5vdahgnbjsj16o
2013-07-31 15:19:33 +02:00
niv-openerp 95599aefd4 Corrected class tests
bzr revid: nicolas.vanhoren@openerp.com-20130726160845-z2ug9cwp41y1h9yj
2013-07-26 18:08:45 +02:00
niv-openerp e01b96e762 Put class and widgets tests in framework.js
bzr revid: nicolas.vanhoren@openerp.com-20130726160715-adjyalkubyismvao
2013-07-26 18:07:15 +02:00
niv-openerp 89a9ab8cd0 Now uses only openerpframework in widget's tests
bzr revid: nicolas.vanhoren@openerp.com-20130726160315-l60r6z706urv2hga
2013-07-26 18:03:15 +02:00
niv-openerp a02da32a08 Changed some testing code creating side effects and making other tests crash
bzr revid: nicolas.vanhoren@openerp.com-20130726143647-rz01o0cnwm2a1gyo
2013-07-26 16:36:47 +02:00
niv-openerp 38bc6817d6 Fixed problem with parsing functions tests that created side effects
bzr revid: nicolas.vanhoren@openerp.com-20130726133550-96zyro1znep8ip6x
2013-07-26 15:35:50 +02:00
niv-openerp 17ba69eb52 Applied jshint on test files and corrected errors
bzr revid: nicolas.vanhoren@openerp.com-20130725112416-j6wbm254yx05i890
2013-07-25 13:24:16 +02:00
Christophe Simonis 713b00d477 [MERGE] forward port of branch saas-1 up to revid 3740 chs@openerp.com-20130702141958-zxkppo4c6zvpo0uf
bzr revid: chs@openerp.com-20130702145352-dym8zvfkwzb3qiqa
2013-07-02 16:53:52 +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
Olivier Dony dc24794855 [FIX] web: support integer/float fields in search view via auto-completion + tests
integer/float fields were not offering auto-completion in search views,
making them unsearchable except via advanced search.
This patch adds the missing complete() function and removes the incorrect
value_from() function that did not conform to the 7.0 search view API.
It seemed to be a leftover of the 6.1 search field implementation
of get_value(), wrongly renamed for 7.0.

Also includes corresponding tests.

bzr revid: odo@openerp.com-20130418112001-388op1t8ugr0rhfn
2013-04-18 13:20:01 +02:00