Commit Graph

737 Commits

Author SHA1 Message Date
Raphael Collet 020921a7f3 [IMP] orm: remove commented code
bzr revid: rco@openerp.com-20140123094957-knrgx6sy66j4tj39
2014-01-23 10:49:57 +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
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
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
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
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
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
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 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 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
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
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 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
Thibault Delavallée 97f164ba99 [MERGE] Sync with trunk
bzr revid: tde@openerp.com-20131028163325-2hpks3hp23zop40n
2013-10-28 17:33:25 +01: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
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 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 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
Xavier Morel 5684c5d286 [IMP] search_read code
bzr revid: xmo@openerp.com-20130821135853-i9g6cvi52onrmmte
2013-08-21 15:58:53 +02:00
Olivier Dony 4eb9059480 [IMP] BaseModel.fields_view_get: warn about non-qualified *_view_ref references
lp bug: https://launchpad.net/bugs/1214799 fixed

bzr revid: odo@openerp.com-20130821122955-8c9z0mi8cu48rne3
2013-08-21 14:29:55 +02:00
Christophe Simonis 208b697239 [MERGE] forward port of branch saas-1 up to revid 4899 chs@openerp.com-20130821094758-1ae0d1ml5obufzxv
bzr revid: odo@openerp.com-20130820160346-qcdy4kavgm5cb9t6
bzr revid: chs@openerp.com-20130821103139-zqqbrt8dq6iixrny
2013-08-21 12:31:39 +02:00
Olivier Dony fbd0758cb5 [MERGE] Forward-port of latest 7.0 bugfixes, up to rev. 5054 rev-id: odo@openerp.com-20130820091157-e5brwlxuhujf8rrd
bzr revid: chs@openerp.com-20130724085026-525l9apggc9yzx0h
bzr revid: odo@openerp.com-20130730140644-1xih0as5jsks4pub
bzr revid: dle@openerp.com-20130801130723-khgwjkglgsdn34fj
bzr revid: odo@openerp.com-20130820091638-jpbcmh653bpa29em
2013-08-20 11:16:38 +02:00
Christophe Simonis e78a83ac03 [FIX] browse records do not prefetch fields with groups
bzr revid: chs@openerp.com-20130819174930-xjzmrhuuuuwnbdg0
2013-08-19 19:49:30 +02:00
Christophe Simonis 815fc8f84a [FIX] browse records do not try to prefetch fields user can't read
bzr revid: chs@openerp.com-20130819164622-7cre7yqpvlyzsslj
2013-08-19 18:46:22 +02:00
Christophe Matthieu 27b69126d2 [MERGE] from trunk
bzr revid: chm@openerp.com-20130726141834-9nroj7wi4fjhd5s4
2013-07-26 16:18:34 +02:00
Thibault Delavallée f737eb63d0 [IMP] ir_actions_server: added doc + comments + recursion check
orm: added _check_m2my_recursion, to check loops in many2many recursive fields
tools: removed sms_send

bzr revid: tde@openerp.com-20130725104914-dutxfon3odp8z167
2013-07-25 12:49:14 +02:00
Christophe Simonis 5a5d9d5941 merge upstream
bzr revid: chs@openerp.com-20130702191613-djzicmgpvrhh05zi
2013-07-02 21:16:13 +02:00
Christophe Simonis 5a58a48ef5 [MERGE] forward port of branch saas-1 up to revid 4893 chs@openerp.com-20130701153735-xnbb8zauabf1k63u
bzr revid: chs@openerp.com-20130702144745-763n9cdphkppshxl
2013-07-02 16:47:45 +02:00
Antony Lesuisse b0a348d24e fields_view_get view_id
bzr revid: al@openerp.com-20130701130258-52nvw8aj6s8bcjaf
2013-07-01 15:02:58 +02:00
Antony Lesuisse 3b0935325e fields_view_get apply post processing even for default views
bzr revid: al@openerp.com-20130701122626-9g2uo6ox3p74e55q
2013-07-01 14:26:26 +02:00
Antony Lesuisse 05c9b607f8 fix rng validation, fields_view_get, qweb t-esc t-raw default
bzr revid: al@openerp.com-20130630213515-go5qr2dmo0xlazvr
2013-06-30 23:35:15 +02:00
Antony Lesuisse 932efea388 untangle inheritance and postprocessing
bzr revid: al@openerp.com-20130629213516-pqcl6oz1g3o5tpgn
2013-06-29 23:35:16 +02:00
Denis Ledoux 9f4397fc85 [MERGE]forward port of latest 7.0 bugfixes, up to rev 5017
rev 5017 = launchpad_translations_on_behalf_of_openerp-20130626061833-drxvzosffezp089g

bzr revid: dle@openerp.com-20130627120342-znttbs00q5bkf4ov
2013-06-27 14:03:42 +02:00
Stefan Rijnhart 216f4d5e66 [FIX] Do not search for model = table name in previous commit
bzr revid: stefan@therp.nl-20130626140439-3emprb4ewc2xlcsy
2013-06-26 16:04:39 +02:00
Stefan Rijnhart 126b49075d [FIX] Export creates xml id based on wrong table name
lp bug: https://launchpad.net/bugs/1194893 fixed

bzr revid: stefan@therp.nl-20130626135842-sdbvopuen0s7liv9
2013-06-26 15:58:42 +02:00
Christophe Simonis c0115e7597 [FIX] orm: Do not prefetch custom fields.
When installing or updating a module, custom fields referring custom model
(many2one) cannot be read because custom model are not loaded at this stage
(they are only loaded after all modules because they can refer any model).
Not prefetching them avoid crash when computing stored function fields.

bzr revid: chs@openerp.com-20130626091332-231rqg5ouhnc3d2x
2013-06-26 11:13:32 +02:00
Antony Lesuisse f4332b9b60 [MERGE] trunk
bzr revid: al@openerp.com-20130625162755-d6552p98m5jiw941
2013-06-25 18:27:55 +02:00
Antony Lesuisse 4f76c69b76 [MERGE] trunk
bzr revid: al@openerp.com-20130620151512-p5ysov21an6ogbtv
2013-06-20 17:15:12 +02:00
Olivier Dony 9a5e317618 [FIX] OPW 592482: browse_record should not prefetch binary fields
This was apparently a long-standing issue due to a
strange handling of the _prefetch attribute on
columns: accessing a column would only trigger
the prefetching if its _prefetch attribute was
True, but the prefetching itself would also
prefetch columns that had _prefetch False.

We clearly want it the other way around, or
at least we want _prefetch to decide whether
a column is included in any given prefetching
pass. We can skip the prefetching pass when
the only field being accessed has _prefetch
False because it is likely the other fields
have already been prefetched separately.
This last subtlety should not make any
noticeable performance difference.

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

bzr revid: odo@openerp.com-20130620131057-v7s4qfqj976j3ufo
2013-06-20 15:10:57 +02:00
Quentin (OpenERP) 31d05360b2 [REF] fields: removed deprecated view_load attribute and removed useless first argument in property fields definition
bzr revid: qdp-launchpad@openerp.com-20130619091332-29pisdnyfemn1u3d
2013-06-19 11:13:32 +02:00
niv-openerp 7822665429 added search_read
bzr revid: nicolas.vanhoren@openerp.com-20130621091332-s37ma5gbg88999xv
2013-06-21 11:13:32 +02:00
niv-openerp a94bbf8e5e [FIX] Merge fix in saas1 for the problem that made the server crash when install a db
bzr revid: nicolas.vanhoren@openerp.com-20130610144915-0nj8vpk7n84ocj3f
bzr revid: nicolas.vanhoren@openerp.com-20130610150657-3xddn91gm0iq0ubp
bzr revid: nicolas.vanhoren@openerp.com-20130610154514-oee6s4f9g17bx63z
2013-06-10 17:45:14 +02:00
Vo Minh Thu 8d0a477644 [IMP] ir_ui_view: do not use _logger.exception() (because there is no exception), add a check on `model`.
bzr revid: vmt@openerp.com-20130605121143-u2nkmcmeifphr54h
2013-06-05 14:11:43 +02:00
Vo Minh Thu 0019a86ecf [MERGE] orm: add _sql_contraints only when _auto.
bzr revid: vmt@openerp.com-20130604115402-4cf07eq53o6ocs39
2013-06-04 13:54:02 +02:00
Olivier Dony b16935efdc [IMP] orm: include forbidden IDs when logging ir.rules violations, to make troubleshooting easier
bzr revid: odo@openerp.com-20130604111354-1x5yc305okhx5ujk
2013-06-04 13:13:54 +02:00
Vo Minh Thu 6f1531f1d3 [MERGE] orm: add __iter__ method on browse_null.
Otherwise Python falls back to __getitem__ when trying to loop over it
or when trying to test `in`.

bzr revid: vmt@openerp.com-20130604081706-z79vqj36ls2adw09
2013-06-04 10:17:06 +02:00
Ronald Portier 4634dd6f8e [FIX] Add __iter__ method to browse_null to prevent server hang.
lp bug: https://launchpad.net/bugs/1172292 fixed

bzr revid: ronald@therp.nl-20130424142958-u5r2mxtxqj9v431h
2013-04-24 16:29:58 +02:00
Xavier Morel c08513763c [NOTSURE] move __view_look_dom_arch into ir.ui.view
Also alter BaseModel._view_look_dom_arch to proxy to method above.

bzr revid: xmo@openerp.com-20130424135825-grjfgbjuc4ozzdqy
2013-04-24 15:58:25 +02:00
Xavier Morel 66121aaec7 [IMP] try to make __view_look_dom_arch independent from model
bzr revid: xmo@openerp.com-20130424133716-6qm0n00yiussz1ra
2013-04-24 15:37:16 +02:00
Xavier Morel fb492d98ba [ADD] behavior and tests for default & ancestors, fallback handling in read_combined
bzr revid: xmo@openerp.com-20130424130907-6d6lkrkrgqv0hsfq
2013-04-24 15:09:07 +02:00
Xavier Morel 8715746672 [IMP] move stuff around, try building flatter top-down API with read_combined as utility 'do all the things' hook
bzr revid: xmo@openerp.com-20130424095114-4nw0nfuxzx4n1ltv
2013-04-24 11:51:14 +02:00
Christophe Simonis 261dea6fec [MERGE] forward port of server v7 up to revision 4954
bzr revid: qdp-launchpad@openerp.com-20130422093655-txqmbalod6qmw1s6
bzr revid: chs@openerp.com-20130423183723-9kiexdyzdew8iuzm
2013-04-23 20:37:23 +02:00
Xavier Morel dfc1800305 [MERGE] from trunk to match addons
bzr revid: xmo@openerp.com-20130423155233-c7tyowoqsfzzdjv8
2013-04-23 17:52:33 +02:00
Xavier Morel 3ac47a587e [IMP] remove deprecated explicit setting of type on views
bzr revid: xmo@openerp.com-20130423154456-wt4aeb6yr963jbye
2013-04-23 17:44:56 +02:00
Xavier Morel d40ec67c2d [IMP] move application of view inheritance outside of fields_view_get and into View.
change get_root_ancestor to return just the id of the ancestor view

bzr revid: xmo@openerp.com-20130423150844-eubxue9vbtc6jhof
2013-04-23 17:08:44 +02:00
Xavier Morel dd43214fe1 [ADD] tests to get_root_ancestor
use a default view_type of form in the tests, because whatever

bzr revid: xmo@openerp.com-20130423132523-upbgbt2a3r7cgs08
2013-04-23 15:25:23 +02:00
Xavier Morel aef4ce51a7 [IMP] move fetching of root view into ir.ui.view
bzr revid: xmo@openerp.com-20130423124657-zkogrodgdw0ymf2f
2013-04-23 14:46:57 +02:00
Xavier Morel c212710f25 [IMP] move resolution of view_ref outside of root-ancestor-searching loop
bzr revid: xmo@openerp.com-20130423111929-fs49v0xrahqsi48u
2013-04-23 13:19:29 +02:00
Xavier Morel e996f92e6c [REF] move apply_inheritance_specs to ir.ui.view
also moved raise_view_error utility function

bzr revid: xmo@openerp.com-20130423105856-558rl6ankd4g3qb0
2013-04-23 12:58:56 +02:00
Xavier Morel b0f2d3044a [FIX] don't 'double tap' when applying view inheritance
iter(exclude_base=False) would add the base view (being extended) to the sequence, and thus start by extending the base view with itself.

bzr revid: xmo@openerp.com-20130423100845-ryumkx12cwv60pc1
2013-04-23 12:08:45 +02:00
Xavier Morel 980e01d386 [IMP] attempt to remove lexical dependencies from fvg's nested functions
should allow moving most of the view inheritance application into
ir.ui.view, where it should belong.

bzr revid: xmo@openerp.com-20130422142444-f09sw841jop3t4a4
2013-04-22 16:24:44 +02:00
Xavier Morel edf1f23a6e [ADD] depth-first iterator on views, refactor apply_view_inheritance to use it
bzr revid: xmo@openerp.com-20130422125000-pg60ovrxejegenka
2013-04-22 14:50:00 +02:00
Xavier Morel aa9406e28b [IMP] move locate inner function to ir.ui.view method
bzr revid: xmo@openerp.com-20130419141409-a2jqq5maszc53e6s
2013-04-19 16:14:09 +02:00
Quentin (OpenERP) d621d26516 [FIX] orm, _generate_order_by(): allow to order by LOG_ACCESS_COLUMNS even if the column is not defined again in self._columns. Raising an error instead of silently skipping the order_by
bzr revid: qdp-launchpad@openerp.com-20130419145417-2tix8ynmx51qiqkf
2013-04-19 16:54:17 +02:00
Olivier Dony 8efd16f25a [FIX] res.partner, orm._check_recursion: prevent recursive partner structures + fix false positives in check_recursion()
- res.partner must prevent creating loops in partner
hierarchies, and this can be done easily with an
extra _constraint using the ORM's builtin _check_recursion

- _check_recursion's implementation incorrectly
assumed that the provided 'ids' were unrelated
(not part of a common hierarchy).

- add tests for _check_recursion via extra
tests on res.partner structure
(explains why both patches are in the same
commit)

bzr revid: odo@openerp.com-20130415171732-aj3j2e2mycvzf4kp
2013-04-15 19:17:32 +02:00
Xavier Morel bbe0fbe2b9 [IMP] use ORM reads when loading views
direct SQL query in core ORM means we can't override view loading to
get them from other sources than the database. By using read() this
can be done by overriding ir_ui_view.read.

bzr revid: xmo@openerp.com-20130415100858-ucm97f318mjn5ugq
2013-04-15 12:08:58 +02:00
Raphael Collet 05851d21ba [MERGE] from trunk
bzr revid: rco@openerp.com-20130411073017-x6e4h8xbvmy3ofdw
2013-04-11 09:30:17 +02:00
Thibault Delavallée 2ab15ddeaf [MERGE] Sync with trunk.
bzr revid: tde@openerp.com-20130405110750-1dd4y02xz3wb6ill
bzr revid: tde@openerp.com-20130405133237-n7k66b3w0b3a17o3
2013-04-05 15:32:37 +02:00
Vo Minh Thu 307ca374d6 [MERGE] forward merge 7.0 until revision 4919.
bzr revid: vmt@openerp.com-20130404130704-24vsmczw34cssytd
2013-04-04 15:07:04 +02:00
Raphael Collet 09be864f1d [IMP] replace all tests like 'registry.get(X)' by 'X in registry' where X is non static
bzr revid: rco@openerp.com-20130329140723-dnrl02saky570xg0
2013-03-29 15:07:23 +01:00
Thibault Delavallée 655ef77092 [MERGE] Sync with trunk.
bzr revid: tde@openerp.com-20130328092414-htawc7j3jrxte866
2013-03-28 10:24:14 +01:00
Thibault Delavallée 5c091dd8e2 [CLEAN] BaseModel: moved get_empty_list_help method to a better place in the code; added some comments.
bzr revid: tde@openerp.com-20130328092357-v3grmw9brp9wtfj0
2013-03-28 10:23:57 +01:00
Chris Biersbach 15bd42f5e5 [FIX] Removes the limit of 64 characters from additional text fields added via the interface
lp bug: https://launchpad.net/bugs/1053511 fixed

bzr revid: cbi@openerp.com-20130327132335-tro1p1n5at042jfb
2013-03-27 14:23:35 +01:00
Vo Minh Thu 2829882389 [IMP] orm: added a print_report() method.
bzr revid: vmt@openerp.com-20130325143256-f8hw66j09310cgjo
2013-03-25 15:32:56 +01:00
Thibault Delavallée 4e74279576 [MERGE] Sync with trunk.
bzr revid: tde@openerp.com-20130322090938-xoh67sg08m3ylcrk
2013-03-22 10:09:38 +01:00
Christophe Matthieu 491c3b73f3 [IMP] code cleaning for get_empty_list_help
bzr revid: chm@openerp.com-20130321133207-j4tiibjev6lkeuxa
2013-03-21 14:32:07 +01:00
Vo Minh Thu 067cd7d15a [FIX] ir_model_data: create the _inherits parent external ID prior to the child.
This is needed so the uninstall process can simply go through
the installed data by using the ir_model_data entries in reverse
order (when ordered by IDs), so that parents are deleted before
children.

bzr revid: vmt@openerp.com-20130321133202-igea1vxlszfpk6pe
2013-03-21 14:32:02 +01:00
Christophe Matthieu 45cc77dbcb [MERGE] from trunk
bzr revid: chm@openerp.com-20130320133155-qn27q8aek7zp1ls4
2013-03-20 14:31:55 +01:00
Xavier Morel 9494f21ea8 [FIX] __getattr__ implementation on BaseModel
object has no __getattr__, in the usual case super(BaseModel,
self).__getattr__ will blow up with an AttributeError (but the wrong
one).

On the other hand, if a BaseModel descendant class is used in MI
alongside a non-BM descendant (e.g. res_partner inheriting from Model
and format_address) and the non-BM descendant also implements
__getattr__, we want to forward the failed attr search to the other
__getattr__ implementation.

So check if super() has a __getattr__, call it if it does otherwise
AttributeError right there.

bzr revid: xmo@openerp.com-20130315115302-z7jla334gb9a5e43
2013-03-15 12:53:02 +01:00
Vo Minh Thu c79c23d26e [REF] orm:
- isinstance(ids, dict) is done at the end, but not at the beginning,
so if ids was a single dict, it would break in the map(lambda).
- The loop to convert None to False can be done in _read_flat instead
of read (there is already plenty of loops in _read_flat)
- The __getattr__ was breaking the stacktrace.

bzr revid: vmt@openerp.com-20130314154418-0wmxfw1ot92kjmzf
2013-03-14 16:44:18 +01:00
Chris Biersbach 6b80f5bdff [FIX] orm: moves the access_rule check to the end of the create method to avoid getting errors when trying to create and m2m values are passed, which can cause the rules to fail
bzr revid: cbi@openerp.com-20130314092017-agwzvwwbxev531kk
2013-03-14 10:20:17 +01:00
Christophe Matthieu a37aea3a85 [MERGE] from trunk
bzr revid: chm@openerp.com-20130313141600-pyazzzanowtrfjja
2013-03-13 15:16:00 +01:00
Guewen Baconnier c377140650 [FIX] add SQL constraints only for models stored in database (not on AbstractModel)
lp bug: https://launchpad.net/bugs/1151703 fixed

bzr revid: guewen.baconnier@camptocamp.com-20130307085826-omhoc3clix41zydl
2013-03-07 09:58:26 +01:00
Vo Minh Thu f1adca94c0 [MERGE] netsvc/service.model: added missing/removed unnecessary `except` clauses.
bzr revid: vmt@openerp.com-20130225155828-a364gk3ii2prxe0b
2013-02-25 16:58:28 +01:00
Fabien Pinckaers b831c5aa15 [iMP] error message simplified for required values
bzr revid: fp@openerp.com-20130224135248-wdxg8d3fi79lp88z
2013-02-24 14:52:48 +01:00
Olivier Dony a961e5e377 [MERGE] search: when count=True, execute main query as a subquery to avoid side effects with offset and limit
Granted, calling search() with both count=True and
offset or limit is not extremely useful, but
it is still better to accept it and apply it
to the inner query rather than have silly
errors

bzr revid: odo@openerp.com-20130220174416-yoos2py8dc9jc3md
2013-02-20 18:44:16 +01:00
Vo Minh Thu 9412351315 [IMP] Only unhandled exceptions are logged to the console by the netsvc layer.
bzr revid: vmt@openerp.com-20130220115337-6319hshm4vfwlr1o
2013-02-20 12:53:37 +01:00
Raphael Collet 0f43032b82 [FIX] search: when count=True, execute main query as a subquery to avoid side effects with offset and limit
bzr revid: rco@openerp.com-20130218145100-4q24j8ko9j9elwpw
2013-02-18 15:51:00 +01:00
Quentin (OpenERP) 0a27066e54 [REF] code review
bzr revid: qdp-launchpad@openerp.com-20130215143503-6a6x53gdeb6j33tm
2013-02-15 15:35:03 +01:00
Antonin Bourguignon 74ba45d1fc [MERGE] trunk
bzr revid: abo@openerp.com-20130214173522-2ama9xjn4c2hloap
2013-02-14 18:35:22 +01:00
Raphael Collet 70bda50f7d [IMP] rename model method 'trigger_workflow' into 'step_workflow' (less confusing)
bzr revid: rco@openerp.com-20130213150134-wocd9ey2pubpa3xn
2013-02-13 16:01:34 +01:00
Raphael Collet f78eb868fd [IMP] remove model methods _workflow_trigger and _workflow_signal, and replace calls to new workflow methods
bzr revid: rco@openerp.com-20130213140046-84aa1xtlndltlhzy
2013-02-13 15:00:46 +01:00
Antonin Bourguignon f929ebc73b [MERGE] trunk
bzr revid: abo@openerp.com-20130213105620-xyez3q7ddgc0x5x8
2013-02-13 11:56:20 +01:00
Raphael Collet 6f045b48e8 [MERGE] from trunk
bzr revid: rco@openerp.com-20130213082352-t3wbhkxfh3z10ukt
2013-02-13 09:23:52 +01:00
Vo Minh Thu c99c4091ce [REM] Deleted .apidoc lines.
They were probably used by some tools. How sad.

bzr revid: vmt@openerp.com-20130212142410-zqdjd8jw3gtvxab0
2013-02-12 15:24:10 +01:00
Antonin Bourguignon fbb51ee106 [MERGE] trunk
bzr revid: abo@openerp.com-20130212125650-3r8lsai6p5c8ls2h
2013-02-12 13:56:50 +01:00
Antonin Bourguignon e274ccc7cb [MERGE] trunk
bzr revid: abo@openerp.com-20130211150920-c5yam3yykht1qdpn
2013-02-11 16:09:20 +01:00
Xavier Morel 4a9d82621e [IMP] don't log from import when converting psycopg exceptions to output messages
add conversion for unique constraints, test behavior on unique constraint failure

bzr revid: xmo@openerp.com-20130211143647-l16ssw9z73stbgyc
2013-02-11 15:36:47 +01:00
Xavier ALT 4db48cc102 [MERGE] BUG 1082003: orm: _rec_name should be checked on _all_columns not _columns
bzr revid: xal@openerp.com-20130211092411-3eeo2ann5jnttliq
2013-02-11 10:24:11 +01:00
Vo Minh Thu 6b459a1f27 [DOC] orm: documented workflow-related methods.
bzr revid: vmt@openerp.com-20130206150244-hs67hhe35okl42ei
2013-02-06 16:02:44 +01:00