Commit Graph

7489 Commits

Author SHA1 Message Date
Raphael Collet d9fedfebbd [IMP] registry loading: setup models only if necessary
When loading the registry without any module installation/upgrade, models are
set up once instead of twice.  In other cases, models are always set up before
installations/upgrades.
2014-12-19 13:57:08 +01:00
Raphael Collet 8f38a7806a [IMP] enable loading custom models/fields and views from module data files
Loading views for custom models from module data files was not possible because
custom models and fields were introduced into the registry after all modules
were loaded.  As a consequence, the view architecture did not pass the checks.

This patch takes a different approach: custom models and fields are loaded
early on in the registry, so that views can be validated.  The trick is to take
special care of relational custom fields: we skip them if their comodel does
not appear in the registry.  This allows to install and upgrade modules that
create/modify custom models, fields and views for them.
2014-12-19 13:57:08 +01:00
Olivier Dony 05707f5cb5 [FIX] server: worker exit log should mention registry count to help admins size deployment settings 2014-12-16 17:36:58 +01:00
Martin Trigaux d6b26c6890 [FIX] base: almost-duplicated translations ignored during import
Translations are not transfered from temporary table tmp_ir_translation_import
to ir_translation if translation already exists (using `find_expr`).
In case of import of QWeb terms (name = 'website'), the criteria was too weak,
finding already present terms in translations for different modules.
e.g. term "Quantity" is already present in a QWeb view from sale module and was
not imported for the translations of the website_sale module.
Fixed by adding the filter criteria 'irt.module = ti.module'

In case QWeb translations for the same term in the same modules were added in
two imports (second term added in the future), the second was still ignored.
Changed condition to check the res_id for views as well.

Fixes #4239
2014-12-16 14:34:43 +01:00
Georges Racinet 9dad29caaf Reintroduce fname kwarg in configmanager
In [f04f409], the configmanager's __init__ lost its fname kwarg, which
allows to pass the name of the config file to read (or write).
Without it the only way to programmatically specify this file name is to
use the OPENERP_SERVER environment variable, which may be unpractical and/or
subject to renaming.

External tools (such as the buildout recipe) may need to pass this file in a
clean way.
2014-12-16 12:54:16 +01:00
Xavier Morel f04f409943 [ADD] doc: setup documentation
* Odoo installation from packages or source
* Deployment instructions for production environments
* dbfilter

Add missing support for disabling xmlrpc(/http), useful for WSGI
deployments which require running cron-only Odoo instances.
2014-12-15 16:01:37 +01:00
Raphael Collet 7afbb0a7ed [IMP] module/loading: do not try to load module graph when nothing to load
This simple optimization in load_marked_modules() avoids unnecessary calls to
load_module_graph().  This provides a small speedup, and avoids confusing log:
some module updates were making it look like the registry was loaded 5 times
instead of once.
2014-12-15 14:51:18 +01:00
Christophe Simonis 44e401c983 [IMP] http.py: allow @route decorator to pass extra arguments to created werkzeug.routing.Rule 2014-12-12 19:34:31 +01:00
Denis Ledoux 8ef286a12c [MERGE] forward port of branch saas-3 up to 162eb84 2014-12-12 15:46:54 +01:00
Denis Ledoux 162eb84438 [MERGE] forward port of branch 7.0 up to f46fa1d 2014-12-12 15:44:44 +01:00
Christophe Simonis 0b6078dfea [IMP] base: apps integration 2014-12-12 15:11:08 +01:00
David Monjoie fd92f16801 [FIX] http: use default language when lang not in context 2014-12-12 15:11:08 +01:00
senthilnathang ccd2f68af0 [FIX] base: Malaysian currency
Default Currency for Malaysia is MYR (Malaysian ringgit), not MXN (Mexican peso)
Fixes #4193
2014-12-12 12:22:23 +01:00
Kit Sunde 1263278b74 [FIX] models: typos
closes #4169
closes #4170
2014-12-11 12:43:47 +01:00
Raphael Collet 058eaf01df [FIX] fields: make sure fields are set up before using them
Non-setup fields could cause problems in two places:
- when traversing the chain of fields in related fields;
- when adding recomputation triggers on inverse fields

Both issues are fixed by this patch.
2014-12-11 10:12:46 +01:00
Kit Sunde 107ba240de [FIX] models: docstring typo.
closes #4163
2014-12-11 09:34:03 +01:00
Jairo Llopis db98d0771a [FIX] base: address layout css
The double % was not understood by some browsers (e.g. Firefox).
No need for escaping in this block.
Fixes #4142
2014-12-10 17:23:20 +01:00
Christophe Simonis 5d60c1c887 [IMP] base: show "mode" in ir.ui.view form view 2014-12-09 19:49:50 +01:00
Christophe Simonis a59cf39f06 [IMP] models.py: increase logging level for columns that can't be casted automatically when upgrading a module. 2014-12-09 15:39:12 +01:00
Denis Ledoux 276d0e76b2 [MERGE] forward port of branch 7.0 up to 284ca73 2014-12-08 14:57:21 +01:00
Xavier Morel a2115ef544 [FIX] ensure default addon paths are valid (existing)
User-provided addons paths are checked for existence (and rejected), but
default addons paths are not checked, and blow up when trying to listdir
them (e.g. when http.py tries to load modules).

This is an issue when using Odoo from the distributed tarballs, because
the packaging currently moves all modules to openerp/addons and removes
the root ("main") addons directory.
2014-12-05 19:12:33 +01:00
Samus CTO 55fa50891d [FIX] Use _unknown model for missing models in relation fields
During a migration of database, it is possible that some custom field
("x_", state is 'manual') are relational to model from a module that is
not provided.

Note: this used to work in Odoo 7.0 but crashed in 8.0.

Closes #3877
2014-12-04 20:58:46 +01:00
Sandy Carter aa10972d13 Raise error on read of a browse object with bad id
Check if id is valid by searching record columns when a key error is raised
If the record has the column, the key error is actually an error on a
missing or inaccessible id.

Signed-off-by: Sandy Carter <sandy.carter@savoirfairelinux.com>

Closes #3658
2014-12-04 13:24:26 +01:00
Denis Ledoux 9c7fb721f0 [FIX] translate: allow common english 2 chars terms
Before, all isolated (between xml/html tags) two chars words coming from views were not translated (by choice).
But, for some words, allowing them is useful. For instance, the word 'or' located between two buttons.

opw-616716
2014-12-04 13:13:07 +01:00
Arthur Maniet 35431de125 [FIX] res.currency: correctly compute the number of decimal places for currencies formatting in 'get_format_currencies_js_function'. 2014-12-04 10:51:54 +01:00
Christophe Simonis 2e092ace29 [FIX] must manage() Environment before loading test file 2014-12-03 14:48:54 +01:00
Raphael Collet 894a898e9e [FIX] models: exists() should not consider record with id 0 as existing 2014-12-03 13:59:27 +01:00
Raphael Collet d82aa69ccc [IMP] models: add check for common conversion error in field definitions 2014-12-03 09:55:17 +01:00
Mack ffda023295 [FIX] http.py: no traceback for SessionExpiredException
Rebase and close #3618
2014-12-02 18:34:28 +01:00
Christophe Simonis 640e77eaa3 [FIX] base: deleting a view must not delete linked actions 2014-12-02 17:45:31 +01:00
Raphael Collet 591e329bb0 [FIX] fields: inherited fields get their attribute 'state' from their base field 2014-12-02 14:58:17 +01:00
Raphael Collet be10d1e573 [IMP] translate: small, non-breaking code improvements 2014-12-02 09:40:59 +01:00
Raphael Collet 4854d5562f [IMP] translate: improve management of targets in POT file 2014-12-02 09:40:59 +01:00
Xavier Morel d7fb4d903d [IMP] various tentative improvements to translation code 2014-12-02 09:40:59 +01:00
Xavier Morel 4d4d4f248f [FIX] base: incorrect translation mark 2014-12-02 09:40:59 +01:00
Xavier Morel 8ee2a89731 [FIX] translations: don't skip first line of translations when extracting module names
Used to be the first line was the CSV headers, the slice was left over after
these were removed from the source data. It probably didn't hurt (only issue
would be if the first module — alphabetically — has a single translatable
term), but it's just as clean not to have that.

Also removed now-unused variable (probably leftover of the CSV thing as well)
2014-12-02 09:40:59 +01:00
Xavier Morel 9964aae7a3 [IMP] translations: simplify condition in qweb terms extraction 2014-12-02 09:40:59 +01:00
Xavier Morel 4beba1dc31 [IMP] translations: parse views iteratively instead of recursively
also fix a pair of docstrings
2014-12-02 09:40:58 +01:00
Xavier Morel f164c44ae2 [FIX] base: export PO template files as pot
was already done when exporting to tgz, but not for po
2014-12-02 09:40:58 +01:00
Xavier Morel f32141017b [IMP] base: language export wizard
* move stuff around
* call write() from browse, correctly pass context to browse
* remove useless default to file name
* use contextlib with stringio
2014-12-02 09:40:58 +01:00
Christophe Simonis d37dd37059 [MERGE] forward port of branch saas-3 up to e1e7dc0 2014-12-01 15:42:51 +01:00
Christophe Simonis ec30b21336 [MERGE] forward port of branch 7.0 up to de07c64 2014-11-28 15:16:38 +01:00
Commandant Custo d3b680e7b2 [FIX] ir_ui_view: Missing separator in search view 2014-11-28 15:09:57 +01:00
Goffin Simon ae294f6222 [FIX] base: QWeb monetary field rounding
QWeb monetary widget uses the precision of the currency to know the number of
digits to display on a price. The number of digits is based on log10(rounding).
For currency with rounding different than 10^x (e.g. in Switzerland 0.05
to allow 5 cents coins only), the number of displayed digits should be rounded
up. e.g. log10(0.05) is -1.3, rounded up to 2 digits.

Fixes #3233
2014-11-28 15:00:59 +01:00
Andrius Preimantas de07c642b6 [FIX] base: delete parent partner reset use_parent_address
When deleting a partner with some contacts, if the contacts had selected
the "use parent address" checkbox, the address of the contacts was stucked in
readonly mode (no checkbox to disable it).
Disable use_parent_address for orphan partners.

Fixes #3611 #3613
2014-11-28 12:03:42 +01:00
Denis Ledoux 5ccbfdd5ec [IMP] res: partner form replace widget selection by option no_create 2014-11-28 11:31:36 +01:00
Antony Lesuisse e2cfe6cbd1 [FIX] Customers remove action domain customer=1 use the context default.
Closes #3902
2014-11-28 10:54:09 +01:00
Xavier Morel fd6dde7ca0 [FIX] enable --debug for non-xmlrpc contexts
fixes #3102
2014-11-28 08:35:14 +01:00
Denis Ledoux 1cbf48417e [FIX] translate: lang detection fallback actually falls back
For instance, when a context was passed to a method, but no lang was defined in the context, it did not tried to fallback to other places where we could have find the user language.
2014-11-27 17:18:46 +01:00
Christophe Simonis de27e19794 [FIX] fields.py: in many2one convert_to_cache, value can be int but long as well 2014-11-27 17:06:48 +01:00