Commit Graph

430 Commits

Author SHA1 Message Date
Olivier Dony 7f5ad72429 [MERGE] Forward-port 6.1 bugfixes up to rev. 4307
rev.4307 = rev-id launchpad_translations_on_behalf_of_openerp-20121125065030-g5if5pybr61la4yj

bzr revid: odo@openerp.com-20121126160320-t2suuik6lhk6wl0x
bzr revid: odo@openerp.com-20121126161836-mv8yymzgbnmif4ve
bzr revid: odo@openerp.com-20121126162023-ejvsapwouyudw6c6
bzr revid: odo@openerp.com-20121126181527-d4yx15372bis77qj
2012-11-26 19:15:27 +01:00
Quentin (OpenERP) 18b7592b8d [FIX] osv/orm: fixed the use of 'order' argument given to a search function in order to allow to order by 'ID DESC' and by '<another valid order> + ID ASC/DESC'
bzr revid: qdp-launchpad@openerp.com-20121121130736-guj7np9nk65zx3o1
2012-11-21 14:07:36 +01:00
Olivier Dony caa51abb34 [MERGE] fields_view_get: avoid messing up selection fields' _domain attributes, courtesy of Stefan Rijnhart (Therp)
lp bug: https://launchpad.net/bugs/1081092 fixed

bzr revid: odo@openerp.com-20121120132230-7xb6d2xxwcgn7ipn
2012-11-20 14:22:30 +01:00
Olivier Dony f0ef9bda04 [IMP] Model.default_get: allows setting user default values of x2m to False (for consistency with write())
bzr revid: odo@openerp.com-20121120131839-1kdzevubi74ibthy
2012-11-20 14:18:39 +01:00
Stefan Rijnhart d924cec182 [FIX] Append view domain (in case of selection widget) to a copy of the field's domain
lp bug: https://launchpad.net/bugs/1081092 fixed

bzr revid: stefan@therp.nl-20121120121936-8b1wiho0q96ckeqk
2012-11-20 13:19:36 +01:00
Olivier Dony 2a1381a8af [FIX] orm: make sure superuser mode always bypasses access rules filtering - one case was not covered after recent refactoring
Caused by refactoring in rev.4200
revid:odo@openerp.com-20120618094327

bzr revid: odo@openerp.com-20121112120453-axiul7k6y0o67hgb
2012-11-12 13:04:53 +01:00
Xavier Morel be03940d64 [FIX] temperate error message in case of missing required field
The message worked (ish) for a missing field directly on the model,
but completely broke if the missing field was on an o2m and had the
same name as a field on the model, then it was complete
misinformation.

bzr revid: xmo@openerp.com-20121112084804-zcgtpml3a19uv909
2012-11-12 09:48:04 +01:00
Xavier Morel 35c44e7e20 [IMP] savepoint rollbacks after error transformation/logging of pg errors to still have original query on cursor
bzr revid: xmo@openerp.com-20121112084202-4nl94x2omlb4w2jr
2012-11-12 09:42:02 +01:00
Olivier Dony fd6946f24a [IMP] orm: make error handling more consistent when accessing deleted/filtered records
Previous behavior was unspecified and untested - leading to random results
when performing operations on a mix of deleted and ir.rule-filtered records.

The behavior is now clarified and explicitly tested.
One suprising case remains: read() on a deleted record
returns an empty result instead of raising an error,
in order to avoid spurious errors when a client
performs a sequence of search(), read() while
another user is deleting records.

bzr revid: odo@openerp.com-20121109171451-z2m6oqs910103lcz
2012-11-09 18:14:51 +01:00
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 ALT c24639180a [FIX] OPW 575909: orm: fix order_by for special 'id' field not respecting order direction
bzr revid: xal@openerp.com-20120924140007-rnsw4nw8owzqx4ia
2012-09-24 16:00:07 +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