Commit Graph
5527 Commits
Author SHA1 Message Date
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 246c672073 Remove unique constraint on ir.translation
issue8034
review46721002
2019-02-13 10:27:32 +01:00
Cédric Krier 9eaac0f3a3 Cast timestamp as datetime for sqlite back-end
SQLite backend returns a string for the datetime so the comparison between
timestamp fails.

issue8080
review48721002
2019-02-13 10:23:44 +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 ddf9e44dbe Use number of verbose flag as log level
It decouples the logging level from the development mode.

issue8026
review66521002
2019-02-05 19:27:10 +01:00
Cédric Krier 0d15afb90e Add coroutine concurrency option
issue8010
review53501002
2019-02-05 19:09:53 +01:00
Cédric Krier ac8f1c6186 Update rng with rnc2rng
issue8005
review64551002
2019-02-04 22:46:32 +01:00
Cédric Krier 0b6c923834 Add increasing delay on OperationalError
This increase the success rate of retry if the other transaction last.

issue8014
review50701002
2019-02-04 22:23:12 +01:00
Cédric Krier 88b1272d95 Return 429 TOO MANY REQUESTS on RateLimitException
This is a better HTTP Status than the default 500.

issue8001
review47751002
2019-02-04 22:19:37 +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 14d5f911fb Add Access-Control headers only on Response
The response may be a HTTPException which does not allow to customize the
headers.

issue8047
review49761002
2019-01-30 10:07:38 +01:00
Cédric Krier 4c7441ec74 Store timestamp on Cache per database
The timestamp defines when the cache of a database has been cleared.

issue8018
review50711002
2019-01-30 10:05:55 +01:00
Cédric Krier 774d6eeb5a Do not keeping lock when relaunch listener and join listener in test
We can not recursively call Bus._listen when holding the lock because it
blocks all subscription until the listener stops.
The tearDown of the test should ensure the listener is really stopped before
ending.

issue8039
review52611002
2019-01-30 10:04:11 +01:00
Cédric Krier b906d84d87 Load payload using the JSONDecoder
The payload is dumped using the JSONEncoder so it should be loaded using the
proper decoder.

issue8024
review56551002
2019-01-30 10:02:36 +01:00
Cédric Krier 572372d3c8 Raise NotImplementedError instead of NotImplemented
issue8022
review49731002
2019-01-30 10:00:49 +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 23c81ec015 Avoid to store in transactional cache former translation value
Translated fields are stored in the transactional cache. Using the instance to
get the source value when it is being set, store the former value into the
cache and the source.

issue7997
review58471002
2019-01-30 09:36:21 +01:00
Cédric Krier 62f175d3d1 Set flavor in SQLite database init and test
Those methods use python-sql to make queries but they can be called with a
simple connection and not under a Transaction.
2019-01-28 10:03:47 +01:00
Cédric Krier 1c4067891e Do not start a transaction to init database
An uninitialized database does not have the ir_cache table so Transaction.start fails.

issue8032
review72391002
2019-01-28 09:15:33 +01:00
Nicolas Évrard ab61459443 Check CORS only when Host and Origin header differs
issue8033
review66531002
2019-01-24 11:06:36 +01:00
Cédric Krier 847cbc5733 Add search and read RPC access to ir.calendar*
Those access are needed by the client to display the selection widget related
to those models. They do not have it by default because they do not inherit
from ModelView.

issue7996
2019-01-22 14:15:31 +01:00
Cédric Krier da24071467 Make Cache transactional
We implement sync, commit and rollback to follow transaction semantic.
When a transaction clears a cache, the global cache is cleared only when the
transaction is committed meanwhile the transaction will use a cache for itself
only.
We remove _nocache option because the sync, commit and rollback operate only
for the transaction.

issue7975
review53521002
2019-01-18 11:57:11 +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 cef6ffead0 Allow to redirect bus request
issue7943
review48691003
2019-01-18 11:01:22 +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 0dc396904f Add extras modules to ModuleTestCase
issue7935
review50661002
2019-01-17 17:22:22 +01:00
Cédric Krier 0cc4f0de2a Remove actual stopped self from the transactions stack
Stopping non-current transaction should not remove the last transaction but
the last itself.

issue7973
review45861002
2019-01-17 17:13:26 +01:00
Cédric Krier 342bc9f13d Correctly rename column with SQLite
The table must be recreated if the target column does not exist.
Also temporary column name should use double underscore as module may use
single underscore.

issue7978
review52591002
2019-01-15 11:30:20 +01:00
Cédric Krier 07c296fc27 Add timeout to Report.convert
issue7972
review50691002
2019-01-15 00:09:38 +01:00
Cédric Krier d80f2bdbe4 Use unique name for _get_language Cache
issue7974
review60481002
2019-01-15 00:02:19 +01:00
Cédric Krier 857cd4cc3f Remove unsupported ja_JP translations 2019-01-08 16:46:14 +01:00
Cédric Krier dde7250537 Correctly test required reference with None and negative id 2019-01-08 10:47:38 +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 4679d1c910 Add ir.calendar for month and day
This allows to replace time_locale and use the translation infrastructure
instead. So it can be customized using the translation override or derivative
languages.
This provides also a standard base to modules that needs calendar month and
day.

issue7815
review56451002
2019-01-01 15:47:23 +01:00
Cédric Krier 1faa877295 Remove country code from languages
issue7863
review53481002
2018-12-31 15:36:49 +01:00
Cédric Krier 31dc11cf6d Run tasks at this end of cron execution and with_transaction
issue7781
review68391002
2018-12-30 00:22:41 +01:00
Cédric Krier e5bf50805d Return XML-RPC answer only to XML-RPC request
This prevents to answer an XML-RPC fault to a request which only set xml as
accepted mimetype.

issue7913
review66481002
2018-12-30 00:21:39 +01:00
Cédric Krier 55619becda Remove unused ModelFieldGroup
issue7944
review52571002
2018-12-30 00:19:25 +01:00
Cédric Krier 5cab9c3995 Add test ordering of selection field
issue7934
review66491002
2018-12-30 00:14:59 +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 f430589b56 Add warning in the documentation about static filter
issue7902
review58451002
2018-12-21 23:48:05 +01:00
Cédric Krier d1bb790cb8 New API to read related fields
issue7888
review58431002
2018-12-21 23:41:56 +01:00
Albert Cervera i Areny b2b66251f1 Fix typo: One2MOne.filter should be One2One.filter
issue7901
review52541002
2018-12-18 23:44:54 +01:00
Cédric Krier fcb16273c5 Improve the access right documentation
issue7898
review58441002
2018-12-17 23:23:00 +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