Commit Graph
61 Commits
Author SHA1 Message Date
Cédric Krier fc66c17eb0 Call getter function when accessing Function field
If the record is unsaved and the getter is based on on_change_with, we can call
the getter to compute the value.
This value must not be stored in the cache as it may change prior to saving.

issue4193
issue9263
review317291002
2020-05-03 14:34:44 +02:00
Cédric Krier 0081dc431d Allow copying attachments and notes to created records
issue9154
review266971002
2020-04-13 17:25:02 +02:00
Cédric Krier 11e678a8cc Avoid to import backend before loading configuration
otherwise the backend loaded is always SQLite.

issue8749
review276511002
2019-12-02 11:35:47 +01:00
Cédric Krier def268915a Add MultiSelection field
issue7851
review249911002
2019-09-20 11:32:56 +02:00
Cédric Krier 5e68f7c0ab Test _changed_values with rec_name
issue8637
review280081004
2019-09-11 23:50:20 +02:00
Cédric Krier e9ee50982b Allow to update records when importing data
issue652
review273131003
2019-04-04 20:00:25 +02:00
Cédric Krier c0510b0ec2 Refactoring test account and include search
issue7766
review50591002
2018-11-12 17:19:24 +01:00
Cédric Krier d221e36653 Improve ModelStorage.copy
* Allow callable in copy default
* Support dotted notation in copy default
* Use setdefault in copy
* Copy default when needed
* Do not set default state in copy
* Use callable and dotted notation in copy default

issue5576
issue7648
review72291002
2018-09-01 01:02:04 +02:00
Sergi Almacellas Abellana 3158279cb3 Remove button if it is not allowed to access some of its dependant fields
issue7502
review47511002
2018-08-01 10:44:06 +02:00
Sergi Almacellas Abellana 26f775e0b4 Add test for recursive dependant fields without access
issue7501
review46551002
2018-07-11 16:23:11 +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 93526b9cd0 Check rule after indirect fields and modification
The rule may depend on indirect field written latter so it must be checked
after the storage of those fields.
On write, the rule must be checked before the modification but also after to
ensure users do not generate records that they can not modify after.

issue7403
review53301002
2018-06-24 16:54:46 +02:00
Cédric Krier 5ca66d5ccf Add tree mixin
- Implement generic get_rec_name and search_rec_name
- Include recursive check

issue7383
review48281002
2018-05-12 00:45:55 +02:00
Cédric Krier ef74636148 Remove import of removed test.py file 2018-02-02 00:27:41 +01:00
Cédric Krier 478c4e6928 Refactor fields tests
issue7085
review40051002
2018-02-02 00:04:19 +01:00
Cédric Krier e7e4472c03 Allow to include mixin to pool objects
issue4735
review41751002
2018-01-12 15:46:52 +01:00
Cédric Krier 10042b9597 Improve validation of PYSON domain
Use a different strategy if we are close to one domain per record.
It will use combined multiple domain at once instead of doing one query for
almost each record validated.

issue6983
review39021002
2017-12-26 17:28:42 +01:00
Nicolas Évrard ba9cbab0de Allow to add tests in trytond through entry_points
issue6423
review35371002
2017-10-02 11:38:02 +02:00
Nicolas Évrard ddf4e0fe3c Remove empty pages from notebook
issue3295
review40421002
2017-06-09 16:07:03 +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 f7c1de84c4 Support instantiate model with _parent_ of _parent_
This is a valid depends value for a field but the __init__ method lose the
second _parent_ once it has been instantiated a first time.
Setting _parent_ value must be done recursively.

issue6441
review40261002
2017-04-19 10:31:45 +02:00
Cédric Krier a908e8cc74 Add MultiValueMixin and ValueMixin and remove Propery
issue2349
review23351002
2017-04-01 00:24:55 +02:00
Sergi Almacellas Abellana 95e000c9e8 Add filter to xxx2Many fields
issue4005
review32001002
2017-03-30 09:40:41 +02:00
Nicolas Évrard c3f69d1db7 Add NULLS ordering
issue5858
review27651002
2017-03-29 23:12:01 +02:00
Cédric Krier 2569f4dd52 Allow Many2One on ModelSQL to target ModelStorage
issue6237
review26081002
2017-02-11 19:08:52 +01:00
Nicolas Évrard 39c12cf496 Add set_rpc on Field
The __rpc__ attribute is currently filled by method in ModelView. Allowing
fields to define themselves what endpoints should be remotely callable make
this process more flexible.

issue4044
review30991002
2017-02-01 16:11:00 +01:00
Sergi Almacellas Abellana 828afc310d Add sequence_ordered
issue5105
review25561002
2016-09-13 14:01:17 +02:00
Cédric Krier 7ca7f4c6f0 Allow to store Binary field in filestore
Two options are added on Binary field to define the column to use to store the
filestore id and the prefix to use.
Those options are used for Attachment and are configurable with conservative
default values.

issue5692
review25471003
2016-07-29 10:51:53 +02:00
Sergi Almacellas Abellana db3ded5b90 Add test on ModelStorage.save with records with different context
issue5753
review22201002
2016-07-29 10:31:14 +02:00
Cédric Krier 6232dabdf3 Don't check write access on model for button with groups
issue5010
review23181002
2016-06-30 21:51:03 +02:00
Cédric Krier 8d8c489c83 Reset context when reading fields for browsing
The method set_context does not replace the context but just update it.
So we could have leak of the surrounding into the read context.

issue5614
review25161002
2016-06-14 16:00:15 +02:00
Nicolas Évrard 33224eeaa3 Check self.id against None before comparing to 0
issue5590
review25111002
2016-06-03 13:01:39 +02:00
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 a61474274a Add parent_of operator
issue5037
review15711002
2015-11-05 23:22:26 +01: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 870c058eaa Add test for search_read order
issue3228
review11051002
2015-03-05 11:44:11 +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 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 fee97ca399 New API for on_change
Modify the instance instead of returning a dictionary.

issue4203
review8581002
2014-10-29 20:38:17 +01:00
Cédric Krier 349fc51a7f Use the context of the relation field for instanciation
issue4098
review13461002
2014-08-29 16:49:09 +02:00
Cédric Krier 5bc2beaa75 Add test on browsing history
review5451002
2014-07-20 12:47:50 +02:00
Cédric Krier 3f8d858c01 Add UnionMixin
issue3906
review8341002
2014-06-08 00:26:57 +02:00
Cédric Krier a130816cbd Add support of domain for non-relation field
issue3743
review4181002
2014-03-15 10:44:45 +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 0c6ba3a325 Remove back Many2One reference in copy test Many2Many
This reference is useless and create a circular dependency.
2014-03-10 10:17:32 +01:00
Cédric Krier f9188bd280 Fix register order of Models for copy test Many2Many 2014-03-09 18:25:37 +01:00
Cédric Krier fd25cd6434 Add copy test for Many2Many
Thanks to Laurent Defert

issue3506
review3221002
2014-03-07 20:02:07 +01:00
Cédric Krier f0a4bbcff7 Remove Sha field and add password widget
issue3713
review3791003
2014-03-07 19:38:01 +01:00