Commit Graph
145 Commits
Author SHA1 Message Date
Cédric Krier 4d58b3a720 Don't remove from context the format of Binary fields
The getter of the Binary field could be called many times in the same
transaction, so popping out the format from the context create a side effect
that changes the requested format.

issue3774
review19981002
2016-03-05 17:26:27 +01:00
Cédric Krier 22dc3d23bc Remove __setattr__ from Model
This method is there to only skip the id attribute to be set using the field
__set__ but it has a cost as it is called each time an attribute is set.
So we store now the id value in the attribute '_id' which doesn't overload the
field and we adapt field __get__ for this new location.
The __getitem__ is also removed as it is deprecated since 2.6.

issue5296
review17031002
2016-03-04 00:19:18 +01:00
Nicolas Évrard 2fef479575 Follow PEP-0249 for Transaction and backends
issue4949
review19781002
2016-03-03 21:51:57 +01:00
Nicolas Évrard 9aa648513e re-add the use of the case removed in changeset 0c62b08fa917
Removing the case resulted in the evaluation of expression that were not valid
like the cast of a string into an integer.

issue5335
review16011002
2016-02-19 12:43:12 +01:00
Cédric Krier 29129855ec Add support for Python 3
issue3211
review7311002
2016-02-07 16:46:16 +01:00
Nicolas Évrard d4e3b605ef Add 'where' operator to xxx2many
issue4507
review12951002
2016-01-21 10:48:32 +01:00
Cédric Krier a61474274a Add parent_of operator
issue5037
review15711002
2015-11-05 23:22:26 +01:00
Cédric Krier b5479332d9 Use instance context in translated descriptor of Selection field
It is more expected from the translated descriptor to return translation in the
language from the instance instead of the current context.

issue5028
review15701002
2015-11-03 12:20:49 +01:00
Cédric Krier f01f0d5871 Fix child_of domain on empty MPTT
When the MPTT search returns no row, the SQL query generated has an invalid
syntax because it uses an empty Or() clause. We replace this empty Or() by a
Literal(False) to select nothing.

issue5011
review18651002
2015-10-03 11:50:56 +02:00
Cédric Krier fe52324943 Improve SQL expression for child_of on Many2One with MPTT
issue4984
review22441002
2015-09-24 15:48:45 +02:00
Cédric Krier c18ec6ba74 Add support for float and integer on Property fields
issue4942
review18531002
2015-09-14 10:37:38 +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 390aebef15 Simplify the SQL query for domain on property
- Remove useless CASE test
- Simplify double negation

issue4835
review21271002
2015-07-09 15:38:44 +02:00
Cédric Krier 808580e2ea Improve domain queries of xxx2Many
Avoid using double select of ids and origin.

issue4821
review15521002
2015-07-09 15:37:03 +02:00
Cédric Krier a739a80228 Fix Rule.domain_get usage in many2one
Since changeset a96d8a738cee, Rule.domain_get returns a domain instead of SQL
expression.
2015-06-15 02:19:49 +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
Cédric Krier 375cde4422 Remove unecessary join in Many2Many getter
The target Many2One can be directly used now.

issue4799
review15471002
2015-06-15 01:09:18 +02:00
Cédric Krier a913a10d0f Add only fields define in context for read
instead of all the depend fields.

issue4401
review8111002
2015-04-11 13:35:28 -04:00
Cédric Krier 611b96c5f0 Add is_instance_method tool compatible with Python3
issue3211
2015-03-18 23:34:55 +01:00
Cédric Krier 31e8634bf4 Fix bytes and bytearray usage
- sqlite can not convert bytearray, must use buffer
- binary value could be stored as unicode
- don't dump bytes as base64 in xmlrpclib if bytes is str
2015-03-16 20:13:03 +01:00
Cédric Krier 5cfde31ed2 Use bytes and bytearray for Binary
issue4637
review11091002
2015-03-16 19:28:34 +01:00
Cédric Krier d7db35c995 Fix selection_change_with
Initialize selection_change_with with en empty set. It must be a set to allow
later fields.depends to update it. The ModelAccess.check_relation must also
manage instance method.

issue4636
review14091002
2015-03-15 16:26:10 +01:00
Cédric Krier 0235d02ae7 Fix TimeDelta for MySQL
MySQL doesn't have a INTERVAL type so it must fallback to storing the total
seconds as DOUBLE.

issue4026
review8951002
2015-02-19 13:45:57 +01:00
Cédric Krier 0991a552de Add TimeDelta field
And remove float_time widget.

issue4026
review5911002
2015-02-09 22:58:56 +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
Sergi Almacellas Abellana dc3ee92a88 Fix One2One to create all the relations when called with multiple records
issue4353
review12711002
2014-12-05 18:32:00 +01:00
Cédric Krier c144f8c349 Fix most flake8 errors
review8771002
2014-12-02 12:54:01 +01:00
Cédric Krier b379e32745 Add translated descriptor for Dict field
issue4343
review11641002
2014-11-27 22:20:43 +01:00
Cédric Krier ea112cb6be Function fields should return proper sql_type
issue4302
review12701002
2014-11-27 22:16:34 +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 9108f66d81 Ensure xxx2Many field are always tuple to be immutable
issue4327
review8701002
2014-11-19 21:37:22 +01:00
Sergi Almacellas Abellana 53e943f5cb One2One field should return None when field has no value
review12691002
issue4335
2014-11-17 12:57:54 +01: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
Cédric Krier 16aa948e3d Add support for domain_<field name> method
issue4126
review6501002
2014-09-13 15:14:56 +02:00
Cédric Krier e0b995abbe Refactore configuration to allow easy extention
issue3627
review7401002
2014-09-03 23:32:01 +02:00
Cédric Krier 6765a12e5a Add add_remove alias on Many2Many for compatibility with One2Many
issue4112
review5511002
2014-09-01 12:53:32 +02:00
Cédric Krier cd2ac5c1b1 Add translated descriptor for Selection field
issue3679
review10401002
2014-08-04 16:50:59 +02:00
Cédric Krier 2b5e337553 Missing loading attribute in Function.__copy__
and remove useless deepcopy of string attributes.

review11391002
2014-08-01 10:20:32 +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 38360583d2 Fix SQLite Numeric domain value for None
issue3930
review11281002
2014-06-13 19:11:44 +02:00
Cédric Krier 8155f13880 Set also _parent_ field in fields.depends
issue3978
review8441002
2014-06-09 18:07:44 +02:00
Cédric Krier 814b1d2ea5 Ensure ids clause is a list for concatenation
issue3949
review11281006
2014-06-08 00:18:55 +02:00
Nicolas Évrard d83fc99f35 Allow to register different type for json/xmlrpc encoding/decoding
issue3839
review5021003
2014-06-06 12:57:27 +02:00
Cédric Krier 360d1232fa Fix joins when ordering on ir.model.field
issue3910
review10311002
2014-05-17 18:41:20 +02:00
Cédric Krier 169b41e0b3 Allow to set a tuple model, dictionary for Reference field
issue3902
review9321002
2014-05-10 20:28:58 +02:00
Cédric Krier c08724f2ef Don't stop setting Many2Many if first values is empty 2014-04-11 15:41:55 +02:00
Cédric Krier 6d1be2574b Allow to customize field column and fix numeric search for SQLite
issue3733
issue3648
review4421002
2014-03-18 19:59:04 +01:00
Cédric Krier 5082be317a Fix wrong Concat in the translation join for ir.model 2014-03-18 16:24:23 +01:00