Commit Graph
120 Commits
Author SHA1 Message Date
Cédric Krier c587d74dc4 Refresh pool of other processes
When a process change the list of activated modules, the others must refresh
their pool. We do that by just stopping the pool for that database, the next
request will load the new pool.

issue8988
review302861002
2021-01-20 00:52:07 +01:00
Cédric Krier 421ec76c49 Clear all cache after module loaded
As we rollback the cache modification when loading a module, we must clear all
of them at the end to ensure to not keep outdated data.

issue9759
review339421002
2021-01-13 00:26:53 +01:00
Cédric Krier c2e22d9d43 Add language attribute to data tag
issue9559
review302061002
2020-09-18 00:06:31 +02:00
Cédric Krier 5ca5b373ae Prevent import backend when importing module scripts
The configuration is loaded by the script, we must delay the import of backend
until then.

issue9446
review321741002
2020-07-04 23:38:22 +02:00
Cédric Krier b3f8d125f9 Use custom class to store record data
By using a class with slots instead of standard dict, we can reduce a lot the
memory usage to store the record data in the caches and values.
Also we can rely on the data in the cache to exist only for real field which
can be used to create a fast path in ModelStorage.__getattr__.
As now storing data in the cache has no extra cost, we can store data from the
transactional cache in the local. This allow also to have a shorter path in
ModelStorage.__getattr__.
For more memory efficiency, we remove the record from the cache instead of
clearing them. It was better to clear a dict but a record is less expensive to
re-instantiate than clearing.

issue9369
issue9225
review297861002
2020-06-13 09:48:03 +02:00
Cédric Krier eed1f5fe58 Check price_decimal configuration
The price_decimal stored in ir.configuration is checked against the current
configuration value. We do not allow to start serving a database for which the
values are different as it may be due to a misconfiguration which can lead to
data corruption.

issue9324
review317381002
2020-05-28 18:22:45 +02:00
Sergi Almacellas Abellana 3378e283fd Add language configuration wizard
issue9172
review267031002
2020-04-13 20:47:17 +02: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
Nicolas Évrard 8fb13634ea Use direct access to backend classes
issue8836
review258421002
2019-12-06 17:33:47 +01:00
Cédric Krier 7dbcc96b8e Use separate connection to query cache table
The table is a hot spot for contention so we must minimize the duration lock
are kept on it. As at the start of a transaction, the cache may be sync and so
it locks all the row in the table, the transaction used for this query should
not be the main one that lasts a long time. Idem for the commit.

issue8447
review283591002
2019-07-08 21:24:33 +02:00
Xavier Codinas 18c04da18b Use grouped_slice on load_module_graph
issue7051
review45001002
2018-10-24 17:35: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 d2a461390a Remove support for Python 2.7
issue7497
review53261002
2018-06-26 19:11:19 +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 c244bdf422 Clean ir.model and ir.model.field once every models have been registered
The same model can be registered multiple times by one module so the cleaning
can only happen when the all the classes have been registered.

issue7500
review53271002
2018-06-11 23:18:28 +02:00
Xavier Codinas afe5c180b4 Rename "install-dependences" into "activate-dependencies"
issue7343
review50281002
2018-05-09 15:30:48 +02:00
Cédric Krier ca2b442afc Add depends on Pool.register
issue7178
review37051002
2018-03-20 17:27:12 +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 473ac78eb4 Add exceptional parent language
issue6956
review40821003
2017-11-25 22:00:24 +01:00
Cédric Krier 52ddc85f1a Use entry point name instead of last module name
issue6761
review37681002
2017-09-19 23:21:55 +02:00
Sergi Almacellas Abellana e3455875fb Add option to install module dependencies with trytond-admin
issue5696
review29361002
2017-06-30 09:50:49 +02:00
Cédric Krier cdc5952145 Manage Cache in Transaction
issue6216
review33021002
2017-02-02 12:04:27 +01:00
Nicolas Évrard 7ca35d67ee Fix missed renaming of install to activate (take II)
issue1456
2016-10-21 17:59:44 +02:00
Nicolas Évrard d5e24102f3 Fix missing renaming of install to activate
issue1456
review28941002
2016-10-21 12:44:57 +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
Sergi Almacellas Abellana 5353de2e1e Translation import should accept a list of file names
This will prevent deleting valid translations when a module defines multiple
translation files for the same language.

issue5733
review32321002
2016-08-01 10:03:23 +02:00
Cédric Krier a650e8469f Speed up pool setup
We split the operations into two steps, so we can do the setup calls at the end
if there is no installation or update.

issue5302
review17041002
2016-03-17 22:56:58 +01:00
Cédric Krier 6a60572576 Transaction needs to be committed before reseting the Cache
Cache.resets create a new transaction but SQLite keeps a lock from the previous
transaction is it was not committed.
This commit was removed by changeset 9b2e0aac2d9c

issue5388
review16071002
2016-03-16 22:07:46 +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 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
Sharoon Thomas 89de660c52 Move webdav into a separate module
issue4703
review7101002
2016-01-16 19:20:30 +01:00
Korbinian Preisler c849f0be8b Allow to import overridden translations from different po-file
issue4971
review18581002
2015-09-26 15:23:43 +02:00
Cédric Krier 7459aab3d1 Use CURRENT_TIMESTAMP instead of NOW
CURRENT_TIMESTAMP is the correct SQL standard way.

issue4837
review15531002
2015-07-01 19:41:49 +02:00
Cédric Krier 52ff97b165 Rename ir.module.module* into ir.module*
issue4764
review7171002
2015-05-28 21:02:01 +02:00
Cédric Krier 39e7eeeadb Add support for psycopg2cffi and PyPy
issue4408
review11741002
2015-03-15 15:52:03 +01:00
Cédric Krier 20484bb013 Fix formatting in logger calls 2015-03-05 11:32:18 +01:00
Cédric Krier 0ac0990c77 Improve logging
issue4458
review11781002
2015-03-02 23:39:15 +01:00
Guillem Barba 21ed4772e5 Recover uninstall modules feature
Manage case when state is 'to remove'.

issue322
review7881002
2015-01-16 10:21:52 +01:00
Cédric Krier c144f8c349 Fix most flake8 errors
review8771002
2014-12-02 12:54:01 +01:00
Robin Baumgartner e70973cac8 Remove workflow migration
issue4281
review13701002
2014-11-18 16:36:49 +01:00
Cédric Krier fb3eb72d16 Fix wrong is_module_to_install test introduced in changeset b0a271549ddd 2014-09-13 13:56:43 +02:00
Cédric Krier 7b3757f5a1 Merge update and init options and improve help message
- deprecates the init option
- replace the keyword "all" by an option "--all"
- rename debug into dev like in the client

issue4165
review7571003
2014-09-13 12:17:13 +02:00
Cédric Krier 34367b037c Missing initialisation of update parameter in load_module_graph
Since changeset 01399128964f, update must be a list of module to update.
2014-09-06 16:17:21 +02:00
Cédric Krier e0b995abbe Refactore configuration to allow easy extention
issue3627
review7401002
2014-09-03 23:32:01 +02:00
Cédric Krier ab820aecf5 'res' should be global in load_modules
issue4045
2014-07-20 12:39:15 +02:00
Cédric Krier bc6acd08ee Drop support of Python 2.6
review2691002
2014-01-31 00:02:03 +01:00
Jean CAVALLO 90cf6b031d Properly calculate the module states when upgrading
issue3518
review1871002
2013-11-26 11:25:36 +01:00
Cédric Krier 41d2aa44ea Ignore "noupdate" attribute when installing a new module
issue2854
review631004
2013-09-20 00:36:00 +02:00
Cédric Krier ab74123eb2 Merge test/ into tests/
review1060002
2013-09-16 11:38:11 +02:00