The computed value of parameter digits is no longer stored into fields and
columns; instead the value is recomputed everytime it is needed. Note that
performance is not an issue, since the method `get_precision` of model
'decimal.precision' is cached by the orm. This simplifies the management of
digits on fields and saves about 300Kb per registry.
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.
The old-api model._all_columns contains information about model._columns and
inherited columns. This dictionary is missing new-api computed non-stored
fields, and the new field objects provide a more readable api...
This commit contains the following changes:
- adapt several methods of BaseModel to use fields instead of columns and
_all_columns
- copy all semantic-free attributes of related fields from their source
- add attribute 'group_operator' on integer and float fields
- base, base_action_rule, crm, edi, hr, mail, mass_mailing, pad,
payment_acquirer, share, website, website_crm, website_mail: simply use
_fields instead of _all_columns
- base, decimal_precision, website: adapt qweb rendering methods to use fields
instead of columns
When a decimal_precision record is created/modified, the float fields of the
models in the registry must be reset. This was done on old-API columns only.
It is now handled by the new-API fields.
This was working previously because the cache was disabled,
due to bug #988743. Now that the cache is working again,
it needs to be properly invalidated whenever a decimal.precision
record is created or deleted, otherwise all computations
will use an incorrect precision.
bzr revid: odo@openerp.com-20120523085234-2q8z7f1naydnjgsz
* redirected 'get_precision.change_digit'
function to use 'precision_get' method from 'decimal_precision' class
* 'precision_get' method now uses a cache (invalidated in write)
* added an sql constraint: name should be unique
bzr revid: olt@tinyerp.com-20100921124435-5vrd80zpucjaxya4