Commit Graph
391 Commits
Author SHA1 Message Date
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 5cab9c3995 Add test ordering of selection field
issue7934
review66491002
2018-12-30 00:14:59 +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 d1bb790cb8 New API to read related fields
issue7888
review58431002
2018-12-21 23:41:56 +01:00
Cédric Krier c7f5c54a83 Remove implicit fields names in ModelStorage.read
It is a bad practice to not explicit the fields to read. So we should not
support it.

issue7830
review54421002
2018-11-28 10:05:01 +01:00
Cédric Krier c0510b0ec2 Refactoring test account and include search
issue7766
review50591002
2018-11-12 17:19:24 +01:00
Cédric Krier 99580a2e6a Ensure to rollback and clean cache on exception
Exception raised in a test decorated by with_transaction should always clear
the cache to avoid leaking to other tests.

issue7829
review64471002
2018-11-07 19:02:34 +01:00
Cédric Krier 39ea946edd Remove custom strftime for year before 1900
The bug has been fixed in Python 3.3

issue7814
review48671002
2018-10-31 18:15:57 +01:00
Cédric Krier 9ebba6207b Fix argument order to Bus.publish in notify
issue7807
review51571002
2018-10-26 23:24:09 +02:00
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