Commit Graph

951 Commits

Author SHA1 Message Date
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