Commit Graph

1165 Commits

Author SHA1 Message Date
Raphael Collet 2d2274aeed [FIX] module loading: manual x2x fields can now refer to manual models
The fix consists in this: when setting up models, ignore manual fields that
refer to unknown models if all models have not been loaded yet.
2014-08-04 15:10:12 +02:00
Olivier Dony b7814943c3 [MERGE] Forward-port saas-3 up to 7273474 2014-08-01 23:14:59 +02:00
Olivier Dony 7273474d65 [MERGE] Forward-port saas-3 up to fc92027 2014-08-01 23:10:29 +02:00
Olivier Dony 5a0a500994 [MERGE] Forward-port 7.0 up to 9411a2da 2014-08-01 23:01:57 +02:00
Olivier Dony 9411a2da03 [FIX] Model.load(): extra error checking while importing data
If any missing or partially incorrect values cause
an exception other than a psycopg2 error, we should
still catch it, rollback that record and report
the error, rather than letting bubble and fail
without any feedback to the user.

Fixes #1485
2014-08-01 22:42:01 +02:00
dhr-odoo eb775fc2ea [FIX] orm: set default before removing magic fields
When a record is created, the magic fields (id, create_date,...) are first removed from the vals as the user should not set a value for these.
However if a value for this is given in default value (e.g. defined in an ir.value), the creation would crash (sql error : column specified more than once) as the magic column would be added again.
2014-08-01 15:37:01 +02:00
Olivier Dony ee4df1e397 [MERGE] Forward-port saas-4 up to 8b15482 2014-08-01 13:06:49 +02:00
Olivier Dony 8b15482e00 [MERGE] Forward-port saas-3 up to e79a367 2014-08-01 12:54:30 +02:00
Olivier Dony e79a3675d1 [FIX] orm.search_count: ignore `limit`, `offset` and most importantly `order`
These parameters are (or should be) irrelevant for
a search_count(), and they could actually break the
result or make it significantly slower (e.g applying
`order` on large tables).
This fixes a performance regression introduced by
0f43032b.

We could also raise an error offset/limit are
passed in combination with count, but that seems
unnecessary.

Also switched to "SELECT count(1)" for the count
query, as it is simpler and just as fast.
We'd get the same perf with * or any constant value,
as in "SELECT count('me in')", but let's keep it
simple ;-)
2014-08-01 12:34:45 +02:00
Olivier Dony 924e4b1a08 [MERGE] Fwd-port saas-4 up to e31fd6a 2014-07-11 12:00:42 +02:00
Olivier Dony e31fd6a1e1 [MERGE] Fwd-port saas-3 up to a9d2b65 2014-07-11 11:53:07 +02:00
Olivier Dony a9d2b65da5 [MERGE] Fwd-port 7.0 up to 783b9e1 2014-07-11 11:51:06 +02:00
Martin Trigaux 437116f3c4 [FIX] orm: custom m2m with different label
At rev 84e9a67cdf a check to avoid the creation of ir.model.relation for custom modules was added. The condition is not correct as based on the string instead of the field name. We do not have access to column name at this level but the the m2m relation table do start with x_ for custom fields (see __init__ method).
2014-07-11 11:39:32 +02:00
Christophe Simonis 73d39a0c8c [MERGE] forward port of branch saas-4 up to a361947 2014-07-10 22:12:16 +02:00
Christophe Simonis a361947143 [MERGE] forward port of branch saas-3 up to a35aec2 2014-07-10 22:02:58 +02:00
Christophe Simonis a35aec2a0b [MERGE] forward port of branch 7.0 up to 6e96ffd 2014-07-10 22:02:01 +02:00
Martin Trigaux 84e9a67cdf [FIX] orm: better removal of custom m2m fields
orm: do not try to create ir.model.relation for custom m2m as self._module is either empty (for custom models), either the one of the last inheriting module (which is wrong). The field should be removed manually and should not be impacted by the uninstallation of modules. The removal of the relation table can be done when removing manually the custom field (see rev 6af3193).

ir.model: when removing a model, drop the table with the CASCADE instruction. This will remove left constraints from remaining m2m tables.
This means that dropping a table (either manually removing a custom model or uninstalling a module) will not drop the relation table for a custom m2m field. This is not ideal but better than the previous behaviour (which was to fail the DROP TABLE instruction and keep the table with a few columns and unconsistent data).
2014-07-08 15:56:24 +02:00
Raphael Collet cbe2dbb672 [MERGE] new v8 api by rco
A squashed merge is required as the conversion of the apiculture branch from
bzr to git was not correctly done. The git history contains irrelevant blobs
and commits. This branch brings a lot of changes and fixes, too many to list
exhaustively.

- New orm api, objects are now used instead of ids
- Environements to encapsulates cr uid context while maintaining backward compatibility
- Field compute attribute is a new object oriented way to define function fields
- Shared browse record cache
- New onchange protocol
- Optional copy flag on fields
- Documentation update
- Dead code cleanup
- Lots of fixes
2014-07-06 17:05:41 +02:00
Christophe Simonis 1eaa69d342 [MERGE] forward port of branch saas-5 up to 9e8e365 2014-06-25 12:44:13 +02:00
Christophe Simonis 9e8e3653f2 [MERGE] forward port of branch saas-4 up to f68c835 2014-06-25 12:43:41 +02:00
Christophe Simonis f68c83545a [MERGE] forward port of branch saas-3 up to a66f3dd 2014-06-25 12:33:17 +02:00
Christophe Simonis a1b3e22a17 [MERGE] forward port of branch 7.0 up to 4bfcbb2 2014-06-25 11:35:11 +02:00
Alexandre Fayolle 4bfcbb2a48 [FIX] fields property: do not create empty properties
fixes #595
In the case where a property for the company exists but has no related record (e.g. in case of type m2o with no defined value), not setting a value to this field for a new record would create a new property (as browse_null is not an instance of browse_record)
2014-06-25 10:57:10 +02:00
Laurent Mignon (aka lmi) ea00789e35 [IMP] take into account the context parameter 'defer_parent_store_computation' also on write operations 2014-06-24 14:22:41 +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
kevin wang 59c27970b5 [FIX] orm: allow unicode in inherit views with attribute
When extending a view with position='attributes', prevent crash if view contains unicode char
Fixes #706
2014-06-23 12:48:27 +02:00
Christophe Simonis eef6330c55 [MERGE] forward port of branch saas-5 up to adf07a9 2014-06-19 16:23:32 +02:00
Christophe Simonis adf07a9490 [MERGE] forward port of branch saas-4 up to 5087612 2014-06-19 16:13:35 +02:00
Christophe Simonis 5087612d1d [MERGE] forward port of branch saas-3 up to bf53aed 2014-06-19 15:44:07 +02:00
Xavier Morel 56009e8804 [FIX] website: missing timezone conversion back to UTC
In t-field, datetime fields (formatted and not formatted versions) are
converted to the context/user's timezone (through
fields.datetime.context_timestamp) when displayed, but were saved without
converting back so the next display would go forward (or back) of the user's
tzoffset.

Fix that by applying context_timestamp's conversion backwards, from the
context/user's timezone back to UTC, before saving the field's value.
2014-06-18 16:09:02 +02:00
Xavier Morel 63a6ba92e2 [IMP] no need to compute *all* has_group calls if the first one fails 2014-06-17 12:00:50 +02:00
Denis Ledoux 3c0292645f [MERGE] Forward-port of 7.0 bugfixes up to 63ea0df73f 2014-06-16 17:37:10 +02:00
Fabien Meghazi f213b7ea65 [FIX] new style for default form views 2014-06-16 13:39:48 +02:00
Olivier Dony f15cbd6520 [MERGE] Forward-port saas-4 bugfixes up to ad4c6ca 2014-06-12 18:54:36 +02:00
Martin Trigaux 86acc1a62f [FIX] orm: avoir errors reading twice a field
_read_flat: remove duplicated fields in read call
get many2one: as False is instance of int, check the value of x first to avoid calling a name_get with a list of False

When we were reading twice a m2o field where at least one result is null, the first call to name_get would set the value to False instead of None and then accepted by the filter 'isinstance(x, (int,long))'
2014-06-12 16:14:41 +02:00
Christophe Simonis 7bee9447c4 [MERGE] forward port of branch saas-3 up to 3c7a54a 2014-06-11 11:06:04 +02:00
Christophe Simonis 3c7a54a76c [MERGE] forward port of branch 7.0 up to 100eba8 2014-06-11 10:58:43 +02:00
Jeremy Kersten 100eba8eaf [FIX] fields.py - avoid dict comprehension inside a dict comprehension 2014-06-11 10:30:00 +02:00
Christophe Simonis a7c2125735 [MERGE] forward port of branch saas-4 up to 6b8e972 2014-06-10 13:15:46 +02:00
Christophe Simonis 6b8e9727e5 [MERGE] forward port of branch saas-3 up to 4601d85 2014-06-10 12:29:47 +02:00
Christophe Simonis 4601d85944 [MERGE] forward port of branch 7.0 up to 6fdb783 2014-06-10 11:49:14 +02:00
Christophe Simonis 517162ce14 [FIX] orm: do not recompute m2o stored function field at read.
The get() method of m2o function fields is used for 2 different things:
 - call the function defining the m2o
 - get the name_get representation of the value

Until this pathc, only the first case was handled, resulting to a useless
recomputation of the field when reading it.
2014-06-06 10:53:42 +02:00
Oliver Laurent 306d5c89a0 [FIX] orm: do not resize unlimited char fields 2014-06-05 19:05:36 +02:00
Christophe Simonis b1c0bc0b46 [MERGE] forward port of branch saas-4 up to 65f68c1 2014-06-03 19:45:19 +02:00
Martin Trigaux 3cb551bf50 [FIX] read_group: do not change the return format of the read group in case of no groupby_fields and keep the same return format as with groupby fields (a list of dict) 2014-06-03 10:20:55 +02:00
Xavier Morel d9ce012d29 [IMP] simplify handling of callable _constraint message 2014-05-27 11:57:00 +02:00
Xavier Morel d8377a931e [REM] idiotic _invalids attribute, as well as get_invalid_fields 2014-05-27 11:56:59 +02:00
Christophe Simonis a756b82372 [MERGE] forward port of branch saas-4 up to revid bb26dea 2014-05-20 20:19:55 +02:00
Christophe Simonis bb26dea60b [MERGE] forward port of branch saas-3 up to revid 38abc8a 2014-05-20 19:00:50 +02:00
Christophe Simonis 38abc8a006 [MERGE] forward port of branch 7.0 up to revid b09b6a0 2014-05-20 18:57:04 +02:00
Thibault Delavallée 066fb14326 [FIX] orm: unlink: when unlinking a record, trigger the computing of
function fields for other records in the same model. Previously all function fields in the
current model were not computed for some reason not provided by the history.

We therefore compute effective store_ids on which the various trigerred
function fields will be computed again. Those ids are the ids given
in the store_get storage variable minus the deleted ones.
2014-05-19 18:12:41 +02:00
xmo-odoo 072485799c Merge pull request #27 from lyinfo/master-ck-match
Dereferencing of nones could lose error messages during import
2014-05-19 10:18:27 +02:00
Xavier Morel cf833a2f53 [FIX] don't blockquote a list of stuff for no reason 2014-05-19 08:32:14 +02:00
kevin wang b1dfb8e193 check no match result in convert_pgerror_* functions 2014-05-17 23:14:53 +08:00
Olivier Dony 7e66bd9d55 [FIX] orm.search_read: drop active_test context flag during the read() step
The active_test flag is meant for search(),
but when passed to search_read() it was also
propagated to the read() call.
This has little consequence normally because
read() ignores this flag, but it can have
side-effects when reading x2m fields or
function fields. They are likely to call
search() somewhere downstream, still with
 the propagated active_test flag, while
it should not be applied anymore.

Ultimately dropping this flag could be
done by read() in all cases, but changing
search_read() is less likely to block
exotic cases where the flag was passed
on purpose. Moving it to read() could
be done as a later step.
2014-05-13 17:29:35 +02:00
Quentin (OpenERP) 104451bd56 [FIX] fields.date's date_to_datime function fixed
bzr revid: qdp-launchpad@openerp.com-20140416154450-ws9w6wzf9s5kmjjj
2014-04-16 17:44:50 +02:00
Denis Ledoux 42025a6af5 [ADD] osv: add get_formview_action and get_formview_id methods
return an action to open the document. This method is meant to be
overridden in addons that want to give specific view ids for example

bzr revid: dle@openerp.com-20140416143431-syqu1ko74xt04oo5
2014-04-16 16:34:31 +02:00
Christophe Simonis 15e151dca7 [IMP] orm: postprocess function field values in batch
bzr revid: chs@openerp.com-20140415162321-l8hgeh6s48252zhl
2014-04-15 18:23:21 +02:00
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
Quentin (OpenERP) 43b8d2aec1 [IMP] fields.date: added date_to_datetime function
bzr revid: qdp-launchpad@openerp.com-20140414153613-geu20zacxnf0swol
2014-04-14 17:36:13 +02:00
Martin Trigaux 478cbd7c70 [FIX] read_group: avoid shared context and initialise if none
bzr revid: mat@openerp.com-20140411075556-kdxn1lsth45twgmj
2014-04-11 09:55:56 +02:00
Gery Debongnie c6f41caf99 [MERGE] merge from trunk
bzr revid: ged@openerp.com-20140409120604-tgc4o9zkkr69sf4q
bzr revid: ged@openerp.com-20140409150557-1wsyuvpw1ly75fhn
bzr revid: ged@openerp.com-20140410133251-k200ui19hjs6jnur
2014-04-10 15:32:51 +02:00
Christophe Simonis 15680c94e1 [MERGE] forward port of branch saas-3 up to revid 5115 chs@openerp.com-20140410102422-fcwxhjk40z0oy8x5
bzr revid: chs@openerp.com-20140410105454-6utwgruj80h8wdss
2014-04-10 12:54:54 +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
Gery Debongnie 2df67ad6c9 [FIX] make sure the read_group method use the correct time interval when grouping with an interval of days (stupid typo) (orm.py)
bzr revid: ged@openerp.com-20140409092759-91ruq32vkxh698kh
2014-04-09 11:27:59 +02:00
Gery Debongnie e143250b7a [IMP] simplifies the readgroup code to select order by (orm.py)
bzr revid: ged@openerp.com-20140408122417-y75wp0plyloiamuy
2014-04-08 14:24:17 +02:00
Gery Debongnie 5d31c979a1 [MERGE] merge from trunk
bzr revid: ged@openerp.com-20140408090618-vs4e9c9ckhat9aem
2014-04-08 11:06:18 +02:00
Gery Debongnie 6d234c01bd [IMP] change the regex matching orders in orm.py to accept field:interval. This simplifies the code in _check_qorder (no need to compute the raw field name)
bzr revid: ged@openerp.com-20140408090418-5yjnfp6axumytmrq
2014-04-08 11:04:18 +02:00
Gery Debongnie 568b8c7632 [IMP] add and fix the documentation on some helper methods in read_group. (orm.py)
bzr revid: ged@openerp.com-20140408082029-pmdzkbak0zjvs8jw
2014-04-08 10:20:29 +02:00
Gery Debongnie 6aa003f1ad [IMP] improves the helper function _read_group_format_result so that it is slightly faster (orm.py)
bzr revid: ged@openerp.com-20140408073813-8z23fun5274fvqaa
2014-04-08 09:38:13 +02:00
Christophe Simonis 0161666e8b [MERGE] forward port of branch saas-3 up to revid 5112 chs@openerp.com-20140407144238-3s38zadkh7yxpdy7
bzr revid: chs@openerp.com-20140407160548-ttuc877kknuycoqw
2014-04-07 18:05:48 +02:00
Christophe Simonis 1e9ed7baf6 [MERGE] forward port of branch 7.0 up to revid 5275 odo@openerp.com-20140407105740-elbz311w5u9e8eos
bzr revid: chs@openerp.com-20140407144238-3s38zadkh7yxpdy7
2014-04-07 16:42:38 +02:00
Gery Debongnie b683b9c614 [IMP] removes useless calls to field_get and replace them by self._all_columns in read_group method (orm.py).
bzr revid: ged@openerp.com-20140407133931-hrf9dmdj2fx050ww
2014-04-07 15:39:31 +02:00
Gery Debongnie 82825c4acd [FIX] add context parameter to various helper methods to avoid stupid crash in read_group (orm.py)
bzr revid: ged@openerp.com-20140407130223-pdzge17omntpbh23
2014-04-07 15:02:23 +02:00
Olivier Dony 5be9e5612f [FIX] browse()/browse_record: use iterables instead of forcing lists when constructing browse_lists
This allows iterable list_class implementations

bzr revid: odo@openerp.com-20140407105740-elbz311w5u9e8eos
2014-04-07 12:57:40 +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
Gery Debongnie 39e69876c6 [IMP] moves some internal function in read_group to become class methods and slightly reorganize them (orm.py)
bzr revid: ged@openerp.com-20140404124232-dmyxuv1qf5kperet
2014-04-04 14:42:32 +02:00
Gery Debongnie 870fed2bb9 [IMP] puts the closure 'process_groupby' in read_group in a separate method. (orm.py)
bzr revid: ged@openerp.com-20140404114543-nw7yx87h1dbkbhtf
2014-04-04 13:45:43 +02:00
Gery Debongnie f48ab8373b [FIX] fixes a read_group test to use the correct field:interval key when grouping with an interval, and makes sure the sql request properly quote the order statement (without quoting DESC or ASC) (orm.py)
bzr revid: ged@openerp.com-20140404091947-z87yg2bc7htovj4q
2014-04-04 11:19:47 +02:00
Gery Debongnie 7dd2e6789d [FIX] when using readgroup in eager mode, there is a possible name collision when grouping on several fields with different intervals, for ex, date_deadline:month, date_deadline:week. This commit resolves the issue by changing the keys 'field' into 'field:interval' (for ex, date_deadline:month) in the results (orm.py)
bzr revid: ged@openerp.com-20140403142923-puiruf29tbi1pjj9
2014-04-03 16:29:23 +02:00
Gery Debongnie 1aba5f08cf [FIX] fixes read_group so that it uses the correct _count attribute in the result dictionary (orm.py)
bzr revid: ged@openerp.com-20140403115605-tuboy66r9ews2u0e
2014-04-03 13:56:05 +02:00
Gery Debongnie 75b66ed77c [FIX] work around a read bug: false data are fetched when the same field is present multiple times as a field parameter. The solution is to make sure the list many2onefields does not contain duplicate fields (orm.py)
bzr revid: ged@openerp.com-20140403094316-kmlliqbwd14ey68p
2014-04-03 11:43:16 +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
Gery Debongnie 9d8fa4d720 [FIX] only fills groups with empty groups in read_group when in lazy mode to prevent weird stuff happening with the read_group_fill_result algorithm.
bzr revid: ged@openerp.com-20140402135704-3d71gczgg362cezl
2014-04-02 15:57:04 +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
Gery Debongnie d38ce26d9d [MERGE] merge from trunk
bzr revid: ged@openerp.com-20140402081302-x1fohx2d8i2iiluw
2014-04-02 10:13:02 +02:00
Gery Debongnie 8c93dcbf62 [IMP] refactoring of readgroup method. The work is pretty much complete with this commit. Now, it correctly fills in empty group using _read_group_fill_results (orm.py)
bzr revid: ged@openerp.com-20140402073800-0ggxqfpyo2in8ozt
2014-04-02 09:38:00 +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
Martin Trigaux 9b19c1a337 [FIX] orm: add missing pooler in call
bzr revid: mat@openerp.com-20140403074134-fav63w1k6hm1b8ar
2014-04-03 09:41:34 +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
Martin Trigaux 7d585c5dad [FIX] convert datetime to date in case of date field
bzr revid: mat@openerp.com-20140401100819-k092i48lefozmdxb
2014-04-01 12:08:19 +02:00
Martin Trigaux cf1f20e5d5 [FIX] export: negation issue
bzr revid: mat@openerp.com-20140401090316-qog5uv6txyx46awi
2014-04-01 11:03:16 +02:00
Martin Trigaux 4074a01041 [ADD] orm: add the possibility to export in raw format instead of all string
lp bug: https://launchpad.net/bugs/844569 fixed

bzr revid: mat@openerp.com-20140331151743-94sk4xd7cr3dzn8m
2014-03-31 17:17:43 +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
Martin Trigaux 85805282b6 [FIX] fields: when executing (4, *) operations on o2m fields, check the existence based on the sql model of the table.
If the o2m field linked to the o2m is stored on a different table (eg: model with _inherit), previous request would crash as the field do not exists in the '_table' sql table

bzr revid: mat@openerp.com-20140327111241-klftr0s8v8i68nxp
2014-03-27 12:12:41 +01:00
Gery Debongnie 30e787511f [IMP] refactoring of readgroup method, to make it eager. Still incomplete, but it is mostly working (orm.py)
bzr revid: ged@openerp.com-20140325161104-d0xgof4bcskh4ie6
2014-03-25 17:11:04 +01:00
Martin Trigaux 33c6f108c0 [FIX] parent_model is null if local column
bzr revid: mat@openerp.com-20140324164334-pvzevi2bnmb642ak
2014-03-24 17:43:34 +01:00
Martin Trigaux 66d6fb065f [FIX] fields: when executing (4, *) operations on o2m fields, check the existence based on the sql model of the table.
If the o2m field linked to the o2m is stored on a different table (eg: inherit), previous request would crash as the field do not exists in the '_table' sql table

bzr revid: mat@openerp.com-20140324162130-fyotk8vqmkha43eb
2014-03-24 17:21:30 +01:00
Gery Debongnie 0eb9944222 [IMP] refactoring of readgroup method. It should have the same functionality, but is much simpler. This is necessary to implement eager groupby (orm.py)
bzr revid: ged@openerp.com-20140324085046-zpfpcostivf8454q
2014-03-24 09:50:46 +01:00
Christophe Simonis 8f8ca3bd84 [MERGE] forward port of branch saas-3 up to revid 5093 chs@openerp.com-20140318114540-l50kmo4azb57g31x
bzr revid: chs@openerp.com-20140318124112-cj65l3wysk2rhwlw
2014-03-18 13:41:12 +01:00
Christophe Simonis c7d114d9a9 [MERGE] forward port of branch saas-2 up to revid 5020 chs@openerp.com-20140312174526-a5rhh83g0fw8djuc
bzr revid: chs@openerp.com-20140312180614-8yb454s3mkjwnk2q
2014-03-12 19:06:14 +01:00
Christophe Simonis 96f744b271 [MERGE] forward port of branch saas-3 up to revid 5088 chs@openerp.com-20140311095550-lg3nvvjyojvgp2po
bzr revid: chs@openerp.com-20140311133850-11bw9vv90e40clw1
2014-03-11 14:38:50 +01:00
Olivier Dony 07fbbe288c [MERGE] Forward-port of 7.0 bugfixes, up to rev. 5251 revision-id: odo@openerp.com-20140304152927-havybom9x1jgdzae
bzr revid: odo@openerp.com-20140305213115-w55dqs3xra6ejmni
2014-03-05 22:31:15 +01:00
Martin Trigaux 63763dcc55 [IMP] readability
bzr revid: mat@openerp.com-20140305143050-zddqtyh7qg6lcx3q
2014-03-05 15:30:50 +01:00
Martin Trigaux 016a1ed37b [FIX] orm: create a foreign key for the function fields of type many2one and store value
bzr revid: mat@openerp.com-20140305140514-2sksy3lwqm07wvjh
2014-03-05 15:05:14 +01:00
Olivier Dony b79a33aefc [FIX] orm.read_group: improve test coverage and corner case handling:
- allow leading spaces in orderby spec for m2o columns
- extra test for read_group on multiple columns
- proper handling of groupby on numeric column with default order

bzr revid: odo@openerp.com-20140304152927-havybom9x1jgdzae
2014-03-04 16:29:27 +01:00
Olivier Dony 27a1770e20 [FIX] orm.read_group: fix various issues introduced in recent commit, cleanup
Fixed the implementation of the sorting for inherited
columns, many2one columns, and aggregated columns.
Added corresponding tests with increased coverage of
the read_group() method.

bzr revid: odo@openerp.com-20140228173320-p8l0jc8op7xsgn1x
2014-02-28 18:33:20 +01:00
Thibault Delavallée 42e2676f4b [IMP] fields: html: now supports a sanitize argument, telling
whether the content of the html field should be sanitized before storage. This parameter
is true by default.
Example of use: html of email template is considered as html content, but contains
mako strings that makes this content not valid html. Sanitizing the body content
can cause issues to the template; therefore storing it as html but not sanitized
allows to keep its content safe.

Added a test case to ensure this behavior.

bzr revid: tde@openerp.com-20140227120254-6m8gvkt4hf28nl0e
2014-02-27 13:02:54 +01:00
Martin Trigaux 43df0b4d23 [MERGE] [FIX] orm: when generating xml ids for export, use the model of the exported field instead of the current model. Courtesy of Stefan Rijnhart (Therp).
bzr revid: mat@openerp.com-20140226133716-vgdjjmqc2lou0n3u
2014-02-26 14:37:16 +01:00
Christophe Simonis 65db3c635e [MERGE] forward port of branch saas-2 up to revid 5014 mat@openerp.com-20140220145701-6y7s1roj88q7ys13
bzr revid: chs@openerp.com-20140220160548-0rhulha4cml6t08v
2014-02-20 17:05:48 +01:00
Denis Ledoux 67866db5b6 [MERGE] Forward-port of latest saas-2 bugfixes, up to rev. 5015 dle@openerp.com-20140221104908-7ytdg6xkxaza05o4
bzr revid: dle@openerp.com-20140220132700-hhc1nsu25j1ye257
bzr revid: mat@openerp.com-20140220150028-p6l0vnwa5q18uxiu
bzr revid: dle@openerp.com-20140221105500-t7jg037uusdloigl
2014-02-21 11:55:00 +01:00
Martin Trigaux bb3ff8b449 [MERGE] Forward-port of latest 7.0 bugfixes, up to rev.5240 revid:mat@openerp.com-20140220145445-0xt7alp3uj0os1fz
bzr revid: mat@openerp.com-20140220145701-6y7s1roj88q7ys13
2014-02-20 15:57:01 +01:00
Martin Trigaux 9515daa3f8 [MERGE] [FIX] read_group: skip date(time) fields when generating the sql query, the monthly grouping is done afterward
lp bug: https://launchpad.net/bugs/1282485 fixed

bzr revid: mat@openerp.com-20140220103351-n3ohwombd1kk802f
bzr revid: mat@openerp.com-20140220145445-0xt7alp3uj0os1fz
2014-02-20 15:54:45 +01:00
Anael Closson 5e593b34d0 [FIX] orm: grouping of date and datetime conflicts ordering on dates with date and datetime - hotfix
bzr revid: acl@openerp.com-20140220135127-1hh7s6dx6p2wuhz9
2014-02-20 14:51:27 +01:00
Anael Closson 7080279bde [FIX] incorrect handling of orderbys when generator for the groupby field generates more than one orderby clause item
bzr revid: acl@openerp.com-20140220095911-zd5j1ssjw0cwzzz2
2014-02-20 10:59:11 +01:00
Martin Trigaux c83247c38b [MERGE] Forward-port of latest saas-2 bugfixes, up to rev.5012 revid:mat@openerp.com-20140219134943-60ssztc01cxdtk09
bzr revid: mat@openerp.com-20140219140617-na0q47yaloblb67i
2014-02-19 15:06:17 +01:00
Martin Trigaux e635ebe6c1 [MERGE] Forward-port of latest 7.0 bugfixes, up to rev. 5238 revid:launchpad_translations_on_behalf_of_openerp-20140219053940-dvi4g7ajttoj6h9k
bzr revid: mat@openerp.com-20140219134943-60ssztc01cxdtk09
2014-02-19 14:49:43 +01:00
Christophe Simonis d60cf404ca [FIX] orm._auto_init: fallback to copy method when altering in-place varchar columns failed.
When a varchar column has a dependence on a view, we cannot change the size in-place,
we need to manually re-create the column with the correct type.

bzr revid: chs@openerp.com-20140217182045-qor70r3gb0fch2ki
2014-02-17 19:20:45 +01:00
Anael Closson 90dcc00443 [FIX] OPW 598942 : orm read_group doesn't take referenced fields or aggregated fields in account when sorting
Sorting was done using a search on ids that where found in a custom SQL field,
only 1 record among aggregated records with same groupby value was used
when using search for ordering, resulting data ordered on
max(aggregated_data).field_value instead of sum(aggregated_data.field_value).

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

bzr revid: acl@openerp.com-20140217172926-ka2fw8t2l3cqi7h3
2014-02-17 18:29:26 +01:00
Olivier Dony a5b51c2be7 [IMP] orm._auto_init: avoid copying VARCHAR column when increasing size, alter in-place instead + better temporary names
Historically, we used a copy+rename technique during
table upgrades to alter varchar columns sizes.
This was only necessary to permit downsizing
columns, which we do not want to do anymore (it is
too dangerous, so has to be done explicitly when
required).

Switching to a pure ALTER COLUMN TYPE is simpler
and also much faster for large tables.

Also fixed the inappropriate name used for
temporary columns during column type casting
(which *does* require the copy+rename technique).

bzr revid: odo@openerp.com-20140217164239-0iou3dsiea3foabb
2014-02-17 17:42:39 +01:00
Anael Closson f4f6bc3d9a [REF] removing debug code
bzr revid: acl@openerp.com-20140217140705-b2erer6w4mxba3l7
2014-02-17 15:07:05 +01:00
Anael Closson ac88131405 [IMP] Speed and quality improvement
- removing the need of the use of search when groupby is set on a relation
    field.
  - creation and use of dedicated helper method to compute the orderby clause
    for easier reading

bzr revid: acl@openerp.com-20140217140144-2rm3o00g76tyhqxn
2014-02-17 15:01:44 +01:00
Xavier Morel d21114454e [IMP] remove pointless extra newline in log message of column removal
bzr revid: xmo@openerp.com-20140214145219-07pk822tpo0nohpn
2014-02-14 15:52:19 +01:00
Martin Trigaux 21842a4fc4 [MERGE] sync with 7.0 (getting needed orm revision)
bzr revid: mat@openerp.com-20140213130150-9ltjazqiru5apv5k
2014-02-13 14:01:50 +01:00
Martin Trigaux ff389d8478 [FIX] remove useless cr.commit in fields creation
This is require to be able to create revertable tests adding new fields

bzr revid: mat@openerp.com-20140213120349-a0p3bist5l5uyg6b
2014-02-13 13:03:49 +01:00
Martin Trigaux 3668f09108 [IMP] avoid changing the API by passing the company_id in context
bzr revid: mat@openerp.com-20140213100836-wte9zec4easb0cmw
2014-02-13 11:08:36 +01:00
Martin Trigaux 6f8811e7f6 [MERGE] sync with 7.0
bzr revid: mat@openerp.com-20140213095713-b1ys0nu8u7o8ybyr
2014-02-13 10:57:13 +01:00
Denis Ledoux 1b2c0f74dc [MERGE] Forward-port of latest 7.0 bugfixes, up to rev. 5229 revid:launchpad_translations_on_behalf_of_openerp-20140211064034-ghuxxk02n715othj
bzr revid: dle@openerp.com-20140211163902-ya86jr7lwlj1mkk9
2014-02-11 17:39:02 +01:00
Olivier Dony 391872c4d6 [FIX] orm.copy_data: avoid reading useless and possibly expensive data when copying records
Rather than reading the data and discarding it,
it is much faster to not read it in the first place.

bzr revid: odo@openerp.com-20140206170401-brd6368pe1fmbkkc
2014-02-06 18:04:01 +01:00
Christophe Simonis 500fea28b7 [MERGE] forward port of branch saas-2 up to revid 5007 chs@openerp.com-20140206110220-myn57cryam1y4k9v
bzr revid: chs@openerp.com-20140206110423-qe4h5ip2dg6dm7ph
2014-02-06 12:04:23 +01: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
Anael Closson 30d22d327e [FIX] typo, wrong ordering of lines
bzr revid: acl@openerp.com-20140205125208-8ds2hxfqnuqsngbd
2014-02-05 13:52:08 +01:00
Martin Trigaux 6ea8851fd0 [ADD] test read_group on a column of _inherits model and group on right field
bzr revid: mat@openerp.com-20140203133331-mujvv812zd971ci2
2014-02-03 14:33:31 +01:00
Anael Closson f6207124f9 [FIX] OPW 598942 : orm read_group doesn't take referenced fields or aggregated fields in account when sorting
Sorting was done using a search on ids that where found in a custom SQL field,
only 1 record among aggregated records with same groupby value was used
when using search for ordering, resulting data ordered on
max(aggregated_data).field_value instead of sum(aggregated_data.field_value).

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

bzr revid: acl@openerp.com-20140203125854-ypi0bu0lbhatg9b1
2014-02-03 13:58:54 +01:00
Martin Trigaux cafa5e7854 [FIX] orm: read_group aggregates values on all columns instead of only the one of the parent model
bzr revid: mat@openerp.com-20140203123311-38rwp7tfyc08flid
2014-02-03 13:33:11 +01:00
Antony Lesuisse d6c1346e12 [MERGE] trunk-website-al
bzr revid: al@openerp.com-20140131005207-mn7t6tar8cywe9hz
2014-01-31 01:52:07 +01:00
Gery Debongnie 02313ae739 [IMP] improves the formatting of the dates returned by read_group in orm.py (for ex, January -> January 2014 or W4 -> W4 2014)
bzr revid: ged@openerp.com-20140130155117-ldsq4tjat96ustd8
2014-01-30 16:51:17 +01:00
Olivier Dony 79dc0235cd [IMP] orm: log underlying exception at DEBUG level when a constraint check raises
bzr revid: odo@openerp.com-20140130154100-rdr1n5u1aiz9cbk3
2014-01-30 16:41:00 +01:00
Olivier Dony 0428c00e2f [FIX] browse_record.__str__: avoid crashing when ID is None
bzr revid: odo@openerp.com-20140130153955-naxbrcz5pv17z4rq
2014-01-30 16:39:55 +01:00
Gery Debongnie e9e2c5d587 [MERGE] merge trunk into local branch
bzr revid: ged@openerp.com-20140130135015-y0uxsdjb6631iqoo
2014-01-30 14:50:15 +01:00
Fabien Meghazi 53098c666c [MERGE] trunk's CORS support (merge with changes)
bzr revid: chs@openerp.com-20140130120448-tj9pu30o7dj74zid
bzr revid: fme@openerp.com-20140130125425-j1yn6p4lr7lincr3
2014-01-30 13:54:25 +01:00
Olivier Dony 57ec7d6c03 [IMP] orm: when a _constraint check raises, catch it and combine its message with the constraint message for the user-friendly popup
Plus minor cleanup

bzr revid: odo@openerp.com-20140130094337-7g8ez92viwmbzbft
2014-01-30 10:43:37 +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
Gery Debongnie cffcc5ea18 [FIX] hopefully, properly uses the user's timezone when performing a readgroup (in orm.py)
bzr revid: ged@openerp.com-20140129084721-6m4cfg087vhqb51d
2014-01-29 09:47:21 +01:00
Olivier Dony 95d3995614 [MERGE] Sync with trunk revno 5038 rev-id ged@openerp.com-20140127161125-2br49sy5bnyuen7f
bzr revid: odo@openerp.com-20140128184158-19hj4mg83jazp3nr
2014-01-28 19:41:58 +01:00
Gery Debongnie 2fe3861353 [FIX] uses the user's timezone when performing a readgroup (in orm.py)
bzr revid: ged@openerp.com-20140128110022-j08khieyt1wvsr8e
2014-01-28 12:00:22 +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