Commit Graph

1165 Commits

Author SHA1 Message Date
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
Fabien Pinckaers 1c1b17451d [FIX] adding menu
bzr revid: fp@tinyerp.com-20140125151454-g4xsi25g3re2arwo
2014-01-25 16:14:54 +01:00
Gery Debongnie b2f27dabf0 [REF] implifies the read_group method by removing an useless dictionary (orm.py)
bzr revid: ged@openerp.com-20140124132834-evx3dikqc94m48ed
2014-01-24 14:28:34 +01:00
Gery Debongnie 09706b5dff [IMP] adds 'W' in front of the week number when formatting date grouped by weeks (method read_group) (orm.py)
bzr revid: ged@openerp.com-20140124100921-w5gq1fwidm01xx5l
2014-01-24 11:09:21 +01:00
Raphael Collet 020921a7f3 [IMP] orm: remove commented code
bzr revid: rco@openerp.com-20140123094957-knrgx6sy66j4tj39
2014-01-23 10:49:57 +01:00
Raphael Collet 0fb09d9a33 [FIX] fields: small python code fix
bzr revid: rco@openerp.com-20140123094646-ri4apn315dm19rl1
2014-01-23 10:46:46 +01:00
Xavier Morel d50f785b4f [FIX] view requested by _view_ref with view_ref being undotted
Issue introduced in
revid:chm@openerp.com-20130828161130-641xsmbr8xm53xjx: context of a
fields_view_get can provide a *_view_ref name (e.g. tree_view_ref),
whose value is an xid for the view to use (can be used to specify a
view instead of providing a view_id, mostly for embedded views where
there is no way to provide a view_id).

The view_ref being an external id, it must be dotted. Historically,
undotted xids were silently ignored and the system just skipped to
getting the default view for the model (lowest priority view where
inherit_id is null).

In revid:odo@openerp.com-20130821122955-8c9z0mi8cu48rne3 this behavior
was altered to emit a warning when ignoring a malformed view_ref. When
this change was merged into trunk-website-al, the conditional
(view_ref and '.' in view_ref) was split without consideration for the
semantics change: a syntactically invalid view_ref would fall off the
first branch (view_ref) instead of taking the second one (not
view_ref), the code would not fetch the default view for the model and
would instead generate one (through _get_default_%(viewtype)s_view).

However, closer reading reveals the code was already broken in a
specific case of a syntactically valid but unknown xid (view_id
wouldn't get assigned in the first branch, but the code would not take
the second one, resulting yet again in a view generation even if the
database contains a valid view for the model and type).

Fixed by reintroducing explicit second check on view_id, instead of
merely conditional alternative.

bzr revid: xmo@openerp.com-20140123075742-603n2zthqhxee07y
2014-01-23 08:57:42 +01:00
Gery Debongnie 74386a5bb9 [IMP] changes the method read_group so that it now accepts groupbys of the form 'field:groupby_function', like 'create_date:week' for example. Also, removes the previous hack using the context (orm.py)
bzr revid: ged@openerp.com-20140122124206-b5p06tpzw2i7tpo2
2014-01-22 13:42:06 +01:00
Gery Debongnie 17e3c31992 [MERGE] merge trunk into local branch
bzr revid: ged@openerp.com-20140113142459-pjoiau7pp4knvvda
bzr revid: ged@openerp.com-20140116144304-d00alltpt7j1gzvh
bzr revid: ged@openerp.com-20140121142924-641cu8trhm4pdf1m
2014-01-21 15:29:24 +01:00
Martin Trigaux a75ebb628c [IMP] search_read: avoid calling read if search only on id column (security rules already triggered with search)
bzr revid: mat@openerp.com-20140117120235-zdj7pjd8xnnrnqol
2014-01-17 13:02:35 +01:00
Christophe Simonis 2f90f80ba0 [FIX] orm: As float fields are stateful (the .digit attribute depend of the database (decimal_precision)), registry model instances need their owm copy.
lp bug: https://launchpad.net/bugs/929483 fixed

bzr revid: chs@openerp.com-20140116153708-061aq2k0n1qsb2n3
2014-01-16 16:37:08 +01:00
Thibault Delavallée ab5c23079a [MERGE] Sync with trunk, solved conflicts.
bzr revid: tde@openerp.com-20140116091716-zk1n5ots94i65io5
2014-01-16 10:17:16 +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
jke-openerp 8fbc5b159d [MERGE] Merge with trunk
bzr revid: jke@openerp.com-20140113193949-39t5hssln2u5s899
2014-01-13 20:39:49 +01:00
Stephane Wirtel dfe775ba1e [IMP] orm: Use a list of tuples instead of three collections.
bzr revid: stw@openerp.com-20140113153124-8921v1010xeuqeb8
2014-01-13 16:31:24 +01:00
Gery Debongnie fcf97a559a [IMP] adds support for week/quarter groupby in readgroup method (orm.py)
bzr revid: ged@openerp.com-20140113133602-ytxleg91bu3fyx62
2014-01-13 14:36:02 +01:00
Stephane Wirtel ec35576af3 [IMP] Use INSERT INTO RETURNING for the creation of a record and use some tables
instead of a string for the generation of the SQL query.

bzr revid: stw@openerp.com-20140110162731-ma7wk61zof6h9vyr
2014-01-10 17:27:31 +01:00
Martin Trigaux 3fb75a44c8 [FIX] orm: add missing context (without the lang attribute to avoid setting translated values) in write call.
bzr revid: mat@openerp.com-20140109153601-13wo9gj5cz6ho3nm
2014-01-09 16:36:01 +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
Martin Trigaux 13063d5713 [IMP] osv: display full traceback in terminal (not client side) when a check fails instead of minimal error
bzr revid: mat@openerp.com-20140108140554-oey9bje52ndqe0e3
2014-01-08 15:05:54 +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
Gery Debongnie c2a0f93b9e [IMP] changes the readgroup method to allow better control in the groupby field when it is a date/datetime (for example, it is now possible to group by week/quarter) (orm.py)
bzr revid: ged@openerp.com-20140107085800-hwyt41j3hwj1h1n8
2014-01-07 09:58:00 +01:00
jke-openerp 5a4ecf0134 [Merge] Merge with trunk
bzr revid: jke@openerp.com-20131218130304-y3scbl1ms65vhupf
bzr revid: jke@openerp.com-20131220144934-e0hvmc5du87k2k8n
bzr revid: jke@openerp.com-20140106082149-xzralqftgxnauv51
2014-01-06 09:21:49 +01:00
Thibault Delavallée 7a72d858cb [MERGE] Sync with trunk
bzr revid: tde@openerp.com-20140103151324-jk0u8vmrxxomy5vx
2014-01-03 16:13:24 +01:00
Guewen Baconnier 780e1548c0 [CHG] set lang to False instead of en_US (already being the default language), reducing the places where this default value is set
bzr revid: guewen.baconnier@camptocamp.com-20131228203801-3z6g1bb0ggfio5x0
2013-12-28 21:38:01 +01:00
Martin Trigaux 79f716c70f [MERGE] forward port of latest saas-2 until rev 4996 dle@openerp.com-20131218123130-vlejjv7r2klkzoj0
bzr revid: mat@openerp.com-20131218160041-58x5kij4v7earagu
2013-12-18 17:00:41 +01:00
jke-openerp 196436f73b [MERGE] Merge with trunk
bzr revid: jke@openerp.com-20131127175727-76iuqrgmg8fumi5f
bzr revid: jke@openerp.com-20131202142549-t1l5pyse00zqw8wm
bzr revid: jke@openerp.com-20131210164214-ctl2z8dzkzohha13
bzr revid: jke@openerp.com-20131211085211-zhnm8ylpz0cws1lg
bzr revid: jke@openerp.com-20131211131225-v60hox0q6drwajqu
2013-12-11 14:12:25 +01:00
Cecile Tonglet a48c8119ca [FIX] name_search() where _rec_name is a reference field and links are broken
bzr revid: cto@openerp.com-20131211103842-i1n9t8mg9kuw77v3
2013-12-11 11:38:42 +01:00
Xavier ALT 9a4c62861f [FIX] orm: early return within ``_apply_ir_rules`` for superuser.
Save a few time by not not trying to apply ir.rule for superuser, that will
  anyway be skipped within ir.rule's ``_compute_domain`` method.

bzr revid: xal@openerp.com-20131210140330-oui4oy8pez12xkxv
2013-12-10 15:03:30 +01:00
Xavier ALT f5458a954d [FIX] orm: cleaner batch number of records for auto_init() stored fields.function update
bzr revid: xal@openerp.com-20131210122312-f3f4h0z4lpiagsk3
2013-12-10 13:23:12 +01:00
Cecile Tonglet 86776035ba [FIX] Model.create: trigger stored field recalculation for implicit parent_id fields during create
The create() method implicitly creates parent records on objects of the _inherits.
Therefore, in order to make the trigger on the linked field works, we should
include all the _inherits values (fields that make the link to the parent
record) because they are created implicitly.
The write() method does not need this change, as any update of the parent
fields has to be explicit.

bzr revid: odo@openerp.com-20131209184718-wczdefzo9evc0cgc
2013-12-09 19:47:18 +01:00
Denis Ledoux 20be322c45 [MERGE] Forward-port of latest 7.0 bugfixes, up to rev. 9684 rev-id: dle@openerp.com-20131209145652-3g9rgnfz1w8k0whw
bzr revid: chs@openerp.com-20131202105848-33gcz1715w370rve
bzr revid: dle@openerp.com-20131204150643-is3y0b9n8enh3yql
bzr revid: chs@openerp.com-20131206152726-pirikn7v8pev90ic
bzr revid: dle@openerp.com-20131206162437-b9niay99mirk44qm
bzr revid: tde@openerp.com-20131209102019-kjeg0rx2au1d5e5v
bzr revid: dle@openerp.com-20131209155721-589zihxx8jmvlpvp
2013-12-09 16:57:21 +01:00
Cecile Tonglet 3b328aaab4 [FIX] Trigger stored field recalculation for inherited records
The create() method implicitly creates record on objects of the _inherits.
Therefore, in order to make the trigger on linked field works, we should
include all the _inherits values (field that makes the link to the rel
record) because they are created implicitly.

bzr revid: cto@openerp.com-20131209154857-788f94w0kh6ef5pp
2013-12-09 16:48:57 +01:00
Cecile Tonglet 2e197cbb98 [IMP] Batch for the computation of function's stored values is now customizable
bzr revid: cto@openerp.com-20131209141111-tbg9x1h8l6neu0ml
2013-12-09 15:11:11 +01:00
Martin Trigaux d2ca43402e [FIX] orm: inverting the condition seems to work (don't ask why)
bzr revid: mat@openerp.com-20131206142220-nfqiyeic9fdkejxy
2013-12-06 15:22:20 +01:00
Martin Trigaux 0be3333f96 [FIX] orm: ignore existing link for operation (4, x) in one2many fields
bzr revid: mat@openerp.com-20131206125403-r6uemlh7jagw01gh
2013-12-06 13:54:03 +01:00
Cecile Tonglet cdff5c1366 [IMP] Performance: by-pass call to _apply_ir_rules for user admin
bzr revid: cto@openerp.com-20131205121118-0f9087y2huo7y44l
2013-12-05 13:11:18 +01:00
Martin Trigaux 9652fb0013 [IMP] orm: force checking ir.rules on read when accessing only to _classic_write fields (o2m, m2m, function)
More consistent behaviour. Was not able to access unauthorized data (retrieving data on x2m field would trigger security rules) but make sure it raises an exception instead of silently retrieve no data.
Move construct domain inside if clause as no needed before

bzr revid: mat@openerp.com-20131205113254-j3j4bb0p6ed23oht
2013-12-05 12:32:54 +01:00
Christophe Matthieu 8460122209 [MERGE] sync with trunk
bzr revid: chm@openerp.com-20131202150856-fzrfcoa8pmsjutau
2013-12-02 16:08:56 +01:00
Christophe Simonis 56bb1b9869 [MERGE] forward port of branch saas-2 up to revid 4992 chs@openerp.com-20131202105848-33gcz1715w370rve
bzr revid: chs@openerp.com-20131127110757-5kaay2kcxq0ysb59
bzr revid: chs@openerp.com-20131127161639-yur4rdh3wx43kxle
bzr revid: chs@openerp.com-20131127180647-f8uws77gaym5kfvd
bzr revid: chs@openerp.com-20131202110030-gf20dv2uj5fqv7c2
2013-12-02 12:00:30 +01:00
Fabien Pinckaers 51a32f45a0 [IMP] Speed improvement
bzr revid: fp@tinyerp.com-20131130171849-i1cao342bik6wd89
2013-11-30 18:18:49 +01:00
Christophe Simonis f2da2d6811 [FIX] orm: browse() do not prefetch deprecated fields
bzr revid: chs@openerp.com-20131127152537-wkof87ut5cdud6z6
2013-11-27 16:25:37 +01:00
Christophe Simonis 6347f9f4ea [IMP] orm: copy() does not copy deprecated fields
bzr revid: chs@openerp.com-20131126185210-8kd5stdexa4ozn2m
2013-11-26 19:52:10 +01:00
Xavier Morel 1235955197 [IMP] exception handling in _dispatch
* ensure users correctly get a 403 forbidden from a failed
  _authenticate

* as far as we can tell, NotFound is one of the few things
  _authenticate does *not* throw. Catch all exceptions anyway.

* replace default _handle_500, _handle_403 and _handle_404 by single
  generic handler since all they did was re-raise the exception anyway

bzr revid: xmo@openerp.com-20131126110519-0yjh01ubrulpzlmn
2013-11-26 12:05:19 +01:00
Christophe Simonis ab386c0f5f [MERGE] forward port of branch saas-2 up to revid 4984 chs@openerp.com-20131125151017-lmj53bxg1pfrr4a7
bzr revid: chs@openerp.com-20131125154140-cpbk4tcdml2a3b9n
2013-11-25 16:41:40 +01:00
Christophe Simonis 3211a29d9b [MERGE] forward port of branch 7.0 up to revid 5148 mat@openerp.com-20131125125008-wmpssjk5vygdcc0w
bzr revid: chs@openerp.com-20131125151017-lmj53bxg1pfrr4a7
2013-11-25 16:10:17 +01:00
Martin Trigaux 9635119fc1 [FIX] fields: execute name_get for function field of type many2one as SUPERUSER_ID (same behaviour as classical many2one)
bzr revid: mat@openerp.com-20131125125008-wmpssjk5vygdcc0w
2013-11-25 13:50:08 +01:00
Martin Trigaux e2102ca9ce [IMP] orm: add missing space in error message during validation
bzr revid: mat@openerp.com-20131125124717-4jsqv0lfu7hpxusi
2013-11-25 13:47:17 +01:00
Martin Trigaux 3b5cf5d56c [FIX] translations: fix tests to adapt to new duplication behaviour and remove context hack in copy_data (translations are now fully handled in copy_translation)
bzr revid: mat@openerp.com-20131125115727-o9oejao1ziagqti1
2013-11-25 12:57:27 +01:00
Martin Trigaux fbbc6ea840 [FIX] orm: when duplicating translated object, modify the values to get more coherent values
user's language: old (untranslated) -> new (translated)
other language: old (untranslated) -> old (translated)

This allows to have coherent behaviour if copy() method is overwritten to change the text (usually applying _('%s (copy)')). The current user will see the translated terms with modification while the translations are kept for others (and need to be updated).
We prefer keeping slightly irrelevant translations (without translated version of '%s (copy)') for other languages than losing it.

bzr revid: mat@openerp.com-20131125110736-d6iygeq8om5y4fkz
2013-11-25 12:07:36 +01:00
Martin Trigaux 10608a5d18 [FIX] ir_translation: correctly match old and new ids on inherit fields
new_id was correctly handled at rev 5118 but the old_id wasn't which could produce inconsistency if there was a gap in ids

bzr revid: mat@openerp.com-20131122175939-lvlf4ih4pyidqxjp
2013-11-22 18:59:39 +01:00
Denis Ledoux 6fd552c3ce [MERGE] Forward-port of latest 7.0 bugfixes, up to rev. 5139 rev-id: dle@openerp.com-20131121132305-qjlclgz5v9tze1fr
bzr revid: odo@openerp.com-20131120102545-2tlp031yib6viz35
bzr revid: chs@openerp.com-20131120161708-c8sbom592moukwxw
bzr revid: dle@openerp.com-20131121155457-lh7fzouk2upeiu16
2013-11-21 16:54:57 +01:00
Olivier Dony b7865502e4 [FIX] orm.browse_record: access error due to prefetch of indirectly referenced records (OPW #596679)
The browse_record prefetching algorithm attempts to
load data for all known records from the requested
model (i.e. all IDs present in the browse cache),
regardless of how indirectly/remotely they were
referenced. An indirect parent record may therefore
be prefetched along with its directly browsed children,
possibly crossing company boundaries involuntarily.

This patch implements a fallback mechanism when
the prefetching failed due to what looks like an
ACL restriction. This being a fuzzy concept at the
moment, it does its best to only catch a restricted
set of exceptions, and retry loading the data for
the directly requested ID only.

This may cause a small performance penalty in case
of real errors (with some spurious logging too),
but should only be triggered in very few cases.

The downside when this happens is that the prefetching for that
model gets effectively disabled, requiring multiple
SQL queries for further access to the data of
the other directly browsed records.

This EAFP approach seems safer and faster than
a LBYL technique where we would have to filter
all indirect m2o references according to ACLs
before allowing them to enter the cache.

lp bug: https://launchpad.net/bugs/1238042 fixed
lp bug: https://launchpad.net/bugs/1212429 fixed

bzr revid: odo@openerp.com-20131120100627-031fljyf4ckprc9b
2013-11-20 11:06:27 +01:00
jke-openerp 9e980b4e9d bzr revid: jke@openerp.com-20131115165942-pki8hgk1j7qxitk8 2013-11-15 17:59:42 +01:00
Xavier Morel 8e78b40e6a [MERGE] from trunk
bzr revid: xmo@openerp.com-20131115132553-9eqxggih8be63i36
2013-11-15 14:25:53 +01:00
Christophe Simonis ec88c042b2 [MERGE] forward port of branch saas-1 up to revid 4918 chs@openerp.com-20131114134731-n324awyon0spq624
bzr revid: chs@openerp.com-20131114135502-xqi6df3jzm7ng0io
2013-11-14 14:55:02 +01:00
Christophe Simonis 993bff902e [MERGE] forward port of branch 7.0 up to revid 4067 chs@openerp.com-20131114142639-ng7wzfjwvvel2nhv
bzr revid: dle@openerp.com-20131112134311-h1vsux0ge17bsqkc
bzr revid: chs@openerp.com-20131114134731-n324awyon0spq624
bzr revid: chs@openerp.com-20130823145204-xwpnlwg0gg2259f6
bzr revid: chs@openerp.com-20130906170157-e7m4pjskyi47q82o
bzr revid: dle@openerp.com-20130909170408-wxgoduzggap6o4ng
bzr revid: dle@openerp.com-20130919141212-ridtrvvfwvu6calr
bzr revid: dle@openerp.com-20131018120136-fvoq337kgx74njsy
bzr revid: dle@openerp.com-20131023103308-18pj2gqq3imrcir7
bzr revid: chs@openerp.com-20131030180528-hqsztaujjjqev8ky
bzr revid: dle@openerp.com-20131106100128-mx8mnguvp321wick
bzr revid: chs@openerp.com-20131115104909-3u3mu40g9xnler88
2013-11-15 11:49:09 +01:00
jke-openerp 7c58ae62fb [MERGE]0k/web_fullcalendar branch from github
bzr revid: jke@openerp.com-20131106164738-0medo6b8938rphzm
2013-11-06 17:47:38 +01:00
Martin Trigaux 4d9e140b8c [IMP] comments
bzr revid: mat@openerp.com-20131104144427-oyca1g1ti583sq3c
2013-11-04 15:44:27 +01:00
Martin Trigaux 91cf53228b [FIX] orm: when duplicating a record, if duplicates translations on a field from _inherits model, use the id of the parent record instead.
Avoid getting old value by removing 'source' value from read result.

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

bzr revid: mat@openerp.com-20131104143408-o71lyws8uba679hd
2013-11-04 15:34:08 +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
Guewen Baconnier 226ed9abea [FIX] propage the context to not lose special keys/values on write() and explicit the source language to write to (en_US)
lp bug: https://launchpad.net/bugs/1247158 fixed

bzr revid: guewen.baconnier@camptocamp.com-20131101161820-rwzh8zx2nqpb7r2q
2013-11-01 17:18:20 +01:00
Christophe Simonis 82211b1ac2 [MERGE] forward port of branch 7.0 up to revid 5113 launchpad_translations_on_behalf_of_openerp-20131031054724-b9dbttdcrl9eccwr
bzr revid: chs@openerp.com-20131025103657-pbnqhw11mygyi5jn
bzr revid: chs@openerp.com-20131031142125-7bm00z2jpccf3v6f
2013-10-31 15:21:25 +01:00
Christophe Simonis d67ff9ba02 [FIX] views inheritance: deleting a non-existing attribute must be a no-op
bzr revid: chs@openerp.com-20131108175750-yenql6hycpn95i9j
2013-11-08 18:57:50 +01:00
Quentin (OpenERP) c384955cfa [FIX] osv.fields: don't raise an error for searching on dummy fields because it's their main reason to be
bzr revid: qdp-launchpad@openerp.com-20131030102313-64gb1n98rzdg5mx1
2013-10-30 11:23:13 +01:00
Thibault Delavallée 97f164ba99 [MERGE] Sync with trunk
bzr revid: tde@openerp.com-20131028163325-2hpks3hp23zop40n
2013-10-28 17:33:25 +01:00
Christophe Simonis d91819cb43 [MERGE] forward port of branch saas-2 up to revid 4965 chs@openerp.com-20131025103939-5gta1eifjhx1tsmi
bzr revid: chs@openerp.com-20131025104326-4k5hayl0bwdgt0mm
2013-10-25 12:43:26 +02:00
Christophe Simonis 2029aa28eb [MERGE] forward port of branch saas-1 up to revid 4914 chs@openerp.com-20131025103657-pbnqhw11mygyi5jn
bzr revid: chs@openerp.com-20131025103939-5gta1eifjhx1tsmi
2013-10-25 12:39:39 +02:00
Christophe Simonis 2859897815 [FIX] allow falsy extra attributes on fields.
bzr revid: chs@openerp.com-20131024135448-e2bpgaqu7mvg1icn
2013-10-24 15:54:48 +02:00
niv-openerp 5696282656 [MERGE] saas2
bzr revid: nicolas.vanhoren@openerp.com-20131018103501-sns9zca0nmpm9efn
2013-10-18 12:35:01 +02:00
Olivier Dony 54f740960e [MERGE] Forward-port of latest saas-1 bugfixes, up to rev. 4912 rev-id: odo@openerp.com-20131016110621-36vvlpn8dgsabyt1
bzr revid: odo@openerp.com-20131016111800-jjybreg62bwz61zn
2013-10-16 13:18:00 +02:00
Olivier Dony 7cb7405ffd [IMP] orm: _store_get_values: rename variables to make this horror slightly more readable
We keep having to fight variable decay in that function, for some reason.

bzr revid: odo@openerp.com-20131011134501-7b5rflknjm1r9zfd
2013-10-11 15:45:01 +02:00
Olivier Dony 8ac110c4dd [MERGE] Forward-port of latest 7.0 bugfixes, up to rev. 5098 rev-id: odo@openerp.com-20131011123914-7zuvd9mch21yxgj8
bzr revid: dle@openerp.com-20131009131902-a93nsbou4w8y0vlx
bzr revid: chs@openerp.com-20131009175454-j06y1ngylfbqyrpj
bzr revid: dle@openerp.com-20130918160049-fo88fl7uyhfoofkv
bzr revid: dle@openerp.com-20130924130544-kmkyr0d73cusvdav
bzr revid: odo@openerp.com-20131011134433-nyfjipvlql4xu127
2013-10-11 15:44:33 +02:00
Olivier Dony dafa12d92c [FIX] ir.model: FK constraints for custom m2o fields were never created, creating possible data integrity errors
bzr revid: odo@openerp.com-20131010170718-lwoxkqc1tx7i8vhg
2013-10-10 19:07:18 +02:00
Martin Trigaux a0059326fc [IMP] remove useless comment
bzr revid: mat@openerp.com-20131008111631-y47f0y4wyf8hsf2g
2013-10-08 13:16:31 +02:00
Martin Trigaux 9680b1cd39 [IMP] move comment to the right line
bzr revid: mat@openerp.com-20131008105412-pqxpo2q12odjyqp4
2013-10-08 12:54:12 +02:00
Martin Trigaux 241c054b35 [IMP] correctly bound _symbol_f and redifine self._symbol_set_char to keep the API
bzr revid: mat@openerp.com-20131008104737-eellli48re2pfmos
2013-10-08 12:47:37 +02:00
Martin Trigaux 3ae73d572d [FIX] function fields: bound symbol methods of function field (type char) to the correct methods of the char field
lp bug: https://launchpad.net/bugs/1208074 fixed

bzr revid: mat@openerp.com-20131008102135-r7lqvky0vd75yo1q
2013-10-08 12:21:35 +02:00
Thibault Delavallée b74c255168 [MERGE] Sync with trunk until revision 4967 (including al cleaning)
bzr revid: tde@openerp.com-20131007081039-adyay7oy1tpx4g2k
2013-10-07 10:10:39 +02:00
Antony Lesuisse f1faa55cb6 rename links get, allow reference fields without size.
bzr revid: al@openerp.com-20131006114704-mkbheq3l355u21jb
2013-10-06 13:47:04 +02:00
Thibault Delavallée a1d6ac520c [MERGE] Sync with trunk.
Pleave avoid merging with other branches like saas branch, this causes criss-cross issues.
Do things completely instead of tryign to gain 3 minuts.

bzr revid: chm@openerp.com-20131003151612-bmaylm7v3ywqwaux
bzr revid: tde@openerp.com-20131004084936-8xdvfjm2dhtyq07p
2013-10-04 10:49:36 +02:00
Thibault Delavallée c98ff51f72 [FORWARD] Forward port of saas-2 fixes until revision 4957 chs@openerp.com-20130930125946-exr791f83seaa9br
bzr revid: tde@openerp.com-20131003150138-dgi593kd3n0vflgp
2013-10-03 17:01:38 +02: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
Thibault Delavallée 54933118a4 [MERGE] Sync with trunk until revision 4957.
bzr revid: tde@openerp.com-20131002133820-8xomdumexexqp3pk
2013-10-02 15:38:20 +02:00
Martin Trigaux 7fc046e6b3 [IMP] orm: don't compute twice the same function for stored fields if two fields have the same trigger function
bzr revid: mat@openerp.com-20130930140515-4kbzkotjh2ify5vm
2013-09-30 16:05:15 +02:00
Christophe Simonis 03ef8485d7 [FIX] orm: correct read_group when searching by month
bzr revid: chs@openerp.com-20130930125946-exr791f83seaa9br
2013-09-30 14:59:46 +02:00
Martin Trigaux 46020a08da [IMP] store fields: do not add twice the same function field in the store_function list
bzr revid: mat@openerp.com-20130930121511-94a2k0ka91bsgrnf
2013-09-30 14:15:11 +02:00
Xavier Morel c741c0eeb1 [IMP] reimplement t-field using new converters
bzr revid: xmo@openerp.com-20130926145126-21hlubvs39a0z68j
2013-09-26 16:51:26 +02:00
Xavier Morel 789c0d8a6b [ADD] Conversions from field values to "html" content
> many2one --> mettre <br/> si multi-line, html escape le reste (ex:
> adresse sur un event, on a du mettre dans un <pre> mais ce n'est pas
> bien)

> text --> mettre <br/> si multi-line, html escape le reste (ex:
> description d'un produit, à droite)

> char --> normalement pas de multi-line

> fields.binary --> t-field on image field ne semble pas fonctionner
> en écriture (la photo d'une fiche produit)

(validates that the binary field's content is image data by opening it
with PIL, then generates an <img> tag)

TODO:

> fields.float --> utiliser le digits pour formatter les decimals
> correctement (ex: prix d'un produit, à deux décimales)

> On aura aussi besoin d'un widget="currency", un peu comme dans la
> vue form du client web.

bzr revid: xmo@openerp.com-20130926133850-ab14h241q878jbom
2013-09-26 15:38:50 +02:00
Christophe Simonis 28b09221d6 [FIX] orm.BaseModel.exists(): early return if no ids given
bzr revid: chs@openerp.com-20130919114711-ofx2aubtr5z7dgh4
2013-09-19 13:47:11 +02:00
Christophe Simonis fd9a9577df [MERGE] forward port of branch saas-1 up to revid 4908 dle@openerp.com-20130918160049-fo88fl7uyhfoofkv
bzr revid: chs@openerp.com-20130918171816-cxxt3c9ktcq4a8oz
2013-09-18 19:18:16 +02:00
Thibault Delavallée 54c014c4ea [IMP] read_group: group_by -> groupby (same variable, but was used in previous implementation, so I keep it)
bzr revid: tde@openerp.com-20130917100447-u0qhdsw14wdngxwc
2013-09-17 12:04:47 +02:00
Thibault Delavallée 63988959a7 [IMP] read_group: added forgottent year computation
bzr revid: tde@openerp.com-20130916114722-4742fhn4ilhf133e
2013-09-16 13:47:22 +02:00
Thibault Delavallée defa3adbe8 [DOC] read_group: added comments for the new formatting option
bzr revid: tde@openerp.com-20130916103047-lpbf7czflyvgtonu
2013-09-16 12:30:47 +02:00
Christophe Simonis e13ffe7e11 [MERGE] forward port of branch 7.0 up to revid 5075 chs@openerp.com-20130912141018-qmcyase8zqov9d01
bzr revid: chs@openerp.com-20130906165207-1oklc8cqs0rex3kg
bzr revid: dle@openerp.com-20130909170248-a4t5y6qd5ikkhhac
bzr revid: dle@openerp.com-20130911083736-6jfkb140jxbbx7j6
bzr revid: chs@openerp.com-20130912150616-v0c383trj7gaa7eu
2013-09-12 17:06:16 +02:00
Christophe Simonis 1d91378ce2 [FIX] ir.ui.view: properly validate newly created inheriting views
When a new inheriting view is imported during a module
    installation, it is validated thanks to the _constraints
    on the ir.ui.view model. However the validation uses
    a rather convoluted system for validating the whole
    view tree at once (root view + all inherited changes)
    while only taking into account the views that belong
    to modules that are currently loaded.

    This complicated system is necessary to be able to
    operate on-the-fly at any point during the registry
    loading/initialization.

    Now because _constraints are checked during create()
    this particular validation happens *before* the
    external ID (ir.model.data entry) of that new view
    can be created (it obviously needs to wait until
    the view record is inserted). As a consequence the
    view validation cannot determine the module to
    which that new view belongs, and was erroneously
    ignoring it.
    Changing the view filtering to also include views
    that have triggered this check.
    Manually created views are not check during registry
    update.

bzr revid: chs@openerp.com-20130912141018-qmcyase8zqov9d01
2013-09-12 16:10:18 +02:00
Thibault Delavallée aca5e76062 [IMP] orm: first draft of improvign group_by on date field, allowing to tune the grain, format and interval when grouping on a date field. Default behavior is the old one, grouping on month.
bzr revid: tde@openerp.com-20130910104500-sfjosqkmpfxa2jxk
2013-09-10 12:45:00 +02:00
Xavier Morel 367f8dcf83 [FIX] some models rename fields parameter to read, revert passing it by name to positionally
bzr revid: xmo@openerp.com-20130904105318-ib5gwejlplozo12d
2013-09-04 12:53:18 +02:00
Christophe Matthieu c36bfe173e [MERGE] from trunk
bzr revid: chm@openerp.com-20130828161130-641xsmbr8xm53xjx
2013-08-28 18:11:30 +02:00
Fabien Pinckaers 53824ea842 [MERGE] forward port fix from trunk for access rights on /shop
bzr revid: fp@tinyerp.com-20130828095443-pxll7f4cx8g20flm
2013-08-28 11:54:43 +02:00