Cédric Krier
8824c5a11b
Add context field to on_change calls
...
Those fields are required to instantiate the fields with the proper context.
issue9236
review293501002
2020-04-19 16:36:15 +02:00
Cédric Krier
a48382124f
Support explicit delete and remove for saving and on_change xxx2Many
...
issue4140
review291281002
2020-04-12 23:18:15 +02:00
Cédric Krier
b12d729c2d
Add test on target of relation fields
...
issue9132
review291211004
2020-04-02 00:01:14 +02:00
Cédric Krier
d7ed5f91f5
Fix flake8 errors and warnings
...
We add the flake8 configuration used so we ensure everyone uses the same.
We remove the usage of __all__ for non public API.
When possible, we rationalize the class name according to its __name__ and module.
issue9082
review297061002
2020-03-01 12:33:54 +01:00
Nicolas Évrard
e2d8b6b295
Add MultiSelection entry to Dict field
...
issue8903
review284571003
2019-12-30 14:26:14 +01:00
Cédric Krier
6b14518eff
Position new record based on order
...
We sent an order to the client for action and xxx2Many so its screen has
always a default order set.
To position a new record on non editable tree, we use the order of the 'id'
column if presents.
issue8880
review276501003
2019-12-28 18:16:28 +01:00
Nicolas Évrard
8fb13634ea
Use direct access to backend classes
...
issue8836
review258421002
2019-12-06 17:33:47 +01:00
Cédric Krier
ec24fc7727
Fill the reverse field in the One2Many setter
...
issue8742
review262301002
2019-11-16 14:34:29 +01:00
Cédric Krier
def268915a
Add MultiSelection field
...
issue7851
review249911002
2019-09-20 11:32:56 +02:00
Cédric Krier
54e2d31843
Ensure to convert to string LazyString of selection
2019-08-25 20:51:31 +02:00
Cédric Krier
589e27cc87
Add lazy_gettext
...
issue8560
review283901002
2019-08-25 13:00:28 +02:00
Cédric Krier
51c99aaa12
Allow SQL expression as value of fields
...
issue6460
review279431002
2019-06-26 21:56:16 +02:00
Cédric Krier
e39129ee3d
Add sort and translate options to Reference field
...
As Reference field uses the SelectionMixin, they could have the same options.
issue8278
review253331002
2019-04-15 16:11:00 +02:00
Cédric Krier
eb3882e113
Verify keys of fields and buttons states
...
issue8262
review279221003
2019-04-12 13:08:01 +02:00
Cédric Krier
722db3252a
Remove id to on_change calls that are cached
...
issue8234
review275131002
2019-04-08 10:14:39 +02:00
Cédric Krier
3e9784c8d7
Set context on record instantiated in Field.__set__ and read related
...
Field may have a context defined so when it instantiate a relational record,
the field should set this context like when the record is read from the
database in ModelStorage.__getattr__.
And when such field is read as related field, the context should also be set.
issue8225
review287171002
2019-04-04 19:06:09 +02:00
Cédric Krier
bb0242faf8
Raise NotImplementedError when setting Function field without setter
...
issue7985
review265101002
2019-03-27 00:28:58 +01:00
Cédric Krier
e2318257bb
Allow to extend Field string and help
...
Those attributes are stored as StringPartitioned and each part creates its own
translation record. The translated strings are constructed by concatenation of
each translated part.
issue8040
review46731002
2019-03-15 13:01:11 +01:00
Cédric Krier
986da58a48
Use model name instead of class to translate field definition
...
The typo was introduced in changeset 1094d993d89c.
2019-03-09 15:23:11 +01:00
Cédric Krier
f6c3fa2d68
Fill add_remove definition only if it is not None
...
issue8037
2019-02-18 17:03:13 +01:00
Cédric Krier
8a9d5297c6
Fill size definition only if it is not None
...
The clients expect to have an integer for the size or no key.
issue8037
2019-02-13 13:57:33 +01:00
Cédric Krier
9ea41ef4c8
Wrong class in super call
...
Introduced in changeset 5075df5e9872
issue8084
2019-02-13 12:30:05 +01:00
Cédric Krier
67cdf02720
Fill relation_field definition only with real field name
...
proteus expects the definition to have a field name for relation_field key or
no key at all. So parent_name is always a string.
issue8037
2019-02-13 11:38:16 +01:00
Cédric Krier
98bb26a386
Move field definition from Model to Field
...
issue8037
review74441002
2019-02-13 10:37:40 +01:00
Cédric Krier
951dbdfa82
Make DateTime field inherit from Timestamp field
...
The DateTime is a particular case of Timestamp.
This allows to share the sql_cast of DateTime with Timestamp.
issue8084
review64561002
2019-02-13 10:17:27 +01:00
Cédric Krier
889b1cc9f8
Allow to search and order on Dict key value
...
issue7905
review62391002
2019-01-18 11:32:47 +01:00
Cédric Krier
93e3c0f9df
Order selection field with instance method on column
...
issue7934
review66491002
2018-12-30 00:14:27 +01:00
Cédric Krier
1738a4ec35
Add ir.message and use custom exceptions
...
issue3672
review35291002
2018-12-29 14:19:08 +01:00
Cédric Krier
c3d2be19f5
Add support of timestamp field on client
...
issue6463
review50521002
2018-08-01 11:37:09 +02:00
Cédric Krier
d2a461390a
Remove support for Python 2.7
...
issue7497
review53261002
2018-06-26 19:11:19 +02:00
Cédric Krier
23ab0cdb13
Ensure second domain argument is a string before testing against OPERATORS
...
If the second argument is a PYSON expression, the Python 'in' test calls
__eq__ on it which return a PYSON Equal object between the expression and the
operator. If the PYSON expression does not have the string type, an
incompatibility exception is raised.
So this operation must be prevented if the argument is not a string.
issue7491
review45251003
2018-06-11 23:10:27 +02:00
Cédric Krier
4ed54e9bbc
Support child_of/parent_of with None in the value list
...
This was a implicit behaviour before the changeset 6fefd00369c1.
As a lot of code rely on this behaviour, we make it explicit by adding a test
case.
issue7405
review36251002
2018-05-03 11:57:10 +02:00
Cédric Krier
4c1fe028c1
Use recursive common table expression for child_of/parent_of operators
...
issue7116
review46331002
2018-04-30 16:03:34 +02:00
Cédric Krier
00e4a51a41
Add sql_cast on Field
...
issue7266
review37141002
2018-04-30 14:59:01 +02:00
Cédric Krier
710c0ab2e9
Rename with_inactive_records decorator
...
issue7026
2018-04-03 14:55:01 +02:00
Cédric Krier
8c61a67c2b
Remove active test in search_domain of Many2One and Reference
...
As the target is stored on the record, the target is always visible so
searching on it should not add active clause.
issue7026
review41231002
2018-04-03 13:20:37 +02:00
Nicolas Évrard
ff5b79819b
Add support for search_* attributes on relational fields
...
issue6081
review25871002
2018-03-21 17:59:55 +01:00
Nicolas Évrard
acdbe5a08f
Allow to perform unaccented searches on Char fields
...
issue7115
review44611002
2018-03-16 18:17:53 +01:00
Cédric Krier
478c4e6928
Refactor fields tests
...
issue7085
review40051002
2018-02-02 00:04:19 +01:00
Cédric Krier
2d2ec90141
Use field name to call searcher or domain of Function field
...
The name from the domain may be nested.
issue7015
review44511002
2017-12-26 17:26:00 +01:00
Cédric Krier
8cfd0eb692
Use JSON canonical form for Dict value
...
It allows to make equality comparison.
issue7013
review39041002
2017-12-20 19:26:44 +01:00
Cédric Krier
af498348a7
Allow to search and order translated fields using the derivative translations
...
Since rev 049635454a98, translations are derivatives so the search and order
must be done using all the parent languages.
issue6934
review39971002
2017-12-18 17:45:37 +01:00
Cédric Krier
87bbc9ee1a
Apply filter when searching on xxx2many with one
...
The changeset b16a085824ce, which implements the filter, did not update the
search_domain of the fields to also apply the filter on the searched result.
issue6871
review36721003
2017-10-24 22:19:40 +02:00
Cédric Krier
83656053c8
Order operation on relational field to avoid constraints
...
The order on which the operations are applied can trigger constraints.
So it is safer to first delete then write and finally create.
issue6790
review43511002
2017-09-28 23:44:48 +02:00
Cédric Krier
9eafd65d2e
Add translated descriptor for Reference field
...
issue5667
review39671002
2017-09-26 01:25:26 +02:00
Sergi Almacellas Abellana
b637c503e7
Only convert dict fields when they are strings
...
issue6382
review28101002
2017-06-09 13:22:42 +02:00
Cédric Krier
8479768619
Ensure Many2One target join is unique if Target has history
...
The joins added in tables must ensure to make a Cartesian product.
So when joining on a history table, the target id is not unique so the latest
must be used only for the join. Otherwise a search query may return multiple
times the same id.
issue6458
review37341002
2017-04-26 19:33:32 +02:00
Sergi Almacellas Abellana
7cc9585630
Ensure all _parent_ values are set on fields.depends
...
If the client does not sent all the values of the parent model fields, we must
ensure that the empty ones have None value
issue6450
review40271002
2017-04-26 13:56:30 +02:00
Cédric Krier
a178546d0d
Use _field for sql_format of Function field
...
It is useful to allow to use sql_format on Function field when writing SQL
query that emulate the field.
issue6410
review34051002
2017-04-01 19:55:35 +02:00
Cédric Krier
a908e8cc74
Add MultiValueMixin and ValueMixin and remove Propery
...
issue2349
review23351002
2017-04-01 00:24:55 +02:00