Commit Graph

36 Commits

Author SHA1 Message Date
Raphael Collet 9aad3d873b [IMP] fields: turn field.digits and column.digits into dynamic properties
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.
2015-03-23 14:36:15 +01:00
Olivier Dony c87b9c6539 [FIX] decimal_precision: avoid refreshing float precisions at each cache invalidation
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.
2014-11-19 12:53:58 +01:00
Raphael Collet f2e4a10e1a [IMP] use model._fields instead of model._all_columns to cover all fields
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
2014-11-04 13:47:57 +01:00
Raphael Collet 764c5acd81 [IMP] fields: reset decimal precision on new-style fields
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.
2014-09-18 11:11:19 +02:00
Jaydeep Barot 026e38b48f [REM] Unnecessary `size` parameters on char fields 2014-06-25 17:13:43 +02:00
Christophe Simonis c202dc1c52 merge upstream
bzr revid: chs@openerp.com-20140129190834-xfcat3ulfbg5omhn
2014-01-29 20:08:34 +01:00
Denis Ledoux 5649e0bbf2 [MERGE] Forward-port of latest 7.0 bugfixes, up to rev. 9770 revid:chs@openerp.com-20140116154645-sy4zhdgqc48xaqbx
bzr revid: dle@openerp.com-20131224112612-5gjit5uu1aaaqstx
bzr revid: dle@openerp.com-20140103094532-mbczi9ssr3gc90o1
bzr revid: dle@openerp.com-20140108105833-gblxqdw3if1gt35k
bzr revid: dle@openerp.com-20140115121441-bskbyxxbc09ubavh
bzr revid: dle@openerp.com-20140115165506-yuux9km39gbv7k4n
bzr revid: dle@openerp.com-20140116161415-0y9m0kgavcytzj9z
2014-01-16 17:14:15 +01:00
Christophe Simonis 70e201b07e [FIX] decimal_precision: clearing the cache is suffcient when decimal precision change.
[IMP] decimal_precision: call digits_change() on any field that support it, not only on float and function fields

bzr revid: chs@openerp.com-20140116154645-sy4zhdgqc48xaqbx
2014-01-16 16:46:45 +01:00
Thibault Delavallée 9cf78e93cc [MERGE] Sync with trunk, tries to solve conflicts. There are still some new images to convert into images in xml files.
bzr revid: tde@openerp.com-20140116103910-qmm2y6kucmngplnk
2014-01-16 11:39:10 +01:00
Christophe Simonis 91aaaec0a5 [MERGE] forward port of branch saas-2 up to revid 9092 dle@openerp.com-20140115165506-yuux9km39gbv7k4n
bzr revid: chs@openerp.com-20140115214454-dhl8xzr429co0j5d
2014-01-15 22:44:54 +01:00
Denis Ledoux 74e0fbae83 [MERGE] Forward-port of latest 7.0 bugfixes, up to rev. 9752 revid:dle@openerp.com-20140110173823-lfekux2jxrj5v9gn
bzr revid: dle@openerp.com-20140110160158-ypr2pp63ld6j5g4l
bzr revid: dle@openerp.com-20140110174038-3yogwf6hwk7kpa8w
2014-01-10 18:40:38 +01:00
Christophe Simonis 7dd16a558e [FIX] decimal_precision: signal workers to restart their registry when decimal precision change.
bzr revid: chs@openerp.com-20140110125433-soimmrpz2icvob60
2014-01-10 13:54:33 +01:00
Xavier Morel ff07f6dcdd [ADD] decimal precision support to float t-field rendering
bzr revid: xmo@openerp.com-20131021094533-e510uy6byck85xma
2013-10-21 11:45:33 +02:00
Vo Minh Thu e69326ee3b [REF] removed explicit model instanciations.
bzr revid: vmt@openerp.com-20130415102349-vgcrfok2k5y10cwz
2013-04-15 12:23:49 +02:00
Vo Minh Thu b50a8838b5 [REF] decimal_precision: removed openerp.pooler imports.
bzr revid: vmt@openerp.com-20130327114658-6jtn7e41poi4rv2v
2013-03-27 12:46:58 +01:00
Olivier Dony fc0c2942ba [MERGE] Another batch of bugfixes from 6.1
bzr revid: odo@openerp.com-20121218175547-7c1uxq4ypbi314gx
2012-12-18 18:55:47 +01:00
Olivier Dony 84d7987f33 [MERGE] Bugfixes from 6.1 until revision 6900
rev.6900 = xal@openerp.com-20120720134532-t07xr3lp8ouhn2dv

bzr revid: odo@openerp.com-20121218021123-9ligpn7bkr9zo4n7
2012-12-18 03:11:23 +01:00
Vo Minh Thu e7f4891d46 [IMP] use the openerp namespace.
bzr revid: vmt@openerp.com-20121206145632-0h1coh5aaem65wsy
2012-12-06 15:56:32 +01:00
Stephane Wirtel 1eac0fbe52 [REF] Replace the user id 1 by openerp.SUPERUSER_ID
bzr revid: stw@openerp.com-20120831135136-8k2wjeiixqt6tnkr
2012-08-31 15:51:36 +02:00
Olivier Dony 0373019bcf [FIX] decimal_precision: properly invalidate cache when changing precisions
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
2012-05-23 10:52:34 +02:00
Antony Lesuisse a705894231 [FIX] decimal_precision cache clear
bzr revid: al@openerp.com-20110831181638-cxbcxh951i78ny0a
2011-08-31 20:16:38 +02:00
Vo Minh Thu 73c4deab34 [MERGE] merged fix for decimal_precision where a value of 0 would result in a value of 2.
bzr revid: vmt@openerp.com-20110427100703-rnusqfd7ni0enauo
2011-04-27 12:07:03 +02:00
Naresh (OpenERP) ca3c3fdbc9 [FIX]:decimal_precision when precision is specified as 0
lp bug: https://launchpad.net/bugs/762960 fixed

bzr revid: nch@tinyerp.com-20110426124915-u1qykxakf9oyc35b
2011-04-26 18:19:15 +05:30
jam-openerp fa7fe67cf5 [MERGE]with lp:~openerp-dev/openobject-addons/trunk-dev-addons1
bzr revid: jam@tinyerp.com-20110113093802-5cslc7iybojxfi7g
2011-01-13 15:08:02 +05:30
Mustufa Rangwala 01c028d9f8 [REF] decimal_precision: Clean code and missing expandtab link on py file
bzr revid: mra@mra-laptop-20101029111328-1f1lho4ibiyepnjg
2010-10-29 16:43:28 +05:30
sbh (Open ERP) 71d15a2b94 [MERGE]: merge with lp:openobject-addons
bzr revid: sbh@tinyerp.com-20101004052515-lz0t7uccgmetsc5h
2010-10-04 10:55:15 +05:30
olt@tinyerp.com 0694b1415f [FIX] decimal_precision:
* 'fucntion' fields also need to be updated
 * clear_cache should be called before 'col.digits_change'

bzr revid: olt@tinyerp.com-20101001081911-ne67wl3mjq3ki3dx
2010-10-01 10:19:11 +02:00
Olivier Dony edd52b6a0a [IMP] decimal_precision: add explicit index(select) on precision name
(even though there was already one due to the unique constraint)

bzr revid: odo@openerp.com-20100928111947-2ssoruldvg7vx4gu
2010-09-28 13:19:47 +02:00
sbh (Open ERP) cf4ea3b57a [MERGE] Merge with lp:openobject-addons
bzr revid: sbh@tinyerp.com-20100923061103-8fm2ek7u9nug3wph
2010-09-23 11:41:03 +05:30
Olivier Dony 65dd1ccf79 [IMP] decimal_precision: better constraint error message
bzr revid: odo@openerp.com-20100922165247-zmowte1j492lwfeg
2010-09-22 18:52:47 +02:00
olt@tinyerp.com 2a3ee6ed48 [FIX] decimal_precision: clear cache after calling parent write
bzr revid: olt@tinyerp.com-20100922083835-kjhopzhopkp7fyau
2010-09-22 10:38:35 +02:00
olt@tinyerp.com ed42755ea7 [FIX] decimal_precision: change_digit does not return the same data type as precision_get
bzr revid: olt@tinyerp.com-20100921132639-aacj51e3oneax3yb
2010-09-21 15:26:39 +02:00
olt@tinyerp.com 5c2153597f [FIX] the line was inadvertently removed
bzr revid: olt@tinyerp.com-20100921130649-fo2e12jnsm5m8052
2010-09-21 15:06:49 +02:00
olt@tinyerp.com ac25124ddd [IMP] decimal_precision: performance improvement:
* 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
2010-09-21 14:44:35 +02:00
Fabien Pinckaers 1091830208 [IMP] configurable digits in floats per application
bzr revid: fp@tinyerp.com-20100306205219-pg1r78deq76t2jg2
2010-03-06 21:52:19 +01:00
Fabien Pinckaers 03ac209049 [IMP] Decimal Precision module to change the number of digits in real time on floats
bzr revid: fp@tinyerp.com-20100306195500-s1t8a7w7gcsch42w
2010-03-06 20:55:00 +01:00