Commit Graph

448 Commits

Author SHA1 Message Date
Vo Minh Thu f668a123d9 [IMP] Reduce considerably the loading time of a new registry.
Loading time was mesured on the loading of a second database (identical to the
first one), i.e. by passing -d xx,yy on the command line, using cProfile. The
databases were installed with sale, mrp, and the crm.

The cProfile code is commited as part of this patch and should be removed (or
maybe guarded by some command-line flag) (just as the commenting-out of the
cron startup).

The patch was also applied on top of the trunk-simple-table-stats-vmt branch
which provides SQL queries counters.

Results indicate that the number of SQL queries are reduced from about 2100 to
27. Loading time is reduced from 1.3s to 0.26s (i.e. improved by 5).

Changes:

All calls to ir_model_fields to fetch manual (custom) fields are done in a
single call (prior to instanciate all models).

Checks for empty module descriptions are not done unless we are in init or
update mode. (The behavior was the opposite, which was probably a mistake).

Some calls to ir_translation, passing en_US because there was no lang in the
context, are not done anymore.

The improved time is also a result of a change in the decimal_precision module
where precision_get fetches all digits/applications instead of one at a time
(and thus implements its own caching instead of relying on
openerp.tools.ormache).

bzr revid: vmt@openerp.com-20121211105954-lwgs5js7yw3tzghs
2012-12-11 11:59:54 +01:00
Thibault Delavallée f0abd6f49e [MERGE] Sync with trunk.
bzr revid: tde@openerp.com-20121210083805-1t45n6xxmptpo28o
2012-12-10 09:38:05 +01:00
Antony Lesuisse a6700e0e3f [MERGE] multiprocess signaling
trying trunk, feature branch fails with Address already in use

bzr revid: al@openerp.com-20121208210954-pi55sib4x7eyamem
2012-12-08 22:09:54 +01:00
Antony Lesuisse 3d2a09a973 multiprocessing signaling manually backported from 6.1
bzr revid: al@openerp.com-20121208181151-lfy956ysnok5b5hf
2012-12-08 19:11:51 +01:00
Christophe CHAUVET 82b17c82a4 [IMP] Remove completly the OIDS, cause WITHOUT OIDS is activate by default
bzr revid: christophe.chauvet@syleam.fr-20121207162110-75hbq71zc6ufeby9
2012-12-07 17:21:10 +01:00
Thibault Delavallée bb598cd105 [CLEAN] orm: added quote around a forgottent table name; cleaned a bit some code and added comments, removed dead code.
bzr revid: tde@openerp.com-20121207162019-ec1x7a38vw2rrqze
2012-12-07 17:20:19 +01:00
Thibault Delavallée 61a2a82174 [MERGE] Merged branch holding a proposal to solve the generate_order_by issue (see lp:1070757). As requested by Olivier Donny, this fix has been moved into generate_order_by. Deleted previous workaround done in this branch. Patch courtesy of Paulius Sladkevičius
bzr revid: tde@openerp.com-20121207155825-9bjvuxhyr0x937l7
2012-12-07 16:58:25 +01:00
Thibault Delavallée 50cf6d4008 [CLEAN] Query: cleaned a bit the code. All joins now goes through the same method, either implicit or explicit. Will have to be upgraded in future versions, but at least this is a bit centralized. Updated ORM accordingly. Updated tests. Added a get_alias_from_query method in expression that find the table and the alias from a 'full alias' statement.
bzr revid: tde@openerp.com-20121207154204-mx036lpj3vdclu77
2012-12-07 16:42:04 +01:00
Thibault Delavallée e36b44e82f [IMP] [WIP] order_by: now using aliases in _generate_order_by, _generate_o2m_order_by, _inherits_join_add, ... added some tests. Next comits will clean a bit the code, because currently it is a bit messy.
bzr revid: tde@openerp.com-20121207115424-x8gkjcqpi8dz96g2
2012-12-07 12:54:24 +01:00
Christophe CHAUVET 3d3534ca39 [IMP] Don't use WITH OIDS when create a table
lp bug: https://launchpad.net/bugs/1087332 fixed

bzr revid: christophe.chauvet@syleam.fr-20121206163711-5jvrhrg8w5le4zay
2012-12-06 17:37:11 +01:00
Thibault Delavallée 02c200844c [CLEAN] Removed some forgotten print statements.
bzr revid: tde@openerp.com-20121205153535-lfs6yrokyk0wfm0w
2012-12-05 16:35:35 +01:00
Thibault Delavallée 1652bb1e83 [MERGE] Sync with trunk.
bzr revid: tde@openerp.com-20121205092215-g6a8fpxtd1fq3nwn
2012-12-05 10:22:15 +01:00
Vo Minh Thu 93ae934963 [ADD] added comment in _validate() explaining why the context is not passed around when calling _constraints functions.
bzr revid: vmt@openerp.com-20121205082840-2ww34gbs7nl56952
2012-12-05 09:28:40 +01:00
Thibault Delavallée 9e6c2805ab [REF] [IMP] expression.parse: refactored the main parsing loop, now using source and result stacks. Leaf elements are encapsulated into a specific object, allowing to delegate the join condition formation and aliases generation, as well as working_table management to them. The main parsing loop is now a loop taking a leaf, doing one action on it, and putting the result back to be analyzed or in the results. This allows to avoid having while loops inside a main while loop with some weird corner effects.
bzr revid: tde@openerp.com-20121204142650-gkhmjdeu5upi25kp
2012-12-04 15:26:50 +01:00
Olivier Dony b624267457 [FIX] translate,orm: remember local Model [_sql]_constraints, and keep only those when exporting translations
Previously all _*constraints leaked upstream and
downstream, and were duplicated in all the exported
terms for all modules inheriting from a given model.

bzr revid: odo@openerp.com-20121204082947-tdpiu71ryxzuredb
2012-12-04 09:29:47 +01:00
Thibault Delavallée 638fc20618 [MERGE] Sync with trunk.
bzr revid: tde@openerp.com-20121130093658-uvm0gbo90su88psh
bzr revid: tde@openerp.com-20121203131657-4gcp4wreylnmw2or
bzr revid: tde@openerp.com-20121204082427-7zdzn6f21xzvxby9
2012-12-04 09:24:27 +01:00
Thibault Delavallée 8163c0027b [IMP] [TEST] orm: updated order_by generation by adding the root table name to the order by condition generated based on self._order. Added a mockup of where_calc in test_expression, to be able to track generated Query objects. Added a first test on a one2many query, to track current behavior.
bzr revid: tde@openerp.com-20121127160627-qs1tupvgr8ypexoo
2012-11-27 17:06:27 +01:00
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
Paulius Sladkevičius d9c7febf49 Fixed sorting for m2o
bzr revid: paulius@hacbee.com-20121024100321-tqjm4pyk9y392qur
2012-10-24 13:03:21 +03:00
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