From 65e6027d63700c49dd49c60d62b41b55849f96e8 Mon Sep 17 00:00:00 2001 From: Jigar Amin - OpenERP Date: Wed, 11 Jul 2012 11:00:16 +0530 Subject: [PATCH 01/62] [ADD] module base gengo bzr revid: jam@tinyerp.com-20120711053016-7i20l7l94f56sn9t --- addons/base_gengo/__init__.py | 22 ++++++++++++++++++ addons/base_gengo/__openerp__.py | 40 ++++++++++++++++++++++++++++++++ 2 files changed, 62 insertions(+) create mode 100644 addons/base_gengo/__init__.py create mode 100644 addons/base_gengo/__openerp__.py diff --git a/addons/base_gengo/__init__.py b/addons/base_gengo/__init__.py new file mode 100644 index 00000000000..6825dc22f47 --- /dev/null +++ b/addons/base_gengo/__init__.py @@ -0,0 +1,22 @@ +# -*- coding: utf-8 -*- +############################################################################## +# +# OpenERP, Open Source Management Solution +# Copyright (C) 2004-2010 Openerp sa (). +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as +# published by the Free Software Foundation, either version 3 of the +# License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . +# +############################################################################## + +# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: diff --git a/addons/base_gengo/__openerp__.py b/addons/base_gengo/__openerp__.py new file mode 100644 index 00000000000..43a6e258418 --- /dev/null +++ b/addons/base_gengo/__openerp__.py @@ -0,0 +1,40 @@ +# -*- coding: utf-8 -*- +############################################################################## +# +# OpenERP, Open Source Management Solution +# Copyright (C) 2004-2010 Tiny SPRL (). +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as +# published by the Free Software Foundation, either version 3 of the +# License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . +# +############################################################################## + +{ + 'name': 'Automated Translations through Gengo API', + 'version': '0.1', + 'category': 'Tools', + 'description': """ +Automated Translations through Gengo API + """, + 'author': 'OpenERP SA', + 'website': 'http://www.openerp.com', + 'depends': ['base'], + 'init_xml': [], + 'update_xml': [], + 'demo_xml': [], + 'test': [], + 'installable': True, + 'auto_install': False, +} + +# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: From b592896f4ba0729ae4f75990db4b68a32af24e82 Mon Sep 17 00:00:00 2001 From: "ajay javiya (OpenERP)" Date: Thu, 12 Jul 2012 11:47:40 +0530 Subject: [PATCH 02/62] [ADD]: Add state field for ir.translation bzr revid: aja@tinyerp.com-20120712061740-4mo3l0d70wxthki2 --- openerp/addons/base/ir/ir.xml | 3 +++ openerp/addons/base/ir/ir_translation.py | 26 +++++++++++++++++------- 2 files changed, 22 insertions(+), 7 deletions(-) diff --git a/openerp/addons/base/ir/ir.xml b/openerp/addons/base/ir/ir.xml index 4de12d8bfeb..ff9ba292fe2 100644 --- a/openerp/addons/base/ir/ir.xml +++ b/openerp/addons/base/ir/ir.xml @@ -1258,6 +1258,9 @@ form
+
+ +
diff --git a/openerp/addons/base/ir/ir_translation.py b/openerp/addons/base/ir/ir_translation.py index 61e40e807d4..7693f95a7c8 100644 --- a/openerp/addons/base/ir/ir_translation.py +++ b/openerp/addons/base/ir/ir_translation.py @@ -77,14 +77,16 @@ class ir_translation_import_cursor(object): def push(self, ddict): """Feed a translation, as a dictionary, into the cursor """ - + state= "translated" + if not ddict['value']: + state = 'translate' self._cr.execute("INSERT INTO " + self._table_name \ + """(name, lang, res_id, src, type, - imd_model, imd_module, imd_name, value) - VALUES(%s, %s, %s, %s, %s, %s, %s, %s, %s)""", + imd_model, imd_module, imd_name, value,state) + VALUES(%s, %s, %s, %s, %s, %s, %s, %s, %s, %s)""", (ddict['name'], ddict['lang'], ddict.get('res_id'), ddict['src'], ddict['type'], ddict.get('imd_model'), ddict.get('imd_module'), ddict.get('imd_name'), - ddict['value'])) + ddict['value'],state)) def finish(self): """ Transfer the data from the temp table to ir.translation @@ -125,15 +127,16 @@ class ir_translation_import_cursor(object): # Step 2: update existing (matching) translations if self._overwrite: cr.execute("""UPDATE ONLY %s AS irt - SET value = ti.value + SET value = ti.value, + state = 'translated' FROM %s AS ti WHERE %s AND ti.value IS NOT NULL AND ti.value != '' """ % (self._parent_table, self._table_name, find_expr)) # Step 3: insert new translations - cr.execute("""INSERT INTO %s(name, lang, res_id, src, type, value) - SELECT name, lang, res_id, src, type, value + cr.execute("""INSERT INTO %s(name, lang, res_id, src, type, value,state) + SELECT name, lang, res_id, src, type, value,state FROM %s AS ti WHERE NOT EXISTS(SELECT 1 FROM ONLY %s AS irt WHERE %s); """ % (self._parent_table, self._table_name, self._parent_table, find_expr)) @@ -167,6 +170,11 @@ class ir_translation(osv.osv): 'type': fields.selection(TRANSLATION_TYPE, string='Type', size=16, select=True), 'src': fields.text('Source'), 'value': fields.text('Translation Value'), + 'state':fields.selection([('translate','To Translate'),('inprogress','Translation in Progress'),('translated','Translated')]) + } + + _defaults = { + 'state':'translated', } _sql_constraints = [ ('lang_fkey_res_lang', 'FOREIGN KEY(lang) REFERENCES res_lang(code)', @@ -297,6 +305,10 @@ class ir_translation(osv.osv): return ids def write(self, cursor, user, ids, vals, context=None): + if vals.get('src'): + result= vals.update({'state':'translate'}) + if vals.get('value'): + result= vals.update({'state':'translated'}) if not context: context = {} if isinstance(ids, (int, long)): From 9eda964e6e165f35a77242cba0e57c3e73187b6a Mon Sep 17 00:00:00 2001 From: "Twinkle Christian (OpenERP)" Date: Fri, 13 Jul 2012 17:41:29 +0530 Subject: [PATCH 03/62] [IMP]Adding .py files in base_gengo module bzr revid: tch@tinyerp.com-20120713121129-bw973p0ruwlvfm60 --- addons/base_gengo/__init__.py | 9 +++++++++ addons/base_gengo/__openerp__.py | 4 +++- 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/addons/base_gengo/__init__.py b/addons/base_gengo/__init__.py index 6825dc22f47..e1537d7ab27 100644 --- a/addons/base_gengo/__init__.py +++ b/addons/base_gengo/__init__.py @@ -19,4 +19,13 @@ # ############################################################################## +import res_company +import ir_translation + + + + + + + # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: diff --git a/addons/base_gengo/__openerp__.py b/addons/base_gengo/__openerp__.py index 43a6e258418..4f1d296f856 100644 --- a/addons/base_gengo/__openerp__.py +++ b/addons/base_gengo/__openerp__.py @@ -30,7 +30,9 @@ Automated Translations through Gengo API 'website': 'http://www.openerp.com', 'depends': ['base'], 'init_xml': [], - 'update_xml': [], + 'update_xml': [ + 'ir_translation.xml' + ], 'demo_xml': [], 'test': [], 'installable': True, From 07f5aaf242b6a2f69d6242ce7cf8f9d77430ba2c Mon Sep 17 00:00:00 2001 From: "Twinkle Christian (OpenERP)" Date: Fri, 13 Jul 2012 17:49:35 +0530 Subject: [PATCH 04/62] [IMP]Adding .py files in base_gengo module bzr revid: tch@tinyerp.com-20120713121935-8akpxoebe6i9j1ja --- addons/base_gengo/ir_translation.py | 41 ++++++++++++++++++++++++++ addons/base_gengo/ir_translation.xml | 17 +++++++++++ addons/base_gengo/res_company.py | 43 ++++++++++++++++++++++++++++ 3 files changed, 101 insertions(+) create mode 100644 addons/base_gengo/ir_translation.py create mode 100644 addons/base_gengo/ir_translation.xml create mode 100644 addons/base_gengo/res_company.py diff --git a/addons/base_gengo/ir_translation.py b/addons/base_gengo/ir_translation.py new file mode 100644 index 00000000000..7160d102970 --- /dev/null +++ b/addons/base_gengo/ir_translation.py @@ -0,0 +1,41 @@ +# -*- coding: utf-8 -*- +############################################################################## +# +# OpenERP, Open Source Management Solution +# Copyright (C) 2004-2010 Tiny SPRL (). +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as +# published by the Free Software Foundation, either version 3 of the +# License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . +# +############################################################################## + +from osv import fields,osv,orm +import os +import openerp +import tools + +class ir_translation(osv.osv): + _name = "ir.translation" + _description="Translation" + _inherit="ir.translation" + _columns = { + 'gengo_comment':fields.text("comments", help="Comment for translators"), + 'gengo_translation':fields.boolean("Translation", help='This term has to be translated by Gengo automatically'), + 'gengo_control':fields.boolean('Active'), + + } + + _defaults = { + 'gengo_control':False, + } + diff --git a/addons/base_gengo/ir_translation.xml b/addons/base_gengo/ir_translation.xml new file mode 100644 index 00000000000..72c6f99730d --- /dev/null +++ b/addons/base_gengo/ir_translation.xml @@ -0,0 +1,17 @@ + + + + + Translations + ir.translation + + search + + + + + + + + + diff --git a/addons/base_gengo/res_company.py b/addons/base_gengo/res_company.py new file mode 100644 index 00000000000..1fa07bb65e2 --- /dev/null +++ b/addons/base_gengo/res_company.py @@ -0,0 +1,43 @@ +# -*- coding: utf-8 -*- +############################################################################## +# +# OpenERP, Open Source Management Solution +# Copyright (C) 2004-2010 Tiny SPRL (). +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as +# published by the Free Software Foundation, either version 3 of the +# License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . +# +############################################################################## + +from osv import fields,osv,orm +import os +import openerp +import tools + +class res_company(osv.osv): + _name = "res.company" + _description = "companies" + _inherit = "res.company" + _columns = { + "gengo_private_key":fields.text("Gengo private key"), + "gengo_public_key":fields.text("Gengo public key"), + "gengo_tier":fields.selection([('machine','Machine'), + ('standard','Standard'), + ('pro','Pro'), + ('ultra','Ultra')],"Tier types", required=True), + "gengo_comment":fields.text("comments"), + "gengo_auto_approve":fields.boolean("Active"), + "fields_ids":fields.many2many('ir.model.fields','fields_company_rel','field_id','model_id'), + + } + From 99f81a5d9723f931b2963dd1b26e673cd023457f Mon Sep 17 00:00:00 2001 From: "Twinkle Christian (OpenERP)" Date: Fri, 13 Jul 2012 18:38:03 +0530 Subject: [PATCH 05/62] [IMP]Adding .py files in base_gengo module bzr revid: tch@tinyerp.com-20120713130803-slnbqdvlc9ypf14a --- addons/base_gengo/ir_translation.py | 7 ++----- addons/base_gengo/res_company.py | 7 ++----- 2 files changed, 4 insertions(+), 10 deletions(-) diff --git a/addons/base_gengo/ir_translation.py b/addons/base_gengo/ir_translation.py index 7160d102970..053f72f5c2c 100644 --- a/addons/base_gengo/ir_translation.py +++ b/addons/base_gengo/ir_translation.py @@ -19,12 +19,9 @@ # ############################################################################## -from osv import fields,osv,orm -import os -import openerp -import tools +from osv import fields,osv -class ir_translation(osv.osv): +class ir_translation(osv.Model): _name = "ir.translation" _description="Translation" _inherit="ir.translation" diff --git a/addons/base_gengo/res_company.py b/addons/base_gengo/res_company.py index 1fa07bb65e2..81ef413dbe0 100644 --- a/addons/base_gengo/res_company.py +++ b/addons/base_gengo/res_company.py @@ -19,12 +19,9 @@ # ############################################################################## -from osv import fields,osv,orm -import os -import openerp -import tools +from osv import fields,osv -class res_company(osv.osv): +class res_company(osv.Model): _name = "res.company" _description = "companies" _inherit = "res.company" From be6cb0c3cab8d52e86171d441ed5cc2cd41d625b Mon Sep 17 00:00:00 2001 From: "ajay javiya (OpenERP)" Date: Mon, 16 Jul 2012 18:11:35 +0530 Subject: [PATCH 06/62] [IMP]: Improve in base_gengo module bzr revid: aja@tinyerp.com-20120716124135-k2gyo052r460c3fv --- addons/base_gengo/__openerp__.py | 4 +-- addons/base_gengo/ir_translation.py | 3 +-- addons/base_gengo/ir_translation.xml | 21 ++++++++++++++- addons/base_gengo/res_company.py | 12 +++++---- addons/base_gengo/res_company_view.xml | 37 ++++++++++++++++++++++++++ 5 files changed, 67 insertions(+), 10 deletions(-) create mode 100644 addons/base_gengo/res_company_view.xml diff --git a/addons/base_gengo/__openerp__.py b/addons/base_gengo/__openerp__.py index 4f1d296f856..7afc573b0ca 100644 --- a/addons/base_gengo/__openerp__.py +++ b/addons/base_gengo/__openerp__.py @@ -18,7 +18,6 @@ # along with this program. If not, see . # ############################################################################## - { 'name': 'Automated Translations through Gengo API', 'version': '0.1', @@ -31,7 +30,8 @@ Automated Translations through Gengo API 'depends': ['base'], 'init_xml': [], 'update_xml': [ - 'ir_translation.xml' + 'ir_translation.xml', + 'res_company_view.xml' ], 'demo_xml': [], 'test': [], diff --git a/addons/base_gengo/ir_translation.py b/addons/base_gengo/ir_translation.py index 053f72f5c2c..46d48af87de 100644 --- a/addons/base_gengo/ir_translation.py +++ b/addons/base_gengo/ir_translation.py @@ -26,10 +26,9 @@ class ir_translation(osv.Model): _description="Translation" _inherit="ir.translation" _columns = { - 'gengo_comment':fields.text("comments", help="Comment for translators"), + 'gengo_comment':fields.text("Comments"), 'gengo_translation':fields.boolean("Translation", help='This term has to be translated by Gengo automatically'), 'gengo_control':fields.boolean('Active'), - } _defaults = { diff --git a/addons/base_gengo/ir_translation.xml b/addons/base_gengo/ir_translation.xml index 72c6f99730d..52b081cd7d6 100644 --- a/addons/base_gengo/ir_translation.xml +++ b/addons/base_gengo/ir_translation.xml @@ -9,9 +9,28 @@ - + + + + + ir.translation.form.inherit + + ir.translation + form + + + + + + + + + + + + diff --git a/addons/base_gengo/res_company.py b/addons/base_gengo/res_company.py index 81ef413dbe0..ddfb68f7141 100644 --- a/addons/base_gengo/res_company.py +++ b/addons/base_gengo/res_company.py @@ -23,7 +23,7 @@ from osv import fields,osv class res_company(osv.Model): _name = "res.company" - _description = "companies" + _description = "Companies" _inherit = "res.company" _columns = { "gengo_private_key":fields.text("Gengo private key"), @@ -33,8 +33,10 @@ class res_company(osv.Model): ('pro','Pro'), ('ultra','Ultra')],"Tier types", required=True), "gengo_comment":fields.text("comments"), - "gengo_auto_approve":fields.boolean("Active"), - "fields_ids":fields.many2many('ir.model.fields','fields_company_rel','field_id','model_id'), - + "gengo_auto_approve":fields.boolean("Active",help="Jobs are Automatically Approved by Gengo."), + "fields_ids":fields.many2many('ir.model.fields','fields_company_rel','field_id','model_id','fields'), + } + + _defaults={ + "gengo_tier":"machine", } - diff --git a/addons/base_gengo/res_company_view.xml b/addons/base_gengo/res_company_view.xml new file mode 100644 index 00000000000..a4f6ceffcce --- /dev/null +++ b/addons/base_gengo/res_company_view.xml @@ -0,0 +1,37 @@ + + + + + + res.company.form.inherit + + res.company + form + + + + + + + + + + + + + + + + + + + + + + + + + + + + From 70e73559d2f91e54215f6a2de779dce8a0f0580d Mon Sep 17 00:00:00 2001 From: "ajay javiya (OpenERP)" Date: Mon, 16 Jul 2012 18:36:51 +0530 Subject: [PATCH 07/62] [IMP]: change license in base_gengo module bzr revid: aja@tinyerp.com-20120716130651-qk7z3c1uaypjr9z4 --- addons/base_gengo/__init__.py | 6 ------ addons/base_gengo/ir_translation.py | 4 ++-- addons/base_gengo/res_company.py | 4 ++-- 3 files changed, 4 insertions(+), 10 deletions(-) diff --git a/addons/base_gengo/__init__.py b/addons/base_gengo/__init__.py index e1537d7ab27..ca798adebee 100644 --- a/addons/base_gengo/__init__.py +++ b/addons/base_gengo/__init__.py @@ -22,10 +22,4 @@ import res_company import ir_translation - - - - - - # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: diff --git a/addons/base_gengo/ir_translation.py b/addons/base_gengo/ir_translation.py index 46d48af87de..a658b935c93 100644 --- a/addons/base_gengo/ir_translation.py +++ b/addons/base_gengo/ir_translation.py @@ -1,8 +1,8 @@ # -*- coding: utf-8 -*- ############################################################################## # -# OpenERP, Open Source Management Solution -# Copyright (C) 2004-2010 Tiny SPRL (). +# OpenERP, Open Source Business Applications +# Copyright (C) 2004-2012 OpenERP S.A. (). # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as diff --git a/addons/base_gengo/res_company.py b/addons/base_gengo/res_company.py index ddfb68f7141..2a91d13f1b1 100644 --- a/addons/base_gengo/res_company.py +++ b/addons/base_gengo/res_company.py @@ -1,8 +1,8 @@ # -*- coding: utf-8 -*- ############################################################################## # -# OpenERP, Open Source Management Solution -# Copyright (C) 2004-2010 Tiny SPRL (). +# OpenERP, Open Source Business Applications +# Copyright (C) 2004-2012 OpenERP S.A. (). # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as From 28124a66f682faaecdfe6cf4db47f68d0af27bfd Mon Sep 17 00:00:00 2001 From: Fabien Pinckaers Date: Mon, 16 Jul 2012 22:35:12 +0200 Subject: [PATCH 08/62] [IMP] better form view: users, modules, preferences, wizards bzr revid: fp@tinyerp.com-20120716203512-ic75m4qys1v0kid6 --- .../base/ir/wizard/wizard_menu_view.xml | 10 ++--- openerp/addons/base/module/module.py | 2 + openerp/addons/base/module/module_view.xml | 36 +++++++-------- .../wizard/base_export_language_view.xml | 45 +++++++------------ .../wizard/base_import_language_view.xml | 10 ++--- .../wizard/base_language_install_view.xml | 44 +++++++----------- .../wizard/base_module_configuration_view.xml | 6 +-- .../module/wizard/base_module_import_view.xml | 35 +++++---------- .../module/wizard/base_module_scan_view.xml | 6 +-- .../module/wizard/base_module_update_view.xml | 34 +++++--------- .../wizard/base_module_upgrade_view.xml | 18 ++++---- .../wizard/base_update_translations_view.xml | 19 +++----- openerp/addons/base/res/res_users_view.xml | 19 +++----- 13 files changed, 109 insertions(+), 175 deletions(-) diff --git a/openerp/addons/base/ir/wizard/wizard_menu_view.xml b/openerp/addons/base/ir/wizard/wizard_menu_view.xml index 58bd98ef785..9f5d912ed1a 100644 --- a/openerp/addons/base/ir/wizard/wizard_menu_view.xml +++ b/openerp/addons/base/ir/wizard/wizard_menu_view.xml @@ -7,15 +7,15 @@ form -
-
+
+
diff --git a/openerp/addons/base/module/module.py b/openerp/addons/base/module/module.py index 392850f7b77..dba1962ae26 100644 --- a/openerp/addons/base/module/module.py +++ b/openerp/addons/base/module/module.py @@ -80,6 +80,7 @@ class module_category(osv.osv): class module(osv.osv): _name = "ir.module.module" + _rec_name = "shortdesc" _description = "Module" @classmethod @@ -177,6 +178,7 @@ class module(osv.osv): 'name': fields.char("Technical Name", size=128, readonly=True, required=True, select=True), 'category_id': fields.many2one('ir.module.category', 'Category', readonly=True, select=True), 'shortdesc': fields.char('Module Name', size=256, readonly=True, translate=True), + 'summary': fields.char('Summary', size=256, readonly=True, translate=True), 'description': fields.text("Description", readonly=True, translate=True), 'author': fields.char("Author", size=128, readonly=True), 'maintainer': fields.char('Maintainer', size=128, readonly=True), diff --git a/openerp/addons/base/module/module_view.xml b/openerp/addons/base/module/module_view.xml index a9f3620fb57..5624c8ff58c 100644 --- a/openerp/addons/base/module/module_view.xml +++ b/openerp/addons/base/module/module_view.xml @@ -113,36 +113,32 @@ form
-
-
-
- -
+

-

+

+
+ + + + + - - - - - + @@ -150,7 +146,9 @@ + +