Commit Graph
380 Commits
Author SHA1 Message Date
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
Nicolas Évrard eb04b82822 Add bus management
issue7537
review66341002
2018-08-30 11:15:01 +02:00
Cédric Krier fac1c92bef Use passlib
issue4161
review51461002
2018-08-25 13:06:05 +02:00
Cédric Krier 2542224ce5 Add pyson TimeDelta
issue7351
review47651002
2018-08-18 17:19:33 +02:00
Cédric Krier 507a06a107 Use sqlite3.backup when available
issue7212
review44131002
2018-08-06 19:05:44 +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
Sergi Almacellas Abellana 26f775e0b4 Add test for recursive dependant fields without access
issue7501
review46551002
2018-07-11 16:23:11 +02:00
Cédric Krier 9681897041 Implicit conversion to boolean in PYSON statement
issue7528
review58271002
2018-07-10 16:55:37 +02:00
Cédric Krier 08d57b436d Remove cdecimal dependency
It is no more needed as it is standard under Python3
2018-06-27 10:42:15 +02:00
Cédric Krier f72767bb6c Remove mock from tests requirements 2018-06-26 19:59:01 +02:00
Cédric Krier d2a461390a Remove support for Python 2.7
issue7497
review53261002
2018-06-26 19:11:19 +02:00
Cédric Krier 93526b9cd0 Check rule after indirect fields and modification
The rule may depend on indirect field written latter so it must be checked
after the storage of those fields.
On write, the rule must be checked before the modification but also after to
ensure users do not generate records that they can not modify after.

issue7403
review53301002
2018-06-24 16:54:46 +02:00
Cédric Krier 0d07dea2ac Return new records from copy following the input order
issue7512
review58291002
2018-06-24 16:48:27 +02:00
Cédric Krier 7408bb8090 Simplify the creation of dependencies graph
There is no need to create the graph step by step with only dependencies
already registered as far as the depth computation is propagated to all the
children.
Instead of searching level by level the nodes to iterate, it is faster to use
the sort of Python.
create_graph does not need to return its internal states but only the graph.
The ir.module activate and update method does not need to check for missing
dependencies because it is already checked at startup.

issue7466
review45211002
2018-06-11 23:22:35 +02:00
Cédric Krier 35bba61748 Make depends on methods generic to any method
issue5191
review50381002
2018-05-31 13:23:55 +02:00
Cédric Krier 5ca66d5ccf Add tree mixin
- Implement generic get_rec_name and search_rec_name
- Include recursive check

issue7383
review48281002
2018-05-12 00:45:55 +02:00
Cédric Krier 4ed54e9bbc Support child_of/parent_of with None in the value list
This was a implicit behaviour before the changeset 6fefd00369c1.
As a lot of code rely on this behaviour, we make it explicit by adding a test
case.

issue7405
review36251002
2018-05-03 11:57:10 +02:00
Cédric Krier 962b164709 Test Decimal in PYSONEncoder
issue7291
review46341002
2018-04-17 17:58:40 +02:00
Cédric Krier 67fd16fa5d Add tests for extra pattern in get_multivalue and set_multivalue
issue6672
review47291003
2018-04-09 10:50:49 +02:00
Sergi Almacellas Abellana bfb76a70ad Add deactivable mixin and ensure active field is present
issue4341
review38401002
2018-03-26 14:07:45 +02:00
Cédric Krier 9865cc43e6 Add test to check that depends on _parent_ contains also the relation
Otherwise, the depends decorator will set the relation to None if the record
is not in One2Many widget. And the method will not behave the same as if the
record was in a One2Many widget.
And if it is an on_change call, it will remove the value on the client side.

issue7249
review45291002
2018-03-24 13:50:47 +01:00
Cédric Krier b3ca13748b Add Exclude constraint
issue1422
review44061002
2018-03-19 16:57:49 +01:00
Nicolas Évrard acdbe5a08f Allow to perform unaccented searches on Char fields
issue7115
review44611002
2018-03-16 18:17:53 +01:00
Cédric Krier 57248f9655 Clear cache for all records of ModelSingleton
As write and delete can be called with any ids for records and the super calls
are always on the real record, the cache is only cleared for the real record.
So ModelSingleton must ensure to clear the cache for any record ids.

issue7205
review44731002
2018-03-15 00:23:11 +01:00
Sergi Almacellas Abellana ff2bded417 Ensure that all buttons are registered in ir.model.button
issue6389
review36621002
2018-03-01 11:59:23 +01:00
Cédric Krier 4a909f94a2 Add reset password
The reset password button generates a temporary random password which expires
after 1 day and is sent to the email address of the user.
The temporary password does not work as soon as a new password has been set.
The trytond-admin asks the email address for admin user and has an option to
set the admin email and to reset its password.

issue7037
review41761002
2018-02-23 19:13:19 +01:00
Sergi Almacellas Abellana 54f70e2971 Add depends on Button
issue6919
review40811002
2018-02-19 11:35:37 +01:00
Cédric Krier b197b6b13d Add cache for check_xml_record
This allows fast return when the checked model has no record in ir.model.data
which is the most common case. This allow to prevent to search for non
existing records.

issue7119
review37991002
2018-02-14 19:35:57 +01:00
Cédric Krier f911f48ed4 Delete translations only when model has translatable field
The call to Translation.delete_ids has a cost as it does search queries. So it
is better to not call it if we already know that there is nothing to delete.

issue7118
review37981003
2018-02-11 14:59:58 +01:00
Sergi Almacellas Abellana 0eaf7c16b8 Add 10 digits validation test on numeric field
issue7091
review37981002
2018-02-07 12:27:52 +01:00
Cédric Krier d1874d4f5f Ensure all modules are activated by testing tools
issue7079
review41801002
2018-02-07 01:16:15 +01:00
Cédric Krier 25df09ead1 Replace assertItemsEqual for Python3 2018-02-02 00:58:15 +01:00
Cédric Krier ef74636148 Remove import of removed test.py file 2018-02-02 00:27:41 +01:00
Cédric Krier 478c4e6928 Refactor fields tests
issue7085
review40051002
2018-02-02 00:04:19 +01:00
Cédric Krier b32d158d10 Remove MySQL backend
issue7017
review41771002
2018-01-24 20:12:42 +01:00
Cédric Krier e7e4472c03 Allow to include mixin to pool objects
issue4735
review41751002
2018-01-12 15:46:52 +01:00
Cédric Krier 10042b9597 Improve validation of PYSON domain
Use a different strategy if we are close to one domain per record.
It will use combined multiple domain at once instead of doing one query for
almost each record validated.

issue6983
review39021002
2017-12-26 17:28:42 +01:00
Sergi Almacellas Abellana e0c016aaf8 Use diferent values for active_ids and active_id on action window tests
This allows to test all clauses of pattern used by relate windows

issue7028
review42991002
2017-12-22 12:26:06 +01:00
Sergi Almacellas Abellana cbf090cdb7 Complete ir_action_window test
Test search_value, context_domain and context model are correclty defined

issue6880
review43711002
2017-11-20 15:33:22 +01:00
Cédric Krier 271442d913 Simplify language formatting
* Add get method on ir.lang
* Convert format, currency and strftime of ir.lang into instance methods

issue6858
review40761002
2017-11-15 00:15:27 +01:00
Cédric Krier 291beaa10c Wait for the database accepting connection to run tests
issue6844
review43671002
2017-10-30 09:36:10 +01:00
Cédric Krier 87bbc9ee1a Apply filter when searching on xxx2many with one
The changeset b16a085824ce, which implements the filter, did not update the
search_domain of the fields to also apply the filter on the searched result.

issue6871
review36721003
2017-10-24 22:19:40 +02:00
Cédric Krier 12a3098a8b Fix typo in test method name 2017-10-24 22:14:50 +02:00
Cédric Krier b7ae7c8b0f Add test for required Reference with invalid record
issue6749
review36661002
2017-10-11 22:41:55 +02:00
Sergi Almacellas Abellana 520824b633 Take in account the modules filter when adding tests to all_suite
This was wrongly removed in changeset 2e73b7d8e1c6
issue6817
review44371002
2017-10-06 14:42:26 +02:00
Cédric Krier a17386e970 Let default value of copy converted for the type of field
The default value of copy is expected to be the same format as for the default
methods. So the value for xxx2Many fields must be converted.

issue6818
review37751002
2017-10-06 11:00:41 +02:00
Nicolas Évrard ba9cbab0de Allow to add tests in trytond through entry_points
issue6423
review35371002
2017-10-02 11:38:02 +02:00
Nicolas Évrard a6688da3d3 Add missing fields import removed by merge of changeset 6089dcb6076a 2017-09-28 19:27:02 +02:00
Nicolas Évrard 40d37f57bf Add test for ModelSingleton inheritance order
issue6629
review43261002
2017-09-28 18:40:39 +02:00