Commit Graph
44 Commits
Author SHA1 Message Date
Cédric Krier d1db3bba30 Queue trigger action only when there are records
issue9579
review315901002
2020-09-12 18:33:30 +02:00
Cédric Krier e11a23deb2 Rationalize import path
We use absolute path when imported module is from a different context.
And we remove unnecessary __all__ definition.

issue9466
review323591002
2020-07-21 14:38:36 +02:00
Cédric Krier b1e0c03707 Simplify trigger action
We use now a selection field to choose the action to trigger.
It is safer and more user friendly.

issue9096
review272961003
2020-03-28 23:56:19 +01:00
Cédric Krier 5f9a7554ae Cast CurrentTimestamp into timestamp to remove timezone
issue8342
2020-03-28 23:37:18 +01:00
Cédric Krier 34e5c61a1a Run trigger in the queue
This ensures that internal changes that are reverted later in the same
transaction does not trigger an action.
Also we ensure that a record is triggered by the same trigger only
once per transaction.

issue8342
review280971002
2020-03-28 17:13:12 +01:00
Cédric Krier d7ed5f91f5 Fix flake8 errors and warnings
We add the flake8 configuration used so we ensure everyone uses the same.
We remove the usage of __all__ for non public API.
When possible, we rationalize the class name according to its __name__ and module.

issue9082
review297061002
2020-03-01 12:33:54 +01:00
Cédric Krier 750ad14bb2 Skip trigger using contextual key
Relying on the user is not flexible enough.

issue8993
review260841002
2020-01-29 00:03:40 +01:00
Cédric Krier 97bbaa5213 Allow to delete trigger
For that, we add missing on delete CASCADE on log.

issue8383
review261541002
2019-06-12 19:01:13 +02: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 14e98fbcd3 Remove extra cls argument in __table_handler__ call 2018-07-24 22:16:18 +02:00
Cédric Krier 7a2ce7905a Add __table_handler__ to ModelSQL
issue7581
review48531002
2018-07-24 22:01:08 +02:00
Cédric Krier d2a461390a Remove support for Python 2.7
issue7497
review53261002
2018-06-26 19:11:19 +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
Nicolas Évrard 2fef479575 Follow PEP-0249 for Transaction and backends
issue4949
review19781002
2016-03-03 21:51:57 +01:00
Cédric Krier 9765d8456a Use PYSONDecoder to validate Trigger.condition
Replace Python by PYSON in help and error message about Trigger.condition

issue4940
review24311002
2015-09-01 11:38:19 +02:00
Cédric Krier 44dc331ced Use Constraint instance in ModelSQL._sql_constraints
issue4814
review15491002
2015-06-22 16:57:06 +02:00
Cédric Krier ea605881f2 Fix typo in migration minimum_time_delay of trigger
issue4778
review13191002
2015-05-31 10:03:59 +02:00
Cédric Krier bcd28ca071 Remove safe_eval
We convert all the fields that were storing python code into PYSON.
We add a pyson attribute on field tag to store PYSON value.

issue4416
review6971002
2015-03-09 19:40:41 +01:00
Cédric Krier 0991a552de Add TimeDelta field
And remove float_time widget.

issue4026
review5911002
2015-02-09 22:58:56 +01:00
Cédric Krier c144f8c349 Fix most flake8 errors
review8771002
2014-12-02 12:54:01 +01:00
Cédric Krier fee97ca399 New API for on_change
Modify the instance instead of returning a dictionary.

issue4203
review8581002
2014-10-29 20:38:17 +01:00
Sergi Almacellas Abellana fd7c510ce4 Add grouped_slice helper and use it.
issue3516
review10301002
2014-07-17 18:53:05 +02:00
Cédric Krier 275e612288 Wrong usage of "or" instead of "|" in PYSON of Trigger.on_time 2014-02-19 17:53:35 +01:00
Cédric Krier 905343c900 Add fields.depends decorator
issue3487
review2301002
2014-01-26 14:27:24 +01:00
Cédric Krier f52fe8e45f Use a sequence of records, values in write
issue3499
review1641003
2013-12-19 14:44:01 +01:00
Cédric Krier 81d47ffacb Run trigger when root has user context
review1073002
2013-09-20 00:32:04 +02:00
Cédric Krier fc6c6cfdda Migration to python-sql
* Use python-sql
* Add convert_domain method on Fields
* Add sql_format and sql_type methods on Fields
* Allow to return a full domain for Function.searcher
* Replace static backend by dynamic get method
* Replace order_field by order_<field name> method

review1001002
2013-09-06 22:32:37 +02:00
Cédric Krier 5e750d52a8 Fix missing microseconds initialisation
review1000002
2013-07-29 10:32:45 +02:00
Albert Cervera i Areny 25463800c9 Replace _constraints with validate in ModelStorage and improve user messages.
issue2616
review371002
2013-03-07 16:53:19 +01:00
Sharoon Thomas c861f0fb70 Fix records built as argument by trigger_action
Fix the construction of active records sent as arguments to trigger action
functions to use the source model instead of action_model.

issue3026
review690002
2013-03-06 16:59:54 +01:00
Cédric Krier 5e01f5c068 Fix flake8 2013-02-27 22:50:31 +01:00
Albert Cervera i Areny 30b1403cdc Use a list of dictionaries in create().
issue2358
review266002
2013-01-06 22:18:13 +01:00
Cédric Krier 0fe1b93864 Active Record 2012-09-24 22:16:53 +02:00
Cédric Krier ee3be37a36 Fix pep8 and pyflakes 2012-04-01 23:08:15 +02:00
Nicolas Évrard 584d516067 Integer, Numeric and Float allow None as value
NULL value is None and not False

issue2022
review237004
2012-03-23 17:52:36 +01:00
Mathias Behrle ab54a71984 Change select=1|2 to select=True
issue2305
review269003
2012-03-05 10:54:32 +01:00
Nicolas Évrard 6ba18631e8 Use relative imports 2011-12-14 17:00:13 +01:00
Nicolas Évrard 0a471486e0 correct pyflake errors
review164003
2011-11-02 15:49:38 +01:00
Cédric Krier 2fc1c27b3f Make PYSON more Pythonic
review80001
2011-08-21 11:19:06 +02:00
Cédric Krier 550aae8351 Change Pool into a Singleton
review42001
2011-07-03 13:20:58 +02:00
Nickolay Kolev 86ef7f6fdc Fix for typo in help for minimum_delay for issue1766 2010-11-23 22:55:43 +02:00
Cédric Krier aa5816be0f Move Cache in trytond.cache and convert outside tools for issue1653 2010-08-24 20:54:27 +02:00
Cédric Krier df1fd283ac New transaction management
Remove cursor, user and context from methods and use Transaction instead
2010-08-19 22:01:12 +02:00
Cédric Krier 1513426987 Add ir.trigger to trigger ModelStorage change 2010-05-29 15:58:49 +02:00