Commit Graph

122 Commits

Author SHA1 Message Date
Christophe Simonis 47b2f7ea9e [MERGE] forward port of branch 7.0 up to 3a1c693 2015-12-08 12:16:00 +01:00
Jeremy Kersten 3a1c693259 [FIX] osv: fix boolean in domain for custom field
When a new column has been added after that some data already exists,
the old lines will keep an empty/null value. So when we search is the new field
is equals to False or if it is different of True, we need to match the null
values.

Backport of de3b64018a
2015-12-04 18:22:32 +01:00
Denis Ledoux dd8cbf49ac [MERGE] forward port of branch 7.0 up to d24fcd1 2015-11-06 16:04:21 +01:00
Raphael Collet c28a28e69e [IMP] osv: use iteration for expression negating
The current code when applying negative operator on an expression used
recursion which in extreme case is not best friend with python.

e.g: on instance with a lot of wharehouse, some simple action could lead
to a domain with lot of elements which could easiliy go over the python
maximum recursion limit.

This commit fixes this by replacing recursion with iteration.

We have a stack of negation flags and loop on each token of the domain
as follow :

- when we iterate on a leaf, it consumes the top negation flag,

- after a '!' operator, the top token negation is inversed,

- after an '&' or '|' operator, the top negation flag is duplicated on
  the top of the stack.

closes #9433
opw-653802
2015-11-05 17:13:28 +01:00
Olivier Dony 9cdfb0696a [MERGE] Forward-port 7.0 up to 6acd5ef91c 2015-06-23 15:13:47 +02:00
Olivier Dony 6acd5ef91c [FIX] expression: internal domain operators require different parsing
Ensure the absence of internal domain operators is correctly
propagated throughout the domain parsing.
2015-06-23 15:04:45 +02:00
Christophe Simonis b62ee0734c [MERGE] forward port of branch 7.0 up to eaaca65 2015-05-21 14:11:39 +02:00
Denis Ledoux 54a90179bb [FIX] expression: ensure tuple to compare leaf with TRUE/FALSE leaf
When setting a custom filter with as domain
[(0, '=', 1)]

the domain was rejected, because (0, '=', 1) wasn't
considered as a valid leaf, while it is.

This is because the Javascript converts this domain
using list instead of tuple
[(0, '=', 1)] -> [[0, '=', 1]]

And therefore, comparing the "list" leaf
to the TRUE/FALSE leaf tuple failed.

Ensuring "element" as a tuple solves the issue.

opw-640306
2015-05-20 15:33:35 +02:00
Christophe Simonis a1b3e22a17 [MERGE] forward port of branch 7.0 up to 4bfcbb2 2014-06-25 11:35:11 +02:00
Mohammed Shekha 0b593ada11 Server Translation: Fixed the issue search on translated field do not return true result, search on tranlsated field fails due to expression parsing which fetches ids from ir_translation as well as working table and UNION of this makes search fruitless, also search fails for in language other then english when you enter part of a string for the field to search. 2014-06-24 17:42:48 +05:30
Christophe Simonis 3d2e9b4d2b [MERGE] forward port of branch 7.0 up to revid 5281 launchpad_translations_on_behalf_of_openerp-20140412094159-mhy3v2prb3ctx32k
bzr revid: jke@openerp.com-20140409153527-mic1a8afcvdhsd27
bzr revid: chs@openerp.com-20140410102422-fcwxhjk40z0oy8x5
bzr revid: chs@openerp.com-20140415133650-y46i0o3qkb2atbvi
2014-04-15 15:36:50 +02:00
jba 1578776814 [FIX] expression: when evaluatoing *like operator, add cast to text to column in case of different type
bzr revid: mat@openerp.com-20140409144346-nbn0dno3bs6ozwk5
2014-04-09 16:43:46 +02:00
Christophe Simonis 120342d537 [MERGE] forward port of branch 7.0 up to revid 5274 chs@openerp.com-20140404141611-qi1yagltvkd9q8ji
bzr revid: chs@openerp.com-20140404155858-mvupqmuvi8ime2tl
2014-04-04 17:58:58 +02:00
Christophe Simonis bcf36e6deb [IMP] expression: new helper for generating unaccent aware sql queries. Adapt _auto_join tests to use it.
bzr revid: chs@openerp.com-20140404141559-d2sn68lruik9hz81
2014-04-04 16:15:59 +02:00
Olivier Dony 63b8fe0d33 [FIX] domain parsing: better heuristic when a domain uses a date value for a datetime field
This comparison is flawed by nature but can be a useful
shortcut sometimes. It was using wrong boundaries and
would also loop for operators not explicitly handled
by the code (there was no `else` block). It is still
not possible to handle time zone conversions properly,
so this is only an experimental feature.

bzr revid: odo@openerp.com-20140404133827-5owdendpsr083a17
2014-04-04 15:38:27 +02:00
Christophe Simonis 6fca27626a [FIX] expression: do not double quote column names
bzr revid: chs@openerp.com-20140403084524-9rb174osjrbmhgwc
2014-04-03 10:45:24 +02:00
Christophe Simonis 19993ab1d5 [FIX] expression: translated search as params are flatten, we need to expand "%s" placeholders when using the `in` operator
bzr revid: chs@openerp.com-20140402112730-eoqxt0pu7lvcq5yg
2014-04-02 13:27:30 +02:00
Christophe Simonis 4978cf4293 [MERGE] forward port of branch saas-2 up to revid 5025 chs@openerp.com-20140403084808-slnj7uis17kwi9js
bzr revid: chs@openerp.com-20140403085050-0blat5jm87j9gkbb
2014-04-03 10:50:50 +02:00
Christophe Simonis 1c3ee251f0 [MERGE] forward port of branch 7.0 up to revid 5270 chs@openerp.com-20140403084524-9rb174osjrbmhgwc
bzr revid: chs@openerp.com-20140402083506-w4cywcf0kxxx9xmk
bzr revid: chs@openerp.com-20140312174526-a5rhh83g0fw8djuc
bzr revid: chs@openerp.com-20140318105837-53vsx5g7fm517cuc
bzr revid: dle@openerp.com-20140326092548-bu4bqinhvco8j5wj
bzr revid: chs@openerp.com-20140402092735-3a23yjl169vvt0iv
bzr revid: chs@openerp.com-20140402112825-ky8rcb3p467ikitc
bzr revid: chs@openerp.com-20140403084808-slnj7uis17kwi9js
2014-04-03 10:48:08 +02:00
Christophe Simonis 7c9db05d1e [MERGE] forward port of branch saas-2 up to revid 5024 chs@openerp.com-20140402112825-ky8rcb3p467ikitc
bzr revid: chs@openerp.com-20140402093016-rcl15e5vpdj7ishv
bzr revid: chs@openerp.com-20140402114823-4mncr059d9ms8v3t
2014-04-02 13:48:23 +02:00
Christophe Simonis dfe28ec31f [FIX] expression: use unaccent() for translated search
lp bug: https://launchpad.net/bugs/1049653 fixed

bzr revid: chs@openerp.com-20140331123012-dq3hsw2bc368zvgq
2014-03-31 14:30:12 +02:00
Christophe Simonis a69f789b41 [MERGE] forward port of branch 7.0 up to revid 5224 chs@openerp.com-20140206105141-7e8bv8ordqqsswh7
bzr revid: dle@openerp.com-20140205105045-j95kduyjiq83e57z
bzr revid: dle@openerp.com-20140114173613-ruxye1m7fxtcjfim
bzr revid: dle@openerp.com-20140116161158-u95vcs3os4tk2zob
bzr revid: dle@openerp.com-20140121172737-gzawfi3ssg7xifef
bzr revid: chs@openerp.com-20140129094554-c3abc8x3qz9mpszr
bzr revid: chs@openerp.com-20140129140159-9vwkpr078shoonum
bzr revid: chs@openerp.com-20140206110220-myn57cryam1y4k9v
2014-02-06 12:02:20 +01:00
Christophe Simonis 378c908d4c [MERGE] forward port of branch saas-2 up to revid 5006 chs@openerp.com-20140129140159-9vwkpr078shoonum
bzr revid: chs@openerp.com-20140129094847-4rsg0kjio0ed0rjk
bzr revid: chs@openerp.com-20140129141002-4p8fttm8ii0ogsse
2014-01-29 15:10:02 +01:00
Martin Trigaux f2b2ee8eae [FIX] expression: do not look at translation in parse when searching with empty string or false
This fixes traceback when applying filter 'is not set' on a translatable field

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

bzr revid: mat@openerp.com-20140127144913-qjh9hrnkfdn18sdb
2014-01-27 15:49:13 +01:00
Christophe Simonis 0771ca2692 [MERGE] forward port of branch saas-2 up to revid 5002 dle@openerp.com-20140114173613-ruxye1m7fxtcjfim
bzr revid: chs@openerp.com-20140115205357-arptzm69logz3osm
2014-01-15 21:53:57 +01:00
Denis Ledoux 05aab83eb1 [MERGE] Forward-port of latest 7.0 bugfixes, up to rev. 9743 revid:qdp-launchpad@openerp.com-20140108160719-9i8xhrat49cn9l5e
bzr revid: chs@openerp.com-20140107141524-xzz39a2ym66swr0t
bzr revid: chs@openerp.com-20140107172248-zic9mqg0rigy2czb
bzr revid: chs@openerp.com-20140108160418-ph17jgy5hlejj9hr
bzr revid: dle@openerp.com-20140108171400-8r0fwv3wi36w2im0
2014-01-08 18:14:00 +01:00
Christophe Simonis 7f8b6542f0 [FIX] expression: allow exclusion of records with translated fields
lp bug: https://launchpad.net/bugs/1071710 fixed

bzr revid: chs@openerp.com-20140108152722-7f0dpsuv1skxbqub
2014-01-08 16:27:22 +01:00
Christophe Simonis 9675445dee [FIX] expression: allow exclusion of records with translated fields
Manual forwardport of revid 4369 chs@openerp.com-20140107112227-sc1ssd1dw404vcz2 of 6.1 branch

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

bzr revid: chs@openerp.com-20140107130840-igmm8sy03nrm5d5f
2014-01-07 14:08:40 +01:00
Quentin (OpenERP) bdda7b70d3 [FIX] expression.py: when searching on a datetime field with an argument formated as a date, conversion should happen _also_ for the '=' operator. This omission was causing an infinite loop beacuse we were pushing the exact same leaf on the stack without any modification
bzr revid: qdp-launchpad@openerp.com-20131104134314-2mv5wkt13ih9c1yg
2013-11-04 14:43:14 +01:00
Raphael Collet 7358cec8dc [FIX] expression: in nodes like (left, 'in', right), apply _symbol_set on all values in right
bzr revid: rco@openerp.com-20131003075351-5quyz6ge1ayczdo9
2013-10-03 09:53:51 +02:00
Olivier Dony fbd0758cb5 [MERGE] Forward-port of latest 7.0 bugfixes, up to rev. 5054 rev-id: odo@openerp.com-20130820091157-e5brwlxuhujf8rrd
bzr revid: chs@openerp.com-20130724085026-525l9apggc9yzx0h
bzr revid: odo@openerp.com-20130730140644-1xih0as5jsks4pub
bzr revid: dle@openerp.com-20130801130723-khgwjkglgsdn34fj
bzr revid: odo@openerp.com-20130820091638-jpbcmh653bpa29em
2013-08-20 11:16:38 +02:00
Christophe Simonis 03381c761d [FIX] expression: a valid leaf must have a non empty string as first element or be the magic TRUE_LEAF/FALSE_LEAF
lp bug: https://launchpad.net/bugs/1197323 fixed

bzr revid: chs@openerp.com-20130719091903-28ez0txxyjh6qiii
2013-07-19 11:19:03 +02:00
Thibault Delavallée 1d5068b63e [FORWARD] Forward port of server 7.0 until revision 4988
bzr revid: tde@openerp.com-20130528102733-bsszxp6nvy8yws3t
2013-05-28 12:27:33 +02:00
Martin Trigaux 8ecd022348 [IMP] clean permissions and shebang in files
bzr revid: mat@openerp.com-20130514103333-puuj4kmxq3bwzwec
2013-05-14 12:33:33 +02:00
Christophe Simonis 60f0bd08ee [FIX] expression: allow creating child_of expression even if "id" field has been redefined, courtesy of Gustavo Adrian Marino
lp bug: https://launchpad.net/bugs/1030942 fixed
lp bug: https://launchpad.net/bugs/1131992 fixed

bzr revid: chs@openerp.com-20130423181926-yk628txd6yiybtko
2013-04-23 20:19:26 +02:00
Raphael Collet 05851d21ba [MERGE] from trunk
bzr revid: rco@openerp.com-20130411073017-x6e4h8xbvmy3ofdw
2013-04-11 09:30:17 +02:00
Vo Minh Thu 307ca374d6 [MERGE] forward merge 7.0 until revision 4919.
bzr revid: vmt@openerp.com-20130404130704-24vsmczw34cssytd
2013-04-04 15:07:04 +02:00
Raphael Collet 09be864f1d [IMP] replace all tests like 'registry.get(X)' by 'X in registry' where X is non static
bzr revid: rco@openerp.com-20130329140723-dnrl02saky570xg0
2013-03-29 15:07:23 +01:00
Vo Minh Thu c99c4091ce [REM] Deleted .apidoc lines.
They were probably used by some tools. How sad.

bzr revid: vmt@openerp.com-20130212142410-zqdjd8jw3gtvxab0
2013-02-12 15:24:10 +01:00
Olivier Dony 41598ef041 [FIX] orm.expression: `=?` domain operator broken after 7.0 refactoring ; + added tests
lp bug: https://launchpad.net/bugs/1095635 fixed

bzr revid: odo@openerp.com-20130321173737-a0j330ro4i223fkb
2013-03-21 18:37:37 +01:00
Quentin (OpenERP) d97916a063 [IMP] expression.py: added a clue to debug fuzzy tracebacks related to domain badly written
bzr revid: qdp-launchpad@openerp.com-20130306152328-qdlil19diks4mvkt
2013-03-06 16:23:28 +01:00
Raphael Collet 39fe69babe [FIX] expression: avoid delitem on a tuple
bzr revid: rco@openerp.com-20121217134559-cjc0b4ncs1drupn7
2012-12-17 14:45:59 +01:00
Xavier Morel d0a377cb1c [FIX] incorrect docstrings or docstring param names not matching actual param names
bzr revid: xmo@openerp.com-20121214130758-a2wp963w4djmb02k
2012-12-14 14:07:58 +01:00
Xavier Morel c6079dd6bb [REM] unnecessary parens
bzr revid: xmo@openerp.com-20121214123803-6xu2s1ndnoyj4i3e
2012-12-14 13:38:03 +01:00
Thibault Delavallée 9381a82715 [IMP] Added an assert on the alias length.
bzr revid: tde@openerp.com-20121207160933-1ivbkkv6tgg5a7x3
2012-12-07 17:09:33 +01:00
Thibault Delavallée 50cf6d4008 [CLEAN] Query: cleaned a bit the code. All joins now goes through the same method, either implicit or explicit. Will have to be upgraded in future versions, but at least this is a bit centralized. Updated ORM accordingly. Updated tests. Added a get_alias_from_query method in expression that find the table and the alias from a 'full alias' statement.
bzr revid: tde@openerp.com-20121207154204-mx036lpj3vdclu77
2012-12-07 16:42:04 +01:00
Thibault Delavallée 390ff1540f [CLEAN] expression.py: cleaned and added comments, var names (table -> model notably).
bzr revid: tde@openerp.com-20121207123727-md65da41863y827e
2012-12-07 13:37:27 +01:00
Thibault Delavallée e36b44e82f [IMP] [WIP] order_by: now using aliases in _generate_order_by, _generate_o2m_order_by, _inherits_join_add, ... added some tests. Next comits will clean a bit the code, because currently it is a bit messy.
bzr revid: tde@openerp.com-20121207115424-x8gkjcqpi8dz96g2
2012-12-07 12:54:24 +01:00
Thibault Delavallée bb57752f0a [IMP] [CLEAN] [REVIEW] expression: udpated domain management. Added pop and push methods in parse to hide the internal plumbery. Cleaned some comments, deleted dead/unnecessary code, updated some comments. to_ids and childof_domain back in parse. Added generate_table_alias, method that should be used everywhere if possible when generating table name or aliases for sql conditions and things like that.
bzr revid: tde@openerp.com-20121206162128-1qol201os1xztlz5
2012-12-06 17:21:28 +01:00
Thibault Delavallée a0b8a58174 [IMP] [REVIEW] _auto_join on many2many now raises a NotImplementedError; added a test case for that.
bzr revid: tde@openerp.com-20121206092745-a8t62khs4x37db1g
2012-12-06 10:27:45 +01:00