Commit Graph
297 Commits
Author SHA1 Message Date
Sergi Almacellas Abellana 04a027a105 Validate wizard definition on module tests
issue6067
review32831002
2016-12-21 10:07:57 +01:00
Sergi Almacellas Abellana cd51241e3a Add test about editing and coping translations without admin access
issue6115
review34541002
2016-12-19 09:42:12 +01:00
Cédric Krier 2b84a80789 Test no instantiation of reference field with negative id
issue6091
review26941002
2016-12-16 11:00:49 +01:00
Sergi Almacellas Abellana 1029de47c6 Raise valueError when no date is supplied in datetime_strftime
issue6053
review31731002
2016-12-07 12:36:05 +01:00
Cédric Krier 21164f52b0 Use original transaction to check created/deleted records in __raise_integrity_error
The method is often called under a new transaction so the created/deleted
records properties are cleared which makes it raises the wrong message if the
foreign key was created during the same transaction.

issue6038
review29781002
2016-11-28 00:01:51 +01:00
Cédric Krier dcc1770b5b Add test call to on_change methods
- Manage None as value of field in on_change method

issue6069
review27851002
2016-11-27 22:12:43 +01:00
Cédric Krier 21e4b96fea Support selection method in TranslatedSelection
The Selection field could have a method name as selection so
TranslatedSelection must call this method to get the selection values.

issue5999
review27791002
2016-10-31 17:19:47 +01:00
Cédric Krier e843bd23c5 Add button rule
issue5944
review26791002
2016-10-26 09:44:09 +02:00
Nicolas Évrard b3b4c816b7 Check that button's name are member of _buttons and that __rpc__ members are callable
issue5971
review29681002
2016-10-25 12:29:06 +02:00
Nicolas Évrard ccbb43cb1d Use activate instead of install for module activation
issue1456
review28931002
2016-10-20 12:51:56 +02:00
Cédric Krier 8a84cf031f Fix protocols tests for new names: rpc_method and rpc_params 2016-09-27 13:46:44 +02:00
Cédric Krier 6261fa486f Improve ModelStorage.search_count by using no order and COUNT(*)
issue5877
review27651003
2016-09-27 12:18:16 +02:00
Sergi Almacellas Abellana 828afc310d Add sequence_ordered
issue5105
review25561002
2016-09-13 14:01:17 +02:00
Cédric Krier a208d9a0d2 Use simplified language code for time_locale
issue5443
review29511002
2016-09-11 09:20:01 +02:00
Cédric Krier d305c26e54 Add support for derivative translations
This is done by calling first the getter method for the parent language for the
terms that are not yet cached. After existing translations are set for the
language. And finally the result is stored in the cache.
The synchronisation wizard remove also the translations that are identical to
their parent language.
The method load_module_graph adds all parent languages to be loaded for
derivation.

issue5443
review25581002
2016-09-10 23:25:03 +02:00
Cédric Krier 8d3f8347cd Add test about sanitize path in file_open
issue5808
review28691002
2016-08-30 12:15:57 +02:00
Cédric Krier cbed031e22 Add test about reading password hash
issue5795
review32441002
2016-08-30 12:13:31 +02:00
Cédric Krier 739867a41f Fix install_modules for list of modules
The Module.search in case of a list of modules will return more than one
instance.

issue5794
2016-08-26 11:02:34 +02:00
Cédric Krier 276ade5e86 Add database dump cache for tests
issue5794
review21201003
2016-08-25 22:39:15 +02:00
Cédric Krier f94f58fbaf Test Many2Many add to list of records
issue5792
review26551002
2016-08-19 21:35:48 +02:00
Cédric Krier 9937191676 Encode the format of Lang.strftime for Python2
The changeset 83b07c8b2c2d removed the encoding by mistake.
The encoding/decoding dance is necessary on Python2 because strftime returns
str/bytes and converts the unicode format using ascii.

issue5762
review28621002
2016-08-10 23:13:59 +02:00
Sergi Almacellas Abellana 88c28bf4a5 Add missing Transaction().rollback for ModelStorage.save test 2016-07-29 11:24:45 +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
Cédric Krier 065d1b7bb6 Add filestore module
Replace custom Attachment setter/getter by a generic module that can be used by
others.

issue5686
review22141003
2016-07-29 10:46:52 +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 8555aa5b0b Allow None in Greater/Less PYSON
As all statements are evaluated even if surrounded by 'If', it is not possible
to use numeric field with Greater/Less because they can be None.

issue5711
review29381004
2016-07-19 07:40:50 +07:00
Sergi Almacellas Abellana 2cc1d8a5b0 Close database connection before droping the database
issue5384
review27481002
2016-07-08 09:20:45 +02:00
Sergi Almacellas Abellana 5967d21d46 Remove database management from RPC
issue5384
review29311002
2016-07-07 16:05:45 +02:00
Sergi Almacellas Abellana b24c4143a2 Remove string attribute from ir.ui.view and ModelView.view_header_get
issue2350
review24251002
2016-07-05 12:42:46 +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 26312e43f9 Use context to instantiate records in RPC
issue5654
review26411002
2016-06-23 18:48:52 +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 703b21292d Add test Global Search
issue5593
review25121002
2016-06-03 00:03:20 +02:00
Cédric Krier 7731efca78 Fix check_user test for wrong password
changeset 3daf1a0f0ca7 changed the returned value None instead of 0.
So it is better to check against False
2016-05-31 13:23:21 +02:00
Cédric Krier 2c390fe71a Add customizable login process
It adds new configuration option to define the list of login methods.
It defines a new Exception to use to request user data during the login
process.
It separates the generic login attempt protection from the actual
authentication method.
It replace the API of the login methods to use a dictionary of parameters
instead of a single password.

issue5521
review16191003
2016-05-31 12:49:23 +02:00
Sergi Almacellas Abellana 74dcfeb6a6 Allow to customize the substitutions used on sequence
issue4422
review24241002
2016-05-24 11:16:24 +02:00
Cédric Krier b08b37423d Decode data before json loads
issue5536
review23041002
2016-05-10 10:19:22 +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
Nicolas Évrard bc1e9a9830 Support Two-Phase Commit protocol in Transaction
issue3553
review23741003
2016-03-25 17:17:41 +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 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 1a4687d905 Add test for Sequence number next
issue5329
review17931002
2016-03-16 22:04:18 +01:00
Cédric Krier 8a4ba59b2d Switch to WSGI API
issue4646
review20541003
2016-03-15 16:57:26 +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 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
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 29129855ec Add support for Python 3
issue3211
review7311002
2016-02-07 16:46:16 +01:00