Commit Graph

82 Commits

Author SHA1 Message Date
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
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
Thibault Delavallée df4665fcd2 [IMP] [CLEAN] [REVIEW] field._properties -> isinstance(field, fields.function).
bzr revid: tde@openerp.com-20121206091648-vmy2ghr293reoxn6
2012-12-06 10:16:48 +01:00
Thibault Delavallée a8359924c2 [IMP] expression.parse: added the support of domain on one2many fields when _auto_true is activated. Leaf creation from an existing leaf moved as a method in expression object. Added some comments. Added / updated some tests.
bzr revid: tde@openerp.com-20121204170744-rv8e0zlteqoyj60o
2012-12-04 18:07:44 +01:00
Thibault Delavallée 9e6c2805ab [REF] [IMP] expression.parse: refactored the main parsing loop, now using source and result stacks. Leaf elements are encapsulated into a specific object, allowing to delegate the join condition formation and aliases generation, as well as working_table management to them. The main parsing loop is now a loop taking a leaf, doing one action on it, and putting the result back to be analyzed or in the results. This allows to avoid having while loops inside a main while loop with some weird corner effects.
bzr revid: tde@openerp.com-20121204142650-gkhmjdeu5upi25kp
2012-12-04 15:26:50 +01:00
Thibault Delavallée 681d783234 [IMP] expression.parse: added some asserts about non supported cases.
bzr revid: tde@openerp.com-20121129165032-nnlnf1k0iwal24ny
2012-11-29 17:50:32 +01:00
Thibault Delavallée 47fda82264 [FIX] expression.parse: fixed indentation error preventing leafs to be correctly replaced in auto_join.
bzr revid: tde@openerp.com-20121128181258-cgmm7wqgv657iptb
2012-11-28 19:12:58 +01:00
Thibault Delavallée ac587f68fe [IMP] expression.py: added support of _auto_join in parse. The purpose is to add join clauses to queries instead of replacing many2one or one2many fields by id in ... equivalent leafs. This should lessen the number of executed queries, as well as the time required for some queries like mailboxes queries. Updated the generation of full table aliases when generating SQL, to avoid having a table having it own name as alias.
bzr revid: tde@openerp.com-20121128095042-x5rzgwydv0g9uy0m
2012-11-28 10:50:42 +01:00
Thibault Delavallée 9b196638cb [IMP] expression: replaced field paths now use an alias.field leaf style to prepare the inclusion of joins. In leaf_to_sql, handle this case accordingly.
bzr revid: tde@openerp.com-20121127170117-qlhfs0r1ned5uz3c
2012-11-27 18:01:17 +01:00
Thibault Delavallée 873d6cd5b1 [CLEAN] expression.py: self.__exp -> self.exp, because too much underscores kill my eyes. Added a bit of comments. Please note that the behavior has still not changed.
bzr revid: tde@openerp.com-20121127164531-hbsyhshmefdw0f93
2012-11-27 17:45:31 +01:00
Thibault Delavallée 07f26441bb [IMP] expression.parse: improved code about extracting inherits\'d fields. I do not like while True statements, I prefer having a clear condition. Behavior should still be the same as before.
bzr revid: tde@openerp.com-20121127163758-tddhbglygcbkvzed
2012-11-27 17:37:58 +01:00
Thibault Delavallée 48138c9d26 [IMP] [DOC] expression.py: renamed field_obj to relational_table, that make more sens to me. Added comments in the code to understand the algorithm. Please note that currently, no logic has been altered.
bzr revid: tde@openerp.com-20121127163014-5ww5mre6j7opmzp1
2012-11-27 17:30:14 +01:00
Thibault Delavallée 53efed664d [IMP] expression.py: _leaf_to_sql now uses a table_alias instead of table._table for query generation. Currently table_alias equals table._table, so the behavior has not changed.
bzr revid: tde@openerp.com-20121127161354-fskwsmfvx3j8nto6
2012-11-27 17:13:54 +01:00
Thibault Delavallée e147a5483f [CLEAN] expression.py: table_aliases now holds a list of aliases (names), and table_aliases_mapping does the mapping between a name and a table. The parsing algorithm now uses some accessors instead of directly accessing the data structures.
bzr revid: tde@openerp.com-20121127151113-zregov1i2isoll9z
2012-11-27 16:11:13 +01:00
Thibault Delavallée c1c5a85231 [CLEAN] expression.py: renamed some variables of expression; cleaned a bit the coding style (mainly spaces after commas).
bzr revid: tde@openerp.com-20121127150159-su9x00m7tc8tc6dj
2012-11-27 16:01:59 +01:00
Olivier Dony 361c0acd2a [FIX] expression: negative operators (e.g. NOT IN) where not working on o2m fields - tests added
bzr revid: odo@openerp.com-20121018124750-bkea51a7zkvwwygi
2012-10-18 14:47:50 +02:00
Xavier Morel aaff4459c4 [DOC] fixes and cleanups
bzr revid: xmo@openerp.com-20120928065654-jj3ot17dz8vd3wum
2012-09-28 08:56:54 +02:00
Xavier Morel ef26faf0a5 [IMP] add more information when searching on a non-searchable field using debug logging
bzr revid: xmo@openerp.com-20120802152553-r8xpw0g6bep08jod
2012-08-02 17:25:53 +02:00
Xavier Morel 8060f19108 [IMP] error-level log when non-stored function field without fnct_search is searched
holding off on blowing up an error just yet, but it might be a good idea in the end

bzr revid: xmo@openerp.com-20120802150837-3qvgg3e5pmfeqmk0
2012-08-02 17:08:37 +02:00
Vo Minh Thu f22f2fc770 [IMP] openerp.{modules,osv}: _logger with fully qualified module name.
bzr revid: vmt@openerp.com-20120124124252-91g3ysf33zsq4nhd
2012-01-24 13:42:52 +01:00
Olivier Dony c68045e497 [FIX] expression: properly care for implicitly defined m2m fields used in search() domains
Now that m2m fields may be defined without explicitly
specifying the name of the relationship table and its
foreign key columns, all access to these internal
names should be done via m2m._sql_names().
This seems better than lazily initializing these
internal names and hoping that nothing accesses
them before the init.

bzr revid: odo@openerp.com-20120119151012-c38k5zl7rqherhth
2012-01-19 16:10:12 +01:00
Vo Minh Thu b00473034a [IMP] typo.
bzr revid: vmt@openerp.com-20111109123042-9vtfp6uv7qsgy4pz
2011-11-09 13:30:42 +01:00
Olivier Dony 4140e3546a [FIX] expression: proper handling of empty string in m2o domain criterions
Also fixed incorrect name_search() implementations in
res.partner and res.currency, and added corresponding
tests.

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

bzr revid: odo@openerp.com-20111011163435-szj9vm6x9x8nryn8
2011-10-11 18:34:35 +02:00
Vo Minh Thu 25a883b2aa [FIX] expression: we dont add any restriction on the main ids
as the possible active=True/False is already present in the main domain.

bzr revid: vmt@openerp.com-20111005133337-p8nvv26tlii7x253
2011-10-05 15:33:37 +02:00
Yogesh (OpenERP) 07121a762b [MERGE]
bzr revid: ysa@tinyerp.com-20111005093709-u3rg6g10rcs7tf8f
2011-10-05 15:07:09 +05:30
Yogesh (OpenERP) 2fe1e8c0d8 [MERGE]
bzr revid: ysa@tinyerp.com-20111005093516-u8v7e58ndsyuxh9u
2011-10-05 15:05:16 +05:30
Yogesh (OpenERP) 36b97bc3d7 [MERGE] Merge wtih trunk server upto revision no 3722.
bzr revid: ysa@tinyerp.com-20111005091223-uznjimebpwh0r6a4
2011-10-05 14:42:23 +05:30
Olivier Dony 1bf74fa77e [MERGE] no-op merge of trunk, discarding osv-memory fix, obsolete already
bzr revid: odo@openerp.com-20110924022846-p08bawfxh5lym37u
bzr revid: odo@openerp.com-20110924025346-1khpike23e2honll
2011-09-24 04:53:46 +02:00
Olivier Dony dfccbaf28b [FIX] orm,expression: special-case previous commit for osv_memory
This will soon be obsolete and deleted, as soon
as osv_memory will be removed and merged inside
normal osv.

bzr revid: odo@openerp.com-20110924024928-awgncvhcyfkmnak5
2011-09-24 04:49:28 +02:00
Olivier Dony 67dcd97ea6 [FIX] orm,expression: sanity checks for domain terms, cleanup, tests
bzr revid: odo@openerp.com-20110924020303-2amkx95ij1yp8ofk
2011-09-24 04:03:03 +02:00
Vo Minh Thu 0c123711c5 [FIX] It is possible to mention an undeclared column in a domain.
Actually, this seems to be used for the logging columns
which are in database but not necessarily in _columns.
This is ugly and a warning is now issued.

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

bzr revid: vmt@openerp.com-20110923101839-ko0s7ekt4dlyvrx2
2011-09-23 12:18:39 +02:00
Olivier Dony 7d4cdb69f2 [IMP] orm: minor cleanup: avoid duplicate functions to do the same thing
bzr revid: odo@openerp.com-20110922172027-7kiae4yd2vuwwk6w
2011-09-22 19:20:27 +02:00
Olivier Dony 0d3085d14f [MERGE] sync with latest trunk
bzr revid: odo@openerp.com-20110922154155-jq811w768d9zfgim
2011-09-22 17:41:55 +02:00
Olivier Dony 1edacff497 [MERGE] unaccent support + domain parsing cleanup/improvements
bzr revid: odo@openerp.com-20110922140856-p8q0ib1lirgv1g02
2011-09-22 16:08:56 +02:00
Olivier Dony 9497814729 [IMP] expression: fix [(o2m,not in,...)] domains, re-enable tests, cleanup
bzr revid: odo@openerp.com-20110922005431-gnym5pormtjkfu8q
2011-09-22 02:54:31 +02:00
Olivier Dony c856d70bf5 [MERGE] sync latest trunk, including fixes for =like/=ilike
bzr revid: odo@openerp.com-20110921225225-zk98p2w1asoi2csl
2011-09-22 00:52:25 +02:00
Olivier Dony 6652943cd2 [IMP] minor cosmetic changes to improve readability and ease reviewing process
bzr revid: odo@openerp.com-20110921224423-h5hjnqrqgrp5hhau
2011-09-22 00:44:23 +02:00
Olivier Dony 886b7407de [FIX] osv.expression: fix =like/=ilike operators, broken by r.3631
Revision 3631 = vmt@openerp.com-20110920124252-l5snbvb7ywfogw1o

bzr revid: odo@openerp.com-20110921224208-mji81to3g4kpmkuq
2011-09-22 00:42:08 +02:00
Olivier Dony 6e4a93cd22 [MERGE] sync w/ latest trunk
bzr revid: odo@openerp.com-20110921162128-22sp59cn4xv983q5
2011-09-21 18:21:28 +02:00
Vo Minh Thu b4582815bc [MERGE] expression: support for =like/=ilike.
lp bug: https://launchpad.net/bugs/788106 fixed

bzr revid: vmt@openerp.com-20110920124252-l5snbvb7ywfogw1o
2011-09-20 14:42:52 +02:00
Olivier Dony c6370622e5 [FIX] orm: quote column names in queries to respect case and be consistent
Quoting column names make the case-sensitive in PostgreSQL,
and this is the default strategy we are using so far. It is
important to be consistent there.
We might want to do the same to table names too.
This allows create fields with mixed cases names for example.

bzr revid: odo@openerp.com-20110919201845-heer0rttcouvtc9x
2011-09-19 22:18:45 +02:00
Vo Minh Thu ddd65ab5c1 [REF] osv: removed orm_memory, adapted the distinguished bits to osv_memory,
so yes, there are still two user-visible classes instead of a boolean flag.

bzr revid: vmt@openerp.com-20110812124128-43rr422swy6h2vs8
2011-08-12 14:41:28 +02:00