Commit Graph
5181 Commits
Author SHA1 Message Date
Cédric Krier 5b68149ea8 Update translations 2016-05-01 10:59:39 +02:00
Thierry Bruyere 91cd4040fa Database locked at first wizard execution with sqlite backend
Cache.resets create a new transaction but SQLite keeps a lock from the previous
transaction is it was not committed.
This commit was removed by changeset 9b2e0aac2d9c

issue5388
review16211002
2016-04-30 23:26:47 +02:00
Cédric Krier 788f6811d0 Fix Translation set_view when arch is None
issue5486
review25261002
2016-04-18 15:05:06 +07:00
Sergi Almacellas Abellana e60291d8af Fix unreferenced value on pyson errors en view definition
Introduced in changeset6fb7dc7e9006

issue5481
review25051002
2016-04-14 19:53:39 +02:00
Cédric Krier c18b4cbc12 Remove tree_action keyword
tree_action is removed since version 2.0 with the merge of tree and list view.
2016-04-07 00:04:01 +02:00
Cédric Krier 506552af4e Log as error DatabaseOperationalError exceptions 2016-04-06 23:57:58 +02:00
Cédric Krier 66a6f7aad4 Keep colspan attribute when replacing field without access rights
The colspan attribute is important to keep the layout of the view intact.
So we must keep it after clearing all other attributes.

issue5444
review21901002
2016-04-02 15:22:24 +02:00
Cédric Krier 46ff36af7b Use str to test exception instead of unicode in integrity error
issue5446
review19161003
2016-04-01 10:29:51 +02:00
Cédric Krier 2e19c1b949 Use tryton-ok icon for OK button
issue5429
2016-04-01 10:28:34 +02:00
Cédric Krier 98d789a0f0 Install 'tests' module to test sendmail and fix assert called
Having a database created is needed to test on postgresql backend.
2016-03-29 00:59:33 +02:00
Cédric Krier ba1faa1a76 Add sendmail datamanager
issue5431
review17981002
2016-03-28 22:40:37 +02:00
Cédric Krier 576a132a76 Run default and order methods in unittest
issue5432
review24061002
2016-03-28 22:38:29 +02:00
Cédric Krier 3c6957a14f Fix default context value for language
As language will be used in a domain search, its value must be compatible but
False is not, it should be None.
2016-03-27 17:38:30 +02:00
Nicolas Évrard bc1e9a9830 Support Two-Phase Commit protocol in Transaction
issue3553
review23741003
2016-03-25 17:17:41 +01:00
Cédric Krier b679e4d261 Fix extract_report_genshi for old Relatorio version
Fall-back to 'xml' factory because only version greater than 0.6.2 of Relatorio
has the factory 'markup' before it was named 'xml'.
2016-03-25 12:22:07 +01:00
Cédric Krier 9e57ec6627 Improve TableHandler's to update only modified property
It adds keywords argument to _update_definition to limit the update as most of
the time only one kind of property is modified.

issue5416
review22891002
2016-03-25 11:25:43 +01:00
Cédric Krier 15b80c5dd2 Allow Report to generate text plain, XML, HTML and XHTML
It allows plain, XML, HTML and XHTML as template extension.
It changes the translation type 'odt' into the more generic keyword 'report'.
Translation for text based template are extracted using the Genshi tools.

issue5185
review24951002
2016-03-25 11:08:58 +01:00
Cédric Krier 1b33a4b3ed Fix connection leak on postgresql
All connections must be put back to the pool otherwise they will never be
reused and so exhaust the pool limit.

issue5421
review20121002
2016-03-25 10:46:12 +01:00
Cédric Krier 2b3a611057 Raise a better exception when backend doesn't exist
When the backend did not exist and pkg_resources was present, the exception
raise was a ValueError without meaningful information. Indeed it is better to
raise the import exception.

issue5418
review20101002
2016-03-25 10:43:07 +01:00
Cédric Krier 792d623c7b Improve threshold between rebuild and update MPTT
Indeed we should count the number of nodes updated instead of the number of
queries.

rebuild: 1 write and 1 select on each node
update: (1 write + 3 select + 2 write on average ½ all nodes + 1 write on child
of id) on each ids

So the threshold is:

2 * count < (4 + 2 * count / 2 + 1 * x) * len(ids)
2 * count < (4 + count + x) * len(ids)

which can be approximated to

2 * count < count * len(ids)
2 < len(ids)

issue5399
review20861002
2016-03-21 23:43:22 +01:00
Cédric Krier c19f93cd9b NotLogged exception is no more used
issue5415
review17971003
2016-03-21 23:39:30 +01:00
Cédric Krier 33b240736c Re-introduce iteration over keys
It was removed in changeset 808e05f4898c but indeed we need a copy list of the
keys because the dictionary is modified during the iteration.
2016-03-19 15:25:49 +01: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 1380d60c45 Cache default values in ModelSQL.create
default values should be constant during the create transaction so we could
cache the result and avoid query it for each created record.

issue5397
review16121002
2016-03-19 12:04:35 +01:00
Cédric Krier 510931a8ab Use OrderedDict in Workflow.transition for cache alignment
This allows to loop over the key in the same order as the list of records.
Also avoid to use .keys() when iterating on dict because it generate a useless
list on Python2.
Use list on dict instead of .keys() to avoid one extra call on Python3 because
.key() return an iterator.

issue5396
review20061002
2016-03-19 11:59:52 +01:00
Cédric Krier a650e8469f Speed up pool setup
We split the operations into two steps, so we can do the setup calls at the end
if there is no installation or update.

issue5302
review17041002
2016-03-17 22:56:58 +01:00
Cédric Krier 39bcde5357 Use a separate cursor in loop to set translation
cursor_dict returns an iterator that consumes the cursor. This means the cursor
can not be used before the iteration is stopped. So we need to use another
cursor to make the update queries.
2016-03-17 17:14:53 +01:00
Cédric Krier 1e0d860fe3 Use simple connection to list databases
When we instantiate a Database for each database to test, the threaded
connection pool keep one connection opens which could consume all the available
connections even if the databases are not really used.

issue5368
review16091002
2016-03-16 22:12:22 +01:00
Cédric Krier 3d8abb5059 Use SQL query to remove old login attempt
This is more efficient if there are a huge number of old login attempt because
it avoid to fetch the ids and to have loop over them to delete.

issue5377
review24901002
2016-03-16 22:10:37 +01:00
Cédric Krier 6a60572576 Transaction needs to be committed before reseting the Cache
Cache.resets create a new transaction but SQLite keeps a lock from the previous
transaction is it was not committed.
This commit was removed by changeset 9b2e0aac2d9c

issue5388
review16071002
2016-03-16 22:07:46 +01:00
Cédric Krier 1a4687d905 Add test for Sequence number next
issue5329
review17931002
2016-03-16 22:04:18 +01:00
Cédric Krier 6b2f90e0f5 Sequence number next has no value for type different of incremental
issue5329
review17931002
2016-03-16 22:03:41 +01:00
Cédric Krier 4a4a62dbe1 Add missing Database.connect in list with sqlite
The test method requires the database instance to be connected.

issue5407
review24941002
2016-03-16 13:06:37 +01:00
Sergi Almacellas Abellana 4282f9e48f Use cursor from connection instead of transaction on notes
Since changeset 9b2e0aac2d9c
issue5405
review20081002
2016-03-16 13:02:31 +01:00
Cédric Krier 9dfb717088 Always use __name__ instead of _get_name to raise access_error
Other similar exception use __name__
2016-03-16 12:48:15 +01:00
Cédric Krier bfe9e5bea8 ModelStorage._clean_defaults must skip related fields
Related fields like '.rec_name' could be set as default value, they are not
defined in _fields and they must be cleaned.

issue5376
review17131002
2016-03-16 12:46:20 +01:00
Cédric Krier 9b94696b05 Speed up instantiation of Models
Pass as much possible, pre-computed parameters to __init__ to move their
computation outside the loop.

issue5294
review20721002
2016-03-15 19:01:47 +01:00
Cédric Krier 33d8f038d7 Add workflow graph on ir.model
issue5292
review15961002
2016-03-15 18:59:11 +01:00
Cédric Krier ad60794d73 Add context model on ir.action.act_window
issue5220
review20621002
2016-03-15 17:45:07 +01:00
Cédric Krier 8a4ba59b2d Switch to WSGI API
issue4646
review20541003
2016-03-15 16:57:26 +01:00
Cédric Krier 687a51a30c Limit the login size in LoginAttempt
The login data comes from an unauthenticated user so it could be very large and
thus fill the database. But indeed we don't need to have the full login to get
the LoginAttempt benefit, just the 1024 starting char is enough.

issue5381
review17901002
2016-03-14 19:33:40 +01:00
Jean Cavallo e6073b7fb8 Properly handle skip_data
First entries of "skip_data" blocks were always imported,
since the call to startElement was done right after setting
the taghandler attribute.

issue5254
review20781003
2016-03-13 21:46:30 +01:00
Cédric Krier bf6f7c7746 Database.init doesn't take cursor anymore 2016-03-06 02:04:13 +01:00
Cédric Krier 49a844013e Missing PEP-0249 for db_exist 2016-03-05 18:33:24 +01:00
Cédric Krier 9dba6822a9 Missing close when Transaction put connection
If the Transaction is started with close, it should force to close the
connection when put back.
2016-03-05 18:32:49 +01:00
Cédric Krier a94627b160 Remove LocalDict from tools
issue5364
review21781002
2016-03-05 17:31:25 +01:00
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
Cédric Krier 512808e151 Add LRUDictTransaction
issue5293
review22771002
2016-03-03 23:27:38 +01:00
Nicolas Évrard 2fef479575 Follow PEP-0249 for Transaction and backends
issue4949
review19781002
2016-03-03 21:51:57 +01:00