Commit Graph
786 Commits
Author SHA1 Message Date
Cédric Krier 5c2782626b Use freezed context in order function
The hash method can no hash tuple containing unhashable element like a list.

issue8265
review265341002
2019-04-25 15:24:01 +02:00
Cédric Krier 5b355f37d0 Check access on target only if related field has a target
The Dict field can use the relate syntax to access keys but it does not have
any target model to check.

issue8298
review251291002
2019-04-24 23:46:59 +02:00
Cédric Krier 12376f30e5 Order by target name and context hash
None can not be compared to a class so we always use strings to order before
grouping. Also dictionary can not be compared neither.

issue8265
review253351002
2019-04-24 23:40:46 +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 0fbf5cecd2 Add cache management on RPC
issue8233
review257231002
2019-04-08 10:10:40 +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 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 34316ae615 Check read access on field in search order
issue8189
review279061002
2019-04-02 19:01:33 +02:00
Cédric Krier 792ebac88b Use locale format for data export and import
issue8196
review255151002
2019-03-28 19:22:49 +01: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 44011b1435 Take the field type from the right definition
The field type should be taken from the current fields definition and not from
the class.

issue8212
review273131002
2019-03-22 18:25:52 +01:00
Cédric Krier 9e10625111 Set the requested view_id in result of fields_view_get
The client uses the id of the view received by fields_view_get to construct
the URL so it must be the one requested to ensure to have the same view.

issue7988
review275081002
2019-03-22 18:18:36 +01:00
Cédric Krier 6d16b629f2 Add CSV exports to print toolbar
issue8130
review54571002
2019-03-22 17:21:21 +01:00
Cédric Krier 2752490423 Improve note button
* Add resources method to ModelStorage
* Support badge on icon
* Display unread and total of notes
* Add two extra colors for icon

issue8122
review70561002
2019-03-22 12:16:36 +01:00
Cédric Krier 07d79c7861 Validate selection format in Dict schema
issue7947
review257131002
2019-03-22 11:46:52 +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 10e31bc311 Add Model.__names__ to retrieve model and field names
issue8159
review72431002
2019-03-15 12:27:44 +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 c255cfe785 Display ids and rule names on access error
issue8093
review60551002
2019-03-03 23:11:17 +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 b315e9a6d9 Do not update db_id when deleting XML record without noupdate
If the record has been removed from the XML file, the db_id field will be
required. So we must not update it and let convert delete the data in
post_import.

issue8051
review70521002
2019-02-03 20:33:01 +01:00
Cédric Krier b34cac78d5 Allow to lock records for update
issue8012
review45901002
2019-01-30 09:45:59 +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 9eb1c2eaaa Compute depends on-demand instead of for all callable
issue7939
review64521002
2019-01-18 00:24:28 +01:00
Cédric Krier c39858aac7 Allow to delete record from XML with noupdate
We set the db_id to None to avoid to link later to a different record.

issue7668
review50671002
2019-01-07 22:08:52 +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 83bf159aef Check foreign key in last on database integrity error
The search is done on a new transaction so it can not find targets that were
created during the main transaction.
2018-12-29 23:28:40 +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 b387adc7bc Add check on ModelSQL for positive id
issue7867
review50631002
2018-12-22 00:01:41 +01:00
Cédric Krier d1bb790cb8 New API to read related fields
issue7888
review58431002
2018-12-21 23:41:56 +01:00
Cédric Krier e4e7ae740d Disable sortable and searchable on ModelView only
Those feature depends on the Model having a search method.

issue7878
review56491002
2018-12-17 23:03:19 +01:00
Sergi Almacellas Abellana fc5f906ce5 Do not initiate sql table when table_query is defined
issue7896
review64491002
2018-12-03 11:29:43 +01:00
Cédric Krier c7f5c54a83 Remove implicit fields names in ModelStorage.read
It is a bad practice to not explicit the fields to read. So we should not
support it.

issue7830
review54421002
2018-11-28 10:05:01 +01:00
Cédric Krier 1a3ee131fe Check read access on field in search domain
issue7766
review50591002
2018-11-12 17:18:06 +01:00
Cédric Krier e115ef92d3 Remove check access to trigger_write_get_eligibles
The triggers returned need to be read without any check access.

issue7764
review68321002
2018-10-15 22:49:51 +02:00
Cédric Krier 81375e0d45 Use callable instead of instance of collections.Callable
issue7666
review50571002
2018-09-11 00:19:52 +02:00
Cédric Krier a6a7325f46 Remove deprecation warning
- remove invalid escape sequence
- use  read_file instead of read_fp
- use importlib instead of imp and __import__
- use callable instead of instance of collections.Callable
- fix silent file closing
- replace SafeConfigParser by ConfigParser
- replace decodestring by decodebytes
- replace encodestring by encodebytes

issue7666
issue7390
review53361004
2018-09-01 17:06:28 +02: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
Cédric Krier c3d2be19f5 Add support of timestamp field on client
issue6463
review50521002
2018-08-01 11:37:09 +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
Cédric Krier ae06a8bca2 Add transactional queue and workers
issue7406
review45461002
2018-07-27 09:32:28 +02:00
Cédric Krier 7a2ce7905a Add __table_handler__ to ModelSQL
issue7581
review48531002
2018-07-24 22:01:08 +02:00
Sergi Almacellas Abellana 119af696a1 Recursively remove dependant fields when no access
issue7501
review46551002
2018-07-11 16:22:37 +02:00