Commit Graph
4917 Commits
Author SHA1 Message Date
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
Sergi Almacellas Abellana 4b7c47b3bd Add missing separator start the server first step
issue5411
review17961002
2016-03-16 15:07:25 +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 4b88535451 Update tox.ini for the new required version of psycopg2
issue5391
review16071003
2016-03-13 16:16:53 +01:00
Cédric Krier e19696779b Backed out changeset 83e1c6b2741e
Ubuntu python3-lxml doesn't have a working etree module for all Python version.

issue5389
2016-03-12 16:39:09 +01:00
Cédric Krier fa2da27621 Use sitepackages option to run tox on drone
issue5389
2016-03-12 16:17:25 +01:00
Cédric Krier d7815c5697 Remove useless include of trytond/ir/module/*.xml
The module directory of ir have been removed in changeset 98bcb2ee56c2
2016-03-12 15:28:52 +01:00
Cédric Krier e3e93ea748 Update required version of psycopg2
With issue4949, we need context management on connection and cursor,
this was introduced in psycopg2 version 2.5.

review24911002
2016-03-10 22:27:21 +01:00
Cédric Krier 5c291d56a4 Sync python-sql dependency version from the doc with setup.py 2016-03-10 14:26:53 +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
Cédric Krier 3e13f3d004 Fix SQLite greatest and least for unorderable None
In Python3, None can not be ordered because it doesn't have a natural order.
So we implement the same behaviour for SQLite than PostgreSQL which ignore NULL.

issue5358
review20821002
2016-03-01 21:46:14 +01:00
Nicolas Évrard 356fd6e9e7 Open view and icon files in binary mode
Since the support of python3 has been added file_open will return unicode
object when read in normal mode but icon files has to be considered as bytes
and lxml.etree.fromstring expect also bytes when there is an encoding
declaration (and not unicode).

issue5354
review17081002
2016-02-29 13:03:57 +01:00
Cédric Krier 64d6e4b3ec Test values against bytes instead of str
For Python3 compatibility, the test to decode should be done on bytes because
str in Python3 is already a unicode.

issue5355
review24851004
2016-02-27 23:48:28 +01:00
Cédric Krier ae8975ede3 Add doctest checker for Python 2-3
2to3 doesn't convert unicode string of Python 2 into string of Python 3.
So we will use a special checker that remove the 'u' prefix when checking
output.

issue3211
review19911002
2016-02-24 22:00:06 +01:00
Nicolas Évrard 61018dc9b7 Fix wrong test for existing database introduced in changeset 903a52fc1bb2
issue5238
review18861002
2016-02-23 17:40:30 +01:00
Cédric Krier 91b09d297d Cache must be cleared on each Cron.run
issue5332
review21711002
2016-02-22 23:17:19 +01:00
Nicolas Évrard 9aa648513e re-add the use of the case removed in changeset 0c62b08fa917
Removing the case resulted in the evaluation of expression that were not valid
like the cast of a string into an integer.

issue5335
review16011002
2016-02-19 12:43:12 +01:00
Cédric Krier 68eca37c72 Add _update_definitions after column_rename
issue5325
review16001002
2016-02-15 10:07:18 +01:00
Cédric Krier af00126074 Allow to modify XML record with noupdate
issue5176
review19851002
2016-02-11 22:18:29 +01:00
Cédric Krier 70827fe06b XML files must be open in binary mode for sax parser
The sax parser expect a byte stream, so we must open the file with the binary
mode. Also file_open should have a default encoding to None because encoding
should not be set in binary mode.

issue5313
2016-02-09 22:45:44 +01:00
Cédric Krier 7ca5529e49 Use assertValid instead of assert_from lxml.etree.RelaxNG
2to3 convert assert_ into assertTrue but this method is not defined in lxml.
To avoid this conversion, we use assertValid.

issue5314
review21681002
2016-02-09 21:05:37 +01:00
Cédric Krier 8eeb0140ed Add encoding to file_open
For Python3, we must define the encoding when opening a file.

issue5313
review21671002
2016-02-09 21:04:39 +01:00
Cédric Krier 41f4702273 Use warnings instead of logging for missing SQLite TableHandler features
and capture warnings into logging.
This allow to not be flooded by the same kind of warnings when running tests.

issue5316
review17821002
2016-02-09 18:42:59 +01:00
Raimon Esteve 92f9374a21 Prevent deleting translations that are not updated
issue5310
review21661002
2016-02-08 18:08:19 +01:00
Cédric Krier e201484c37 Add missing doc about "Record Rule"
review18941002
2016-02-08 18:07:44 +01:00
Cédric Krier 29129855ec Add support for Python 3
issue3211
review7311002
2016-02-07 16:46:16 +01:00
Cédric Krier da1be07832 Make TestCase create and drop its database
and add with_transaction decorator.

issue5263
review20711002
2016-02-06 19:10:35 +01:00
Cédric Krier 1ae75711a8 Add Note on resources
issue4669
review12061002
2016-02-02 19:14:35 +01:00
Cédric Krier aeddfaa7c0 Add history tests for reading One2Many with datetime_field
issue5269
review20671002
2016-02-02 19:03:57 +01:00
Cédric Krier 81f1e8b6db Fix typo when reading getter fields with datetime_field
issue5269
review20671002
2016-02-02 19:03:11 +01:00
Nicolas Évrard 9f93cf1822 Fix typo introduced in the documentation in changeset a4ddc81fecf5 2016-01-21 11:13:33 +01:00
Nicolas Évrard d4e3b605ef Add 'where' operator to xxx2many
issue4507
review12951002
2016-01-21 10:48:32 +01:00
Cédric Krier fa0774cd1e Add more details on invalid XML error
It is useful when the error happens during the execution of the tests.

issue5257
review17761002
2016-01-21 10:40:30 +01:00
Cédric Krier 2f2e95e09f Drop also foreign key constraint of old field column of ir.rule
The foreign key must be dropped otherwise changes in the ir.model.field table
can fail because of the foreign key constraint.
The migration should always remove all unused constraints.

issue5241
review17741002
2016-01-21 10:27:22 +01:00