Commit Graph
247 Commits
Author SHA1 Message Date
Cédric Krier 39bcde5357 Use a separate cursor in loop to set translation
cursor_dict returns an iterator that consumes the cursor. This means the cursor
can not be used before the iteration is stopped. So we need to use another
cursor to make the update queries.
2016-03-17 17:14:53 +01:00
Nicolas Évrard 2fef479575 Follow PEP-0249 for Transaction and backends
issue4949
review19781002
2016-03-03 21:51:57 +01:00
Raimon Esteve 92f9374a21 Prevent deleting translations that are not updated
issue5310
review21661002
2016-02-08 18:08:19 +01:00
Cédric Krier 29129855ec Add support for Python 3
issue3211
review7311002
2016-02-07 16:46:16 +01:00
Cédric Krier 3a02e1d54e Don't import obsolete translations
issue5055
review23561003
2015-10-21 18:20:57 +02:00
Raimon Esteve 24c499737e Remove trailing style_content attribute
changeset 45e423bd93fe has not completely removed all references to
style_content.

issue5003
review24441002
2015-10-04 22:56:53 +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 52ff97b165 Rename ir.module.module* into ir.module*
issue4764
review7171002
2015-05-28 21:02:01 +02:00
Cédric Krier 10d896fa77 Fix search_rec_name for negative operator
In case of negative operator, each subclause must be composed with 'AND'.

issue4559
review7071002
2015-04-05 23:34:38 +02:00
Cédric Krier 5cfde31ed2 Use bytes and bytearray for Binary
issue4637
review11091002
2015-03-16 19:28:34 +01:00
David Harper 0c9012f3b7 change Ok to OK
issue4290
review7011002
2015-03-10 18:17:32 +01: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 38b59e0329 Remove Pool.object_name_list
This method is inefficient for testing existence of an item, it is better to
ask for forgiveness.

review12761002
2014-12-16 22:02:44 +01:00
Cédric Krier c144f8c349 Fix most flake8 errors
review8771002
2014-12-02 12:54:01 +01:00
Robin Baumgartner 8b3557921e Use Null constant from python-sql for comparisons
issue4143
review13701003
2014-11-24 13:57:12 +01:00
Cédric Krier 360f39f89d Make cache size configurable
* Clean private context keyword in RPC
* Add cache section in configuration

issue4320
review10641002
2014-11-19 21:35:51 +01:00
Cédric Krier b919ed5569 ModelStorage.save doesn't return records
introduced in changeset 4b5436e9d2c7
2014-11-02 16:07:26 +01:00
Cédric Krier b13abebc81 Use dualmethod on ModelStorage.save
issue4197
review8671002
2014-11-01 11:52:55 +01:00
Cédric Krier a2c8111f26 Use context to check model and field access
* Model and Field access checked only if _check_access is set
* Add check_access to RPC
* Add check_access to Wizard and Report

issue4081
review8481002
2014-09-17 21:43:53 +02: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 962fe3daf5 Merge ir_translation migration from 2.2 and 2.8
Both migration are incompatible so it only works if there are merged.

issue3998
review7391002
2014-06-22 16:58:07 +02:00
Cédric Krier 6ca677e877 Update translation source per module
issue3775
review4491002
2014-03-21 23:43:59 +01:00
Cédric Krier 7c151984e0 Let raise user error in import_data
issue3767
review4441002
2014-03-18 19:49:51 +01:00
Cédric Krier 9d1a3be65c Fix translation creation
changeset 1a94e9f76bca broke the translation creation because it misses lang
and module value.

review3861002
2014-02-26 09:34:54 +01:00
Sergi Almacellas Abellana 38d225f7c6 Refactor translation import and update to improve custom types support.
review2431002
issue3566
2014-02-25 10:58:21 +01:00
Cédric Krier 487381d700 Search also on source for some translation types when overriding
issue3637
review3221004
2014-02-09 23:53:10 +01:00
Nicolas Évrard eac48b2a50 Access sql related errors only if Model is a subclass of ModelSQL
review3111002
issue3628
2014-02-03 17:51:25 +01:00
Cédric Krier bc6acd08ee Drop support of Python 2.6
review2691002
2014-01-31 00:02:03 +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 21faa6b9db Don't export empty translation file 2013-10-20 00:15:17 +02:00
Sergi Almacellas Abellana cd9e0a4566 translations use cls instead of class name
review1124002
issue3415
2013-10-08 15:34:21 +02:00
Cédric Krier 5ad27258fd Fix flake8 2013-10-05 18:18:42 +02:00
Cédric Krier 4c2cadcb5c Re-sync clean exception of generic error message 2013-10-05 14:10:59 +02:00
Cédric Krier 9da528ed1d Fix Translation.search_model to return a domain instead of sql Expression
issue3390
review1113002
2013-10-03 21:16:22 +02:00
Cédric Krier 44551a9dae Add missing default value for res_id
issue3392
review1108002
2013-10-01 19:17:04 +02:00
Cédric Krier b03788e6db Fix duplicate translations
- Fix unique constraint by using -1 instead of NULL for res_id
- Clean duplicate entries in po file

The unique constraint was not working when res_id was NULL because SQL consider
all of them as different.

The migration could fail if there is duplicate translation in the database. So
this query must be run until no more records are deleted:

DELETE FROM ir_translation WHERE id IN (SELECT MAX(id) FROM ir_translation GROUP BY name, res_id, lang, type, src_md5, module HAVING COUNT(1) > 1);

issue3355
review1087004
2013-09-22 14:33:39 +02:00
Cédric Krier ff43a1fd6b Better default language for the export translation wizard
Use the domain of the field to search for the current language.
2013-09-20 18:33:35 +02:00
Cédric Krier fa017d140f Fix typo in alias 2013-09-20 18:08:31 +02:00
Cédric Krier bac6abd84b Set alias to Translation update query
Do not rely on the database to get the name of the column when fetching result
as dict.

issue3373
review1071002
2013-09-20 00:39:45 +02:00
Cédric Krier f020d71234 Optimize cache management when importing po file
issue3356
review1061003
2013-09-18 00:13:47 +02:00
Cédric Krier ed5c127a14 Fix use None instead of False in translation domain 2013-09-17 17:47:10 +02:00
Cédric Krier ba42bc2f89 Fix typo in Translation 2013-09-17 17:38:45 +02:00
Nicolas Évrard 349a146d66 Allow customization of translation in po files
review968002
2013-09-16 12:26:10 +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 a7e7b3b91e Change Translation.set_ids to use a list of values
review1005002
2013-09-02 17:38:11 +02:00
Cédric Krier f55fbdaa33 Add cache to Translation.get_language
review1005002
2013-09-02 17:37:21 +02:00
Cédric Krier d4def3771b SUBSTR doesn't allow negative length
issue3150
review793002
2013-04-16 15:22:55 +02:00
Cédric Krier 2e8ec5f5df Replace SPLIT_PART by SUBSTR and POSITION
SPLIT_PART is not a standard SQL function (it is not supported by MySQL).
SUBSTR is used even if it is not standard SQL because SUBSTRING is not
supported by SQLite. This will change once we will migrate to python-sql.

review784002
2013-04-14 23:17:55 +02:00
Cédric Krier 7a9c89da17 merge 2013-04-08 23:49:57 +02:00
Cédric Krier e77ecd948f Manage extra model from model data for ir.action.*
ir.action.* create ir.action record on the fly which contains translatable
field. So they must inherit the xml id to be seen as module translation.

issue3123
review768002
2013-04-08 23:48:34 +02:00