Cédric Krier
23c45fc511
Group records when calling set method for field with the same value
...
We need to loop to compare the values instead of using a dictionary because the
values are not necessary hashable. But it is still an improvement compared to
calling the set method for each record.
issue5398
review19111002
2016-03-19 12:07:27 +01:00
Cédric Krier
1380d60c45
Cache default values in ModelSQL.create
...
default values should be constant during the create transaction so we could
cache the result and avoid query it for each created record.
issue5397
review16121002
2016-03-19 12:04:35 +01:00
Cédric Krier
9dfb717088
Always use __name__ instead of _get_name to raise access_error
...
Other similar exception use __name__
2016-03-16 12:48:15 +01:00
Nicolas Évrard
2fef479575
Follow PEP-0249 for Transaction and backends
...
issue4949
review19781002
2016-03-03 21:51:57 +01:00
Cédric Krier
29129855ec
Add support for Python 3
...
issue3211
review7311002
2016-02-07 16:46:16 +01:00
Cédric Krier
81f1e8b6db
Fix typo when reading getter fields with datetime_field
...
issue5269
review20671002
2016-02-02 19:03:11 +01:00
Sergi Almacellas Abellana
2a723f2e52
Only rebuild mptt tree if needed
...
The tree will be only rebuild if a record with the default value of left or right fields exists.
issue5118
review16921002
2016-01-11 15:33:08 +01:00
Sergi Almacellas Abellana
80b3679dd3
Backed out changeset ac3c495d797f
2015-12-28 15:29:21 +01:00
Sergi Almacellas Abellana
fc58438188
Only rebuild mptt tree one time per model in a database update
...
issue5118
review20501002
2015-12-28 14:13:03 +01:00
Cédric Krier
5c062ebeea
Always rebuild MPTT tree in case of nested creation
...
because _update_tree can not find children with left/right.
issue5095
review24571002
2015-11-02 11:41:04 +01:00
Cédric Krier
e43bda21bc
Wrong parameter passed to __raise_integrity_error
2015-09-21 10:30:25 +02:00
Cédric Krier
0574e90f5b
Remove foreign-key on create_uid and write_uid
...
Instead prevent delete of any user to keep logging information.
issue4925
review24301002
2015-09-04 11:52:53 +02:00
Sergi Almacellas Abellana
9ac3fec4dd
Explicity raise error when creating/writing/deleting models with table_query
...
issue4822
review16351002
2015-07-29 10:56:30 +02:00
Cédric Krier
c6c6c7e268
Fix join target_search for history
...
search_domain must not override the main table with the history instance if
tables is provided by the caller. In such case, it must assume the caller will
pass the right table.
The join search on Many2One must use the history table if the Target is
historized and a _datetime is set in the context.
issue4798
review12251002
2015-07-28 14:54:03 +02:00
Cédric Krier
6cd05ed6fe
Add has_multirow_insert
...
There are still many databases that doesn't support this SQL-92 syntax.
issue4881
review19331002
2015-07-28 08:04:29 +02:00
Cédric Krier
7652df0be4
Allow to override ModelSQL._table
...
issue4774
review15431002
2015-07-16 01:13:45 +02:00
Cédric Krier
ba40cb71d1
Get all eligible records when writting many values
...
The call to trigger_write_get_eligibles must be done with all the records and
not only the first set.
issue4863
review23311002
2015-07-14 00:06:13 +02:00
Cédric Krier
7459aab3d1
Use CURRENT_TIMESTAMP instead of NOW
...
CURRENT_TIMESTAMP is the correct SQL standard way.
issue4837
review15531002
2015-07-01 19:41:49 +02:00
Cédric Krier
1f18f65c33
Ensure first argument of DatabaseIntegrityError is a string
...
issue4836
review8191003
2015-07-01 19:39:25 +02:00
Cédric Krier
e4546c3459
Add missing alias on selected columns
...
This is required by python-sql, if the rownum limit flavor is used, to retrieve
only the selected columns.
issue4838
review12231002
2015-07-01 19:34:48 +02:00
Cédric Krier
44dc331ced
Use Constraint instance in ModelSQL._sql_constraints
...
issue4814
review15491002
2015-06-22 16:57:06 +02:00
Cédric Krier
5478e5463f
Don't use subquery to enforce record rule
...
Rule.domain_get returns now only a domain and Rule.query_get returns the query
which domain_get used to.
issue4800
review8151002
2015-06-15 01:14:47 +02:00
Cédric Krier
0c4725b891
Add target_search option on Many2One
...
The option allow to select between the subquery or the join format for target
search clause.
issue4798
review16341002
2015-06-15 01:10:59 +02:00
Sergi Almacellas Abellana
2e4d1441ea
Prevent validating records multiple times
...
issue4548
review14981002
2015-02-13 18:14:12 +01:00
Marius Grigaitis
8ed1715488
Handle history when number of records exceeds cursor.IN_MAX
...
issue4463
review10031002
2015-01-15 23:45:02 +01:00
Nicolas Évrard
dcf57d8c33
Allow to use the dotted notation for search order parameters
...
issue4370
review5801002
2015-01-02 16:33:00 +01:00
Cédric Krier
67d5291bfd
Use Field.sql_column for SELECT queries in ModelSQL
...
By using sql_column, it increases the possibilities of customisation of fields.
issue4369
review14711002
2014-12-20 19:24:42 +01:00
Cédric Krier
c144f8c349
Fix most flake8 errors
...
review8771002
2014-12-02 12:54:01 +01:00
Cédric Krier
c11b1f44ef
Use 'set' attribute to decide column creation in ModelSQL
...
Since changeset 64681f657d55, Function fields have a sql_type so it is wrong to
rely on this property to create or not a column. The 'set' method of field is
already used in many places for this purpose.
issue4302
review7731002
2014-11-29 10:45:12 +01:00
Robin Baumgartner
8b3557921e
Use Null constant from python-sql for comparisons
...
issue4143
review13701003
2014-11-24 13:57:12 +01:00
Cédric Krier
360f39f89d
Make cache size configurable
...
* Clean private context keyword in RPC
* Add cache section in configuration
issue4320
review10641002
2014-11-19 21:35:51 +01:00
Cédric Krier
4d5f4c6c3d
Add restore_history_before on ModelSQL
...
issue4259
review6601003
2014-10-27 23:10:52 +01:00
Cédric Krier
e82df70a75
Restore historically deleted record as deleted
...
issue4260
review14591002
2014-10-18 09:17:09 +02:00
Cédric Krier
a2c8111f26
Use context to check model and field access
...
* Model and Field access checked only if _check_access is set
* Add check_access to RPC
* Add check_access to Wizard and Report
issue4081
review8481002
2014-09-17 21:43:53 +02:00
Sergi Almacellas Abellana
c2de992751
Avoid updating mptt tree when parent field hasn't been modified
...
issue4095
review6451002
2014-08-06 12:13:29 +02:00
Cédric Krier
ae4224c16b
Remove wrong docstring for table_query
...
The right one is in the documentation.
2014-07-29 11:07:15 +02:00
Sergi Almacellas Abellana
fd7c510ce4
Add grouped_slice helper and use it.
...
issue3516
review10301002
2014-07-17 18:53:05 +02:00
Cédric Krier
b19d919d15
On restore_history select the record with highest __id
...
issue3861
review13391002
2014-07-09 00:26:31 +02:00
Cédric Krier
7218f5d42a
On historied search select the record with highest __id
...
issue3861
review11271002
2014-06-22 16:56:08 +02:00
Cédric Krier
e740b5f432
Remove on_change call from default_get
...
The on_change call doesn't work for xxx2many fields, so it is moved on the
client side where it is properly managed.
issue3923
review6301002
2014-06-08 00:33:31 +02:00
Cédric Krier
67dfdc6a99
Make global cache depends on explicit context keys
...
This should prevent the invalidation of the cache when the context keys that are
changed has no influence onn the global cache.
issue3905
review6291002
2014-05-22 23:36:00 +02:00
Cédric Krier
9dbc025011
Add restore_history to ModelSQL
...
issue3456
review1441003
2014-03-18 20:07:03 +01:00
Cédric Krier
335b0b6851
Add history revisions
...
issue3678
review3551002
2014-03-18 19:54:32 +01:00
Cédric Krier
f72b983c0f
Check relation access in fields_get and for default fields in read
...
issue3750
review4261002
2014-03-15 11:01:14 +01:00
Cédric Krier
88a4bce42d
Ensure to read the last history record
...
history records for the same id could have the exact same timestamp so to always
read the same record, the last one inserted is used by ordering on __id.
issue3741
review4161002
2014-03-10 20:26:56 +01:00
Cédric Krier
2680d1b746
Use a sequence of ids, values to set fields
...
review3331003
2014-02-24 19:15:57 +01:00
Cédric Krier
19f3ab64cb
Fix error message "foreign_model_exist"
...
The value argument has no meaning for this error message and the way it is
retreived in changeset dbbbe6cae2bb is buggy.
review3381002
2014-02-14 00:22:45 +01:00
Nicolas Évrard
96d4de1709
_validate records in bunch of RECORD_CACHE_SIZE
...
This is required in order to prevent invalidating the LRU cache too often
review3061002
2014-02-03 16:30:18 +01:00
Cédric Krier
bc6acd08ee
Drop support of Python 2.6
...
review2691002
2014-01-31 00:02:03 +01:00
Cédric Krier
2e7c28d348
Add with_on_change switch to default_get
...
default_get should not call on_change when called in create because it could
modify values set by the caller.
issue3602
review2781002
2014-01-26 21:57:15 +01:00