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.
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.
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
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.
* 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.
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.
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.
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.
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
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
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
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)
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
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
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.
The name_get of res.partner.bank uses the format_layout to generate the name
of the bank. As every field is not required, we may get 'False' in the name.
Replace these missing values by an empty string.
Fixes#3590
Without this fix, if you have a new view in a module with active=False, the active tag will be ignore when upgrading the module because of 'update' mode, and the view will be activated by default !
This is safer to avoid inadvertently dropping customizations,
and does not impact the normal update/uninstall process, which
is based on the dependency order.
* use static imports in java examples to make them terser
* inline ``domain`` in java and php example to make examples more
self-contained
* try to extend/improve Model.write's docstring
* add convenience kwarg to fields_get, mostly for user-driven
introspection
Closes#3689
commit f76d4525a was not actually working: extra keys from
config files are not yet into the config options dict at
import time. The fix is to move the logic inside the method,
like in `find_pg_tool` just below.
Also fix the use of `find_in_path` in report.py: the subprocess
may also raise AttributeError exception, so instead of listing
all the possible ones just re-raise the IOError shallowed by
`find_in_path` when the result is None.
Fixes#3809#3811
The openerp-server.conf now generates the bin_path record, in order
to resolve calls to external binaries served in the thirdparty dir.
Adpated report.py to use find_in_path and not directly which.
Changing the decimal precision of float fields is a rare
operation, while cache clearing occurs fairly frequently.
Signaling a full registry change when the decimal precision
is changed (instead of a mere cache change) is therefore
a better trade-off, and more semantically correct as well.
This way we avoid the decimal precision refresh for each
invalidation.
Registry invalidation implies cache invalidation.
When an onchange returns a change in a 2many field line (a '1' tuple, update), avoid to return all fields of the *2many field but only the altered field.
Otherwise, the web client regard all the fields of the 2many as dirty, and try to write on all fields (even if the value is the same, thus)
opw-615062
There was an issue in _setup_fields(): the method invokes _inherits_reload(),
which recomputes inherited fields, and invokes itself recursively on children
models. This may be problematic if the children models have already been set
up.
This optimization avoids recursive calls of method _inherits_reload(). In
_setup_fields(), first all parent models are set up, then their fields are
inspected to determine inherited fields, and their setup is done. This scheme
guarantees that inherited fields are computed once per model.