Commit Graph

407 Commits

Author SHA1 Message Date
Xavier Morel 4a4fc38d5e [FIX] nuke ir.model.data caches before starting imports
Otherwise a previous validation (or 2) will poison the cache and the
import itself will fail even though the validation succeeeded (and
importing with no validation would have succeeded), as the orm cache
doesn't take DB rollbacks in account.

bzr revid: xmo@openerp.com-20121109113951-p3qgg6m5g7poay5e
2012-11-09 12:39:51 +01:00
Olivier Dony 0357fddc61 [FIX] orm,web_services: properly return results of workflow triggers
bzr revid: odo@openerp.com-20121106181507-ss1w425c1omsn3sb
2012-11-06 19:15:07 +01:00
Xavier Morel 18f885b10f [FIX] recursive conversion of o2ms in import
added new test cases from gkr

bzr revid: xmo@openerp.com-20121106084206-1cckepflh9h4g1yv
2012-11-06 09:42:06 +01:00
Xavier Morel f02c4266d6 [IMP] better logging during import failure
bzr revid: xmo@openerp.com-20121105100717-pqexs7j710s2ea2i
2012-11-05 11:07:17 +01:00
Divyesh Makwana (Open ERP) 8047c51575 [Merge] Merge with trunk.
bzr revid: mdi@tinyerp.com-20121102102812-qqaob1uo3aj8jpim
2012-11-02 15:58:12 +05:30
Olivier Dony 485e437440 [FIX] orm: _validate should not immediately rollback
For some obscure reason _validate used to immediately
rollback the current transaction as soon as a constraint
failed anywhere. This is completely incorrect and
violates the transaction abstraction: the responsibility
of creating and closing transactions belongs to the
RPC dispatch layer, or whatever takes its place (e.g. the
test setup/teardown for tests). Rolling back or committing
in the middle of a transaction precludes special
error treatment and can have very bad side effects.

bzr revid: odo@openerp.com-20121029180742-2gw08kobdh7w5njc
2012-10-29 19:07:42 +01:00
Purnendu Singh (OpenERP) 1a910d71d6 [IMP] added a comment line
bzr revid: psi@tinyerp.com-20121025062346-ud9m02ah4m9om1vf
2012-10-25 11:53:46 +05:30
Purnendu Singh (OpenERP) 6080eadb4b [MERGE]
bzr revid: psi@tinyerp.com-20121023071213-dd5mu9oce4s3vh9i
bzr revid: psi@tinyerp.com-20121025062105-tkhiybwv77tbqwpr
2012-10-25 11:51:05 +05:30
Quentin (OpenERP) e6e4e8d4c1 [REV] osv/orm: revert of a previous patch that was unifying the behavior for fields.related and fields.function at creation time because it's a bit dangereous to treat it right now, and may need the add of a new field attribute. "I'll be back", said the patch
bzr revid: qdp-launchpad@openerp.com-20121022123100-wwr7lnmpqebddxon
2012-10-22 14:31:00 +02:00
Mayur Maheshwari (OpenERP) cfaff8a85a [IMP]orm : improve multi tag when multi=true action display in tree and when flase action display in form
bzr revid: mma@tinyerp.com-20121019094303-p4mlf9oxlxhuvc48
2012-10-19 15:13:03 +05:30
Quentin (OpenERP) 38067dffc9 [FIX] osv/orm: compute the _fct_inv() of stored functional fields at the record creation. Compute also the _fct_inv() of related fields (because there is no reason not to do it). That last patch revert a 'fix' of lp bug 544087 introduced in revision 4182, i don't get the purpose of it but that bug is not repdocutible anymore...
bzr revid: qdp-launchpad@openerp.com-20121017102821-tjx7gqiz86v7sn54
2012-10-17 12:28:21 +02:00
Vo Minh Thu 7878f9c7b6 [MERGE] babel: use babel for locale-aware read_group date formatting.
When grouping on a date or datetime field, read_group groups by (year, month),
and formats that pair to have a displayable result (as a group title).

This is currently done with strftime and the pattern `%B %Y` (complete word
month, long year), which is problematic as — at best — it uses the server's
locale for its formatting. This means if the server works in an english locale
e.g. russian users are going to see the month name in english, instead of their
own language.

This proposal makes use of `babel.dates.format_date`, which is locale-aware
(and to which a locale can be provided directly) and the locale present in the
request context to format the month, year pair according to the user's
language.

bzr revid: vmt@openerp.com-20121012144634-spaqze7d4jc8l00l
2012-10-12 16:46:34 +02:00
niv-openerp dcae3b64a3 [REVERT] removed server-side evaluation of field options
bzr revid: nicolas.vanhoren@openerp.com-20121011122214-ab1mqyz9h8jnq7ql
2012-10-11 14:22:14 +02:00
Xavier Morel 7a7876d4a8 [MERGE] from trunk
bzr revid: xmo@openerp.com-20121010154605-u16f57fnck148ued
2012-10-10 17:46:05 +02:00
Quentin (OpenERP) f4f3d6fa15 [REF] code review by odo
bzr revid: qdp-launchpad@openerp.com-20121010104220-nqi6c12ua7tnaejt
2012-10-10 12:42:20 +02:00
Quentin (OpenERP) 90fc4d6651 [IMP] use of literal_eval from ast instead of const_eval from tools, as per Olivier recommendation
bzr revid: qdp-launchpad@openerp.com-20121009152828-3bdxpatkrl1qmyfi
2012-10-09 17:28:28 +02:00
Quentin (OpenERP) c98de15a09 [IMP] osv/orm.py: evaluate in python the 'options' attribute of a field in an xml view, before enclosing it in json. This allow to use python instead of json syntax in the definition of the options of a widget, which is a much more consistent behavior
bzr revid: qdp-launchpad@openerp.com-20121009142607-rk3l00atu3w3kksp
2012-10-09 16:26:07 +02:00
Xavier Morel 510eea5305 [CHG] make empty cells clear out the corresponding field on import, rather than skip them
bzr revid: xmo@openerp.com-20121009092519-ge86yp3nnkqe9gic
2012-10-09 11:25:19 +02:00
Xavier Morel e8af13f0e8 [IMP] don't pass in a default lang to _get_source if no value is provided in the context, caught by odo
bzr revid: xmo@openerp.com-20121008133823-vhypgddiicztai3a
2012-10-08 15:38:23 +02:00
Xavier Morel 350d365ba0 [IMP] remove docstring for cr, uid following odo review
bzr revid: xmo@openerp.com-20121008131407-5hnxkn17lycfoqzu
2012-10-08 15:14:07 +02:00
Raphael Collet 4f235060a7 [MERGE] from trunk
bzr revid: rco@openerp.com-20121005124845-suonokozsufyicg2
2012-10-05 14:48:45 +02:00
Xavier Morel 601568f5f9 [FIX] don't import empty cells at all rather than set them to False, to allow defaults handling to do its job before actually creating the record
bzr revid: xmo@openerp.com-20121004064215-fqgir3ovmte2v438
2012-10-04 08:42:15 +02:00
Xavier Morel 1e4a677f05 [MERGE] from trunk
bzr revid: xmo@openerp.com-20121010154436-wz29sdkbs9vvhjba
2012-10-10 17:44:36 +02:00
Christophe Simonis b7e5519b4c [FIX] orm: handle fields.char() with not size correctly
bzr revid: chs@openerp.com-20121001153753-um68vpz1caojm17r
2012-10-01 17:37:53 +02:00
Christophe Simonis 5763e40506 [IMP] orm: remove trailing spaces
bzr revid: chs@openerp.com-20121001151421-vdfkzuf864rz8q20
2012-10-01 17:14:21 +02:00
Christophe Simonis 273904d103 [IMP] orm: be more vebose when accessing an invalid field of browse_record objects
bzr revid: chs@openerp.com-20121001150305-recozdvfc68wc766
2012-10-01 17:03:05 +02:00
Xavier Morel 84332d8aad [FIX] type error when providing a non-integer for a default database id
bzr revid: xmo@openerp.com-20121001130530-yf6pzuxdi3s09tji
2012-10-01 15:05:30 +02:00
Raphael Collet 0d878dc99e [FIX] orm: fix the method copy() when an 'inherits' field is given in parameter default
bzr revid: rco@openerp.com-20120928120202-6fbayrwb1iszwfwv
2012-09-28 14:02:02 +02:00
Xavier Morel 879886decd [ADD] some import doc
bzr revid: xmo@openerp.com-20120928091519-ksdprqdq0tpklggw
2012-09-28 11:15:19 +02:00
Xavier Morel aaff4459c4 [DOC] fixes and cleanups
bzr revid: xmo@openerp.com-20120928065654-jj3ot17dz8vd3wum
2012-09-28 08:56:54 +02:00
Xavier Morel def7e61901 [IMP] reimplement BaseModel.import_data on top of BaseModel.load
adapt tests to assert the corrected behavior of load instead of import_data's broken behavior

bzr revid: xmo@openerp.com-20120927154244-e56ygz2yytullg2l
2012-09-27 17:42:44 +02:00
Xavier Morel 87af7a6365 [FIX] replace warnings capture by explicitly returning a list of warnings from converters
makes converter code noisier, but ultimately simpler without having access to dynamically scoped variables

bzr revid: xmo@openerp.com-20120927144341-j1dx3e0epf3i5ja6
2012-09-27 16:43:41 +02:00
Xavier Morel 9d175bdfd6 [FIX] postgres 9.2 added data at the end of 23502's error message, only use prefix matches not fullstring
bzr revid: xmo@openerp.com-20120927095038-m2vm663nqj1s1pne
2012-09-27 11:50:38 +02:00
Xavier Morel e61dc50934 [IMP] convert empty import fields to False values without going through converters
simplifies the converter methods by avoiding redundant emptiness checks

bzr revid: xmo@openerp.com-20120925155915-82p2s6stpww37p5n
2012-09-25 17:59:15 +02:00
Xavier Morel d5c69fa87e [FIX] use lists instead of iterators in BaseModel._extract_records
* although it does use an explicit external index, it turns out the
  code is less complex

* the rewrapping of (many) iterators on top of one another ended up
  blowing Python's stack during ``next`` calls, which Python does
  *not* like

* added a 900-ish import test file to check for these things

bzr revid: xmo@openerp.com-20120925135955-oielhopegnefyctm
2012-09-25 15:59:55 +02:00
Xavier Morel 359b4a44aa [ADD] ability to convert postgres error messages to human-readable ones
also convert 'violates not-null constraint' to something about fields being required

bzr revid: xmo@openerp.com-20120925100232-bfmxcxda65cki5kv
2012-09-25 12:02:32 +02:00
Xavier Morel 9f2e7ba7ef [IMP] return a dict from Model.load for easier future extensibility (if needed) rather than a tuple.
also easier/cleaner to unpack on the JS side

bzr revid: xmo@openerp.com-20120924151502-4robe639ctpuvb94
2012-09-24 17:15:02 +02:00
Xavier Morel f143902d1a [IMP] allow converters to add data to import messages, formalize message keys
bzr revid: xmo@openerp.com-20120924150417-c2y7g7vdsfz66363
2012-09-24 17:04:17 +02:00
Xavier Morel 877e21ffde [IMP] return fields_get-style translated field strings (if available) in user-readable warning and error messages from import, rather than logical field names
bzr revid: xmo@openerp.com-20120924105230-1b7157xbruy2e5zr
2012-09-24 12:52:30 +02:00
olt@tinyerp.com 649cf2e677 [FIX] fixed message format (wrong number of arguments)
bzr revid: olt@tinyerp.com-20120920145519-j842fb8woer25p8i
2012-09-20 16:55:19 +02:00
Xavier Morel 9805c665c8 [ADD] big bit on new import: pretty much everything but o2m
bzr revid: xmo@openerp.com-20120919114047-w4paoim95oxr91zb
2012-09-19 13:40:47 +02:00
Odowan Kenobi 4b896c36af [REF] allow to intercept the signals sent to workflows (through buttons) in objects. This is done by adding a function named _workflow_signal() in orm that can be inherited in dedicated objects. Courtesy from Olivier Dony
bzr revid: qdp-launchpad@openerp.com-20120918130436-ll7potrsya23lc36
2012-09-18 15:04:36 +02:00
Antonin Bourguignon d6c4049865 [FIX] fields_get check_access_right
bzr revid: abo@openerp.com-20120913144641-ybtrvd4vyf7nfium
2012-09-13 16:46:41 +02:00
Olivier Dony 423aca905a [IMP] translations: attempt to optimize out _get_source calls when there is not context lang
bzr revid: odo@openerp.com-20120912142229-ir3h1z0yau09ivvw
2012-09-12 16:22:29 +02:00
Stephane Wirtel 5acd867264 [MERGE] set the write_uid, write_date for the create
bzr revid: stw@openerp.com-20120912102759-di842t8uzzmm2f21
2012-09-12 12:27:59 +02:00
Stephane Wirtel c735a2c0ec [MERGE] report & netrpc protocol: Use the cPickle 2.0 protocol and clean the code of report
bzr revid: stw@openerp.com-20120911091836-ac0wdxqslcwwbku6
2012-09-11 11:18:36 +02:00
Stephane Wirtel f55028de4d [MERGE] server: remove unused imports (Thanks to Florent Xicluna)
bzr revid: stw@openerp.com-20120910144609-ad3gupkf3oseb8yy
2012-09-10 16:46:09 +02:00
Raphael Collet cbcfe23802 [IMP] orm: simplify method definition
bzr revid: rco@openerp.com-20120907151016-fj7l6nt6uffxmdgh
2012-09-07 17:10:16 +02:00
Raphael Collet 5feea1cfa8 [MERGE] from trunk
bzr revid: rco@openerp.com-20120907150534-eyj92gtq40c83e3v
2012-09-07 17:05:34 +02:00
Raphael Collet 67003bd76f [FIX] method resolve_2many_commands and its tests
bzr revid: rco@openerp.com-20120907122857-4dro8up51ypx0cr5
2012-09-07 14:28:57 +02:00