From 3161713bea39e3dc1458ab1a869b9a956494f2af Mon Sep 17 00:00:00 2001 From: "ron@tinyerp.com" <> Date: Fri, 15 Jul 2011 18:12:38 +0530 Subject: [PATCH 001/233] [ADD]l10n_multilang:One of the existing problem of localization modules is that it doesnot allow you to translate the objects name So Add the tags translate=True on journal name, account name, account type ,account Tax, Templates.. bzr revid: ron@tinyerp.com-20110715124238-0pm6xakc7io3p3mg --- addons/l10n_multilang/__init__.py | 24 ++++++ addons/l10n_multilang/__openerp__.py | 49 +++++++++++ addons/l10n_multilang/account.py | 117 +++++++++++++++++++++++++++ 3 files changed, 190 insertions(+) create mode 100644 addons/l10n_multilang/__init__.py create mode 100644 addons/l10n_multilang/__openerp__.py create mode 100644 addons/l10n_multilang/account.py diff --git a/addons/l10n_multilang/__init__.py b/addons/l10n_multilang/__init__.py new file mode 100644 index 00000000000..0aea333e9a9 --- /dev/null +++ b/addons/l10n_multilang/__init__.py @@ -0,0 +1,24 @@ +# -*- 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 . +# +############################################################################## + +import account + +# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: \ No newline at end of file diff --git a/addons/l10n_multilang/__openerp__.py b/addons/l10n_multilang/__openerp__.py new file mode 100644 index 00000000000..e854aab8221 --- /dev/null +++ b/addons/l10n_multilang/__openerp__.py @@ -0,0 +1,49 @@ +# -*- 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" : "Belgium - Multi language Chart of Accounts (en/nl/fr)", + "version" : "1.1", + "author" : "OpenERP SA", + "category": 'Localization/Account Charts', + "description": """ + Belgian localisation (on top of l10n_be): + * Multilanguage support (en/nl/fr) for Chart of Accounts, Taxes, Tax Codes and Journals + * Multilingual accounting templates + * Multilanguage support Analytic Chart of Accounts and Analytic Journals + * Update partner titles for commonly used legal entities + * Add constraint to ensure unique Tax Code per Company + * Setup wizard changes + - Copy translations for CoA, Tax, Tax Code and Fiscal Position from templates to target objects + - Add options to install the nl and fr languages during the setup + - Generate Financial Journals from the templates + """, + 'website': 'http://www.openerp.com', + 'init_xml': [], + "depends" : ['account_accountant','l10n_be'], + 'update_xml': [ + ], + 'demo_xml': [ + ], + 'installable': True, + 'active': False, +} +# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: diff --git a/addons/l10n_multilang/account.py b/addons/l10n_multilang/account.py new file mode 100644 index 00000000000..46e5a2d63e7 --- /dev/null +++ b/addons/l10n_multilang/account.py @@ -0,0 +1,117 @@ +# -*- 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 +from tools.translate import _ + + +class account_account_template(osv.osv): + _inherit = 'account.account.template' + _columns = { + 'name': fields.char('Name', size=128, required=True, select=True, translate=True), + } +account_account_template() + + +class account_account(osv.osv): + _inherit = 'account.account' + _columns = { + 'name': fields.char('Name', size=128, required=True, select=True, translate=True), + } +account_account() + + +class account_tax_code(osv.osv): + _inherit = 'account.tax.code' + _sql_constraints = [ + ('code_company_uniq', 'unique (code,company_id)', 'The code of the Tax Case must be unique per company !') + ] +account_tax_code() + + +class account_tax_template(osv.osv): + _inherit = 'account.tax.template' + _columns = { + 'name': fields.char('Tax Name', size=128, required=True, select=True, translate=True), + } +account_tax_template() + + +class account_tax_code_template(osv.osv): + _inherit = 'account.tax.code.template' + _columns = { + 'name': fields.char('Tax Case Name', size=64, required=True, translate=True), + } +account_tax_code_template() + + +class account_chart_template(osv.osv): + _inherit = 'account.chart.template' + _columns={ + 'name': fields.char('Name', size=64, required=True, translate=True), + 'bank_from_template':fields.boolean('Banks/Cash from Template', help="Generate Bank/Cash accounts and journals from the Templates."), + } + _defaults = { + 'bank_from_template': False, + } + _order = 'name' +account_chart_template() + + +class account_fiscal_position(osv.osv): + _inherit = 'account.fiscal.position' + _columns = { + 'name': fields.char('Fiscal Position', size=64, required=True, translate=True), + } +account_fiscal_position() + + +class account_fiscal_position_template(osv.osv): + _inherit = 'account.fiscal.position.template' + _columns = { + 'name': fields.char('Fiscal Position Template', size=64, required=True, translate=True), + } +account_fiscal_position_template() + + +class account_journal(osv.osv): + _inherit = 'account.journal' + _columns = { + 'name': fields.char('Journal Name', size=64, required=True, translate=True), + } +account_journal() + + +class account_analytic_account(osv.osv): + _inherit = 'account.analytic.account' + _columns = { + 'name': fields.char('Account Name', size=128, required=True, translate=True), + } +account_analytic_account() + + +class account_analytic_journal(osv.osv): + _inherit = 'account.analytic.journal' + _columns = { + 'name': fields.char('Journal Name', size=64, required=True, translate=True), + } +account_analytic_journal() From 57507520a1ad208e7fe17fdba6cc09143bbc9176 Mon Sep 17 00:00:00 2001 From: "ron@tinyerp.com" <> Date: Mon, 18 Jul 2011 10:02:59 +0530 Subject: [PATCH 002/233] [IMP]Account:remove Account code unique constraint bzr revid: ron@tinyerp.com-20110718043259-0o9qvuv9sj3hiceu --- addons/l10n_multilang/account.py | 8 -------- 1 file changed, 8 deletions(-) diff --git a/addons/l10n_multilang/account.py b/addons/l10n_multilang/account.py index 46e5a2d63e7..f0583c13b53 100644 --- a/addons/l10n_multilang/account.py +++ b/addons/l10n_multilang/account.py @@ -40,14 +40,6 @@ class account_account(osv.osv): account_account() -class account_tax_code(osv.osv): - _inherit = 'account.tax.code' - _sql_constraints = [ - ('code_company_uniq', 'unique (code,company_id)', 'The code of the Tax Case must be unique per company !') - ] -account_tax_code() - - class account_tax_template(osv.osv): _inherit = 'account.tax.template' _columns = { From 6c4c1c78fd5aaf7eea441d0054b1021e96ac02e9 Mon Sep 17 00:00:00 2001 From: "ron@tinyerp.com" <> Date: Mon, 18 Jul 2011 18:17:15 +0530 Subject: [PATCH 003/233] [IMP]Account:Fixed=>Module name and description,remove dependency of l10n_be,remove unnessasary variable,missing object bzr revid: ron@tinyerp.com-20110718124715-b4rwn30rh3mphef0 --- addons/l10n_multilang/__openerp__.py | 8 ++++---- addons/l10n_multilang/account.py | 12 ++++++++---- 2 files changed, 12 insertions(+), 8 deletions(-) diff --git a/addons/l10n_multilang/__openerp__.py b/addons/l10n_multilang/__openerp__.py index e854aab8221..b2b4c563dde 100644 --- a/addons/l10n_multilang/__openerp__.py +++ b/addons/l10n_multilang/__openerp__.py @@ -20,25 +20,25 @@ ############################################################################## { - "name" : "Belgium - Multi language Chart of Accounts (en/nl/fr)", + "name" : "Belgium - Multi language Chart of Accounts", "version" : "1.1", "author" : "OpenERP SA", "category": 'Localization/Account Charts', "description": """ Belgian localisation (on top of l10n_be): - * Multilanguage support (en/nl/fr) for Chart of Accounts, Taxes, Tax Codes and Journals + * Multilanguage support for Chart of Accounts, Taxes, Tax Codes and Journals * Multilingual accounting templates * Multilanguage support Analytic Chart of Accounts and Analytic Journals * Update partner titles for commonly used legal entities * Add constraint to ensure unique Tax Code per Company * Setup wizard changes - Copy translations for CoA, Tax, Tax Code and Fiscal Position from templates to target objects - - Add options to install the nl and fr languages during the setup + - Add options to install languages during the setup - Generate Financial Journals from the templates """, 'website': 'http://www.openerp.com', 'init_xml': [], - "depends" : ['account_accountant','l10n_be'], + "depends" : ['account_accountant'], 'update_xml': [ ], 'demo_xml': [ diff --git a/addons/l10n_multilang/account.py b/addons/l10n_multilang/account.py index f0583c13b53..f4d2c1bb78d 100644 --- a/addons/l10n_multilang/account.py +++ b/addons/l10n_multilang/account.py @@ -40,6 +40,14 @@ class account_account(osv.osv): account_account() +class account_tax(osv.osv): + _inherit = 'account.tax' + _columns = { + 'name': fields.char('Tax Name', size=128, required=True, select=True, translate=True), + } +account_tax() + + class account_tax_template(osv.osv): _inherit = 'account.tax.template' _columns = { @@ -60,10 +68,6 @@ class account_chart_template(osv.osv): _inherit = 'account.chart.template' _columns={ 'name': fields.char('Name', size=64, required=True, translate=True), - 'bank_from_template':fields.boolean('Banks/Cash from Template', help="Generate Bank/Cash accounts and journals from the Templates."), - } - _defaults = { - 'bank_from_template': False, } _order = 'name' account_chart_template() From 2ca78132ea89f7b0502a75056988981ecd93d344 Mon Sep 17 00:00:00 2001 From: "ron@tinyerp.com" <> Date: Mon, 18 Jul 2011 18:55:29 +0530 Subject: [PATCH 004/233] [IMP]Account:Improvement in Desription bzr revid: ron@tinyerp.com-20110718132529-9o3vusrrjzqtmn9q --- addons/l10n_multilang/__openerp__.py | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/addons/l10n_multilang/__openerp__.py b/addons/l10n_multilang/__openerp__.py index b2b4c563dde..b4391e2c8f0 100644 --- a/addons/l10n_multilang/__openerp__.py +++ b/addons/l10n_multilang/__openerp__.py @@ -25,16 +25,12 @@ "author" : "OpenERP SA", "category": 'Localization/Account Charts', "description": """ - Belgian localisation (on top of l10n_be): * Multilanguage support for Chart of Accounts, Taxes, Tax Codes and Journals - * Multilingual accounting templates + * Multilanguage accounting templates * Multilanguage support Analytic Chart of Accounts and Analytic Journals - * Update partner titles for commonly used legal entities - * Add constraint to ensure unique Tax Code per Company * Setup wizard changes - Copy translations for CoA, Tax, Tax Code and Fiscal Position from templates to target objects - Add options to install languages during the setup - - Generate Financial Journals from the templates """, 'website': 'http://www.openerp.com', 'init_xml': [], From d6b0a13e14070d92cc2ce36958c1e8e4e16d0b28 Mon Sep 17 00:00:00 2001 From: "ron@tinyerp.com" <> Date: Mon, 18 Jul 2011 19:08:22 +0530 Subject: [PATCH 005/233] [IMP]Account:Improvments in Description bzr revid: ron@tinyerp.com-20110718133822-fgz05pasp03im1jz --- addons/l10n_multilang/__openerp__.py | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/addons/l10n_multilang/__openerp__.py b/addons/l10n_multilang/__openerp__.py index b4391e2c8f0..a63e853ae10 100644 --- a/addons/l10n_multilang/__openerp__.py +++ b/addons/l10n_multilang/__openerp__.py @@ -20,16 +20,15 @@ ############################################################################## { - "name" : "Belgium - Multi language Chart of Accounts", + "name" : "Multi language Chart of Accounts", "version" : "1.1", "author" : "OpenERP SA", "category": 'Localization/Account Charts', "description": """ - * Multilanguage support for Chart of Accounts, Taxes, Tax Codes and Journals - * Multilanguage accounting templates - * Multilanguage support Analytic Chart of Accounts and Analytic Journals + * Multilanguage support for Chart of Accounts, Taxes, Tax Codes , Journals, Accounting Templates, + Analytic Chart of Accounts and Analytic Journals * Setup wizard changes - - Copy translations for CoA, Tax, Tax Code and Fiscal Position from templates to target objects + - Copy translations for COA, Tax, Tax Code and Fiscal Position from templates to target objects - Add options to install languages during the setup """, 'website': 'http://www.openerp.com', From 028375c83f11186961a75ca0d88dbb55f0cc9942 Mon Sep 17 00:00:00 2001 From: "ron@tinyerp.com" <> Date: Wed, 20 Jul 2011 11:09:06 +0530 Subject: [PATCH 006/233] [IMP]Account:Improvement in wizard.multi.charts.accounts all fields have default used that is converted to default_get method bzr revid: ron@tinyerp.com-20110720053906-px9u1o3sfz4phq4q --- addons/account/account.py | 62 +++++++++++++++++---------------------- 1 file changed, 27 insertions(+), 35 deletions(-) diff --git a/addons/account/account.py b/addons/account/account.py index aced4041f13..a44ca2a8b5b 100644 --- a/addons/account/account.py +++ b/addons/account/account.py @@ -2650,44 +2650,36 @@ class wizard_multi_charts_accounts(osv.osv_memory): res['value']["purchase_tax"] = purchase_tax_ids and purchase_tax_ids[0] or False return res - def _get_purchase_tax(self, cr, uid, context=None): + + def default_get(self, cr, uid, fields, context=None): + res = super(wizard_multi_charts_accounts, self).default_get(cr, uid, fields, context=context) + tax_templ_obj = self.pool.get('account.tax.template') + + if 'bank_accounts_id' in fields: + res.update({'bank_accounts_id': [{'acc_name': _('Current'), 'account_type': 'bank'}, + {'acc_name': _('Deposit'), 'account_type': 'bank'}, + {'acc_name': _('Cash'), 'account_type': 'cash'}]}) + if 'company_id' in fields: + res.update({'company_id': self.pool.get('res.users').browse(cr, uid, [uid], context=context)[0].company_id.id}) + if 'code_digits' in fields: + res.update({'code_digits': 6}) + if 'seq_journal' in fields: + res.update({'seq_journal': True}) + ids = self.pool.get('account.chart.template').search(cr, uid, [], context=context) if ids: - chart_template_id = ids[0] - purchase_tax_ids = self.pool.get('account.tax.template').search(cr, uid, [("chart_template_id" - , "=", chart_template_id), ('type_tax_use', 'in', ('purchase','all'))], order="sequence") - return purchase_tax_ids and purchase_tax_ids[0] or False - return False + sale_tax_ids = tax_templ_obj.search(cr, uid, [("chart_template_id" + , "=", ids[0]), ('type_tax_use', 'in', ('sale','all'))], order="sequence") + purchase_tax_ids = tax_templ_obj.search(cr, uid, [("chart_template_id" + , "=", ids[0]), ('type_tax_use', 'in', ('purchase','all'))], order="sequence") + if 'chart_template_id' in fields: + res.update({'chart_template_id':ids[0]}) + if 'sale_tax' in fields: + res.update({'sale_tax': sale_tax_ids and sale_tax_ids[0] or False}) + if 'purchase_tax' in fields: + res.update({'purchase_tax': purchase_tax_ids and purchase_tax_ids[0] or False}) - def _get_sale_tax(self, cr, uid, context=None): - ids = self.pool.get('account.chart.template').search(cr, uid, [], context=context) - if ids: - chart_template_id = ids[0] - sale_tax_ids = self.pool.get('account.tax.template').search(cr, uid, [("chart_template_id" - , "=", chart_template_id), ('type_tax_use', 'in', ('sale','all'))], order="sequence") - return sale_tax_ids and sale_tax_ids[0] or False - return False - - def _get_chart(self, cr, uid, context=None): - ids = self.pool.get('account.chart.template').search(cr, uid, [], context=context) - if ids: - return ids[0] - return False - - def _get_default_accounts(self, cr, uid, context=None): - return [{'acc_name': _('Current'),'account_type':'bank'}, - {'acc_name': _('Deposit'),'account_type':'bank'}, - {'acc_name': _('Cash'),'account_type':'cash'}] - - _defaults = { - 'company_id': lambda self, cr, uid, c: self.pool.get('res.users').browse(cr, uid, [uid], c)[0].company_id.id, - 'chart_template_id': _get_chart, - 'bank_accounts_id': _get_default_accounts, - 'sale_tax': _get_sale_tax, - 'purchase_tax': _get_purchase_tax, - 'code_digits': 6, - 'seq_journal': True - } + return res def fields_view_get(self, cr, uid, view_id=None, view_type='form', context=None, toolbar=False, submenu=False): res = super(wizard_multi_charts_accounts, self).fields_view_get(cr, uid, view_id=view_id, view_type=view_type, context=context, toolbar=toolbar,submenu=False) From d07923239f01f8d745ec092b3050485968beea17 Mon Sep 17 00:00:00 2001 From: "ron@tinyerp.com" <> Date: Wed, 20 Jul 2011 11:54:43 +0530 Subject: [PATCH 007/233] [IMP]Account:optimize code of default_get method bzr revid: ron@tinyerp.com-20110720062443-cn65ey46czpd8v54 --- addons/account/account.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/addons/account/account.py b/addons/account/account.py index a44ca2a8b5b..7e413f7a333 100644 --- a/addons/account/account.py +++ b/addons/account/account.py @@ -2668,15 +2668,15 @@ class wizard_multi_charts_accounts(osv.osv_memory): ids = self.pool.get('account.chart.template').search(cr, uid, [], context=context) if ids: - sale_tax_ids = tax_templ_obj.search(cr, uid, [("chart_template_id" - , "=", ids[0]), ('type_tax_use', 'in', ('sale','all'))], order="sequence") - purchase_tax_ids = tax_templ_obj.search(cr, uid, [("chart_template_id" - , "=", ids[0]), ('type_tax_use', 'in', ('purchase','all'))], order="sequence") if 'chart_template_id' in fields: - res.update({'chart_template_id':ids[0]}) + res.update({'chart_template_id': ids[0]}) if 'sale_tax' in fields: + sale_tax_ids = tax_templ_obj.search(cr, uid, [("chart_template_id" + , "=", ids[0]), ('type_tax_use', 'in', ('sale','all'))], order="sequence") res.update({'sale_tax': sale_tax_ids and sale_tax_ids[0] or False}) if 'purchase_tax' in fields: + purchase_tax_ids = tax_templ_obj.search(cr, uid, [("chart_template_id" + , "=", ids[0]), ('type_tax_use', 'in', ('purchase','all'))], order="sequence") res.update({'purchase_tax': purchase_tax_ids and purchase_tax_ids[0] or False}) return res From 7daeb8c47ef60c94dbc7c557dda8d92efa360f4b Mon Sep 17 00:00:00 2001 From: "ron@tinyerp.com" <> Date: Thu, 21 Jul 2011 18:19:11 +0530 Subject: [PATCH 008/233] [IMP]l10n_multilang:Change the Multi wizard configuaration view and Add Language Field on wizard bzr revid: ron@tinyerp.com-20110721124911-h5tyniz8nufsqu1c --- addons/l10n_multilang/__init__.py | 4 +- addons/l10n_multilang/__openerp__.py | 8 +- addons/l10n_multilang/l10n_multilang.py | 44 +++++ addons/l10n_multilang/l10n_multilang.xml | 32 ++++ addons/l10n_multilang/l10n_multilang_test.xml | 161 ++++++++++++++++++ 5 files changed, 244 insertions(+), 5 deletions(-) create mode 100644 addons/l10n_multilang/l10n_multilang.py create mode 100644 addons/l10n_multilang/l10n_multilang.xml create mode 100644 addons/l10n_multilang/l10n_multilang_test.xml diff --git a/addons/l10n_multilang/__init__.py b/addons/l10n_multilang/__init__.py index 0aea333e9a9..446f3beb668 100644 --- a/addons/l10n_multilang/__init__.py +++ b/addons/l10n_multilang/__init__.py @@ -20,5 +20,5 @@ ############################################################################## import account - -# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: \ No newline at end of file +import l10n_multilang +# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: diff --git a/addons/l10n_multilang/__openerp__.py b/addons/l10n_multilang/__openerp__.py index e2c754adb4b..481abb1bf65 100644 --- a/addons/l10n_multilang/__openerp__.py +++ b/addons/l10n_multilang/__openerp__.py @@ -25,16 +25,18 @@ "author" : "OpenERP SA", "category": 'Localization/Account Charts', "description": """ - * Multilanguage support for Chart of Accounts, Taxes, Tax Codes , Journals, Accounting Templates, - Analytic Chart of Accounts and Analytic Journals + * Multi language support for Chart of Accounts, Taxes, Tax Codes , Journals, Accounting Templates, + Analytic Chart of Accounts and Analytic Journals. * Setup wizard changes - - Copy translations for COA, Tax, Tax Code and Fiscal Position from templates to target objects + - Copy translations for COA, Tax, Tax Code and Fiscal Position from templates to target objects. - Add option to install languages during the setup. """, 'website': 'http://www.openerp.com', 'init_xml': [], "depends" : ['account_accountant'], 'update_xml': [ + 'l10n_multilang.xml', + 'l10n_multilang_test.xml' ], 'demo_xml': [ ], diff --git a/addons/l10n_multilang/l10n_multilang.py b/addons/l10n_multilang/l10n_multilang.py new file mode 100644 index 00000000000..f9fab08c216 --- /dev/null +++ b/addons/l10n_multilang/l10n_multilang.py @@ -0,0 +1,44 @@ +# -*- 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 + + +class wizard_multi_charts_accounts(osv.osv_memory): + """ + Change wizard that a new account chart for a company. + * load Default languages + * Replace creation of financial accounts by copy from template. + This change results in adherence to Belgian MAR numbering scheme for cash accounts. + * Create financial journals for each account of type liquidity + """ + _inherit = 'wizard.multi.charts.accounts' + + _columns = { + 'lang_ids': fields.many2many('res.lang', 'res_lang_type_rel', 'wizard_id', 'lang_id', 'Language'), + 'bank_from_template': fields.boolean('Banks/Cash from Template', + help="If True then Generate Bank/Cash accounts and journals from the Templates.", readonly=True), + } + +wizard_multi_charts_accounts() + +# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: diff --git a/addons/l10n_multilang/l10n_multilang.xml b/addons/l10n_multilang/l10n_multilang.xml new file mode 100644 index 00000000000..990407f9462 --- /dev/null +++ b/addons/l10n_multilang/l10n_multilang.xml @@ -0,0 +1,32 @@ + + + + + + 25 + onskip + + + + view.wizard.multi.chart + wizard.multi.charts.accounts + + + + + + + + + + + + {'invisible': [('bank_from_template', '=', False)]} + + + + + + + + diff --git a/addons/l10n_multilang/l10n_multilang_test.xml b/addons/l10n_multilang/l10n_multilang_test.xml new file mode 100644 index 00000000000..b91405cf27f --- /dev/null +++ b/addons/l10n_multilang/l10n_multilang_test.xml @@ -0,0 +1,161 @@ + + + + + + + + + special + + + + + + + Receivable + receivable + income + unreconciled + + + + Payable + payable + expense + unreconciled + + + + Asset View + asset + asset + + + + View + view + none + + + + Liability View + liability + liability + + + + Asset View + asset + asset + + + + + + Chart of Account A + 0 + view + + + + + + Balance Sheet + A00 + view + + + + + + + Profit and Loss + A01 + view + + + + + + + A0011 + Bank Account + + view + + + + + + Tax Template Root A + + + + Tax 001 A + + + + + Tax 002 A + + + + + + + Assets B + B00012 + view + + + + + + + Liabilities B + B00014 + view + + + + + + + Income B + B00021 + view + + + + + + + Expense B + B00024 + view + + + + + + + + + Demo Chart A + + + + + + + Demo Chart B + + + + + + + + + From a21478fde26e953e1ef84fa50a7925c698e63132 Mon Sep 17 00:00:00 2001 From: "ron@tinyerp.com" <> Date: Fri, 22 Jul 2011 12:37:41 +0530 Subject: [PATCH 009/233] [IMP]Account:Add parent_id field in Account.chart.template and Bank Account,Root Account ,Root Tax required when there is no parent bzr revid: ron@tinyerp.com-20110722070741-dxfzs55wlhgoq4wz --- addons/account/account.py | 1 + addons/account/account_view.xml | 7 ++++--- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/addons/account/account.py b/addons/account/account.py index 7e413f7a333..216c48ddb1b 100644 --- a/addons/account/account.py +++ b/addons/account/account.py @@ -2475,6 +2475,7 @@ class account_chart_template(osv.osv): _columns={ 'name': fields.char('Name', size=64, required=True), + 'parent_id': fields.many2one('account.chart.template', 'Parent Chart Template'), 'account_root_id': fields.many2one('account.account.template','Root Account',required=True,domain=[('parent_id','=',False)]), 'tax_code_root_id': fields.many2one('account.tax.code.template','Root Tax Code',required=True,domain=[('parent_id','=',False)]), 'tax_template_ids': fields.one2many('account.tax.template', 'chart_template_id', 'Tax Template List', help='List of all the taxes that have to be installed by the wizard'), diff --git a/addons/account/account_view.xml b/addons/account/account_view.xml index d3d54a51918..aa0c7ae0c87 100644 --- a/addons/account/account_view.xml +++ b/addons/account/account_view.xml @@ -2141,9 +2141,10 @@
- - - + + + + From b5f41c1cc7e8b645d86e0accc4ac6f4d86d262f9 Mon Sep 17 00:00:00 2001 From: "ron@tinyerp.com" <> Date: Fri, 22 Jul 2011 14:04:14 +0530 Subject: [PATCH 010/233] [IMP] account: l10n_multilang: 1)Get Default language on Language field 2)onchange on Template at that time languages change accordingly bzr revid: ron@tinyerp.com-20110722083414-8qzizw2fe1a8rxol --- addons/l10n_multilang/l10n_multilang.py | 32 ++++++++++++++++++++++++ addons/l10n_multilang/l10n_multilang.xml | 2 +- 2 files changed, 33 insertions(+), 1 deletion(-) diff --git a/addons/l10n_multilang/l10n_multilang.py b/addons/l10n_multilang/l10n_multilang.py index f9fab08c216..0c66ca387d6 100644 --- a/addons/l10n_multilang/l10n_multilang.py +++ b/addons/l10n_multilang/l10n_multilang.py @@ -33,6 +33,38 @@ class wizard_multi_charts_accounts(osv.osv_memory): """ _inherit = 'wizard.multi.charts.accounts' + def onchange_chart_template_id(self, cr, uid, ids, chart_template_id=False, context=None): + res = super(wizard_multi_charts_accounts, self).onchange_chart_template_id(cr, uid, ids, chart_template_id, context=context) + installed_lang = self.get_lang(cr, uid, chart_template_id, context=context) + res['value'].update({'lang_ids': installed_lang}) + return res + + def get_lang(self, cr, uid, template_id=False, context=None): + installed_lang = [] + if template_id: + cr.execute("SELECT module from ir_model_data where model='account.chart.template' and res_id=%s" % (template_id)) + modulename = cr.fetchone() + modulename = modulename and modulename[0] or False + if modulename: + import os + module_obj = self.pool.get('ir.module.module') + module_id = module_obj.search(cr, uid, [('name', '=', modulename)], context=context) + module = module_obj.browse(cr, uid, module_id, context=context)[0] + dirpath = module_obj._translations_subdir(module) + if dirpath: + po_files = os.listdir(dirpath) + for po in po_files: + lang_id = self.pool.get('res.lang').search(cr, uid, [('code', 'ilike', '%s' % (po.split('.')[0])), ('translatable', '=', True)], context=context) + if lang_id: + installed_lang.append(lang_id[0]) + return installed_lang + + def default_get(self, cr, uid, fields, context=None): + res = super(wizard_multi_charts_accounts, self).default_get(cr, uid, fields, context=context) + installed_lang = self.get_lang(cr, uid, res.get('chart_template_id'), context=context) + res.update({'lang_ids': installed_lang, 'bank_accounts_id': []}) + return res + _columns = { 'lang_ids': fields.many2many('res.lang', 'res_lang_type_rel', 'wizard_id', 'lang_id', 'Language'), 'bank_from_template': fields.boolean('Banks/Cash from Template', diff --git a/addons/l10n_multilang/l10n_multilang.xml b/addons/l10n_multilang/l10n_multilang.xml index 990407f9462..7affdb46323 100644 --- a/addons/l10n_multilang/l10n_multilang.xml +++ b/addons/l10n_multilang/l10n_multilang.xml @@ -14,7 +14,7 @@ - + From 4d882e63e19df8558f65f1bc42399d0d1671b8e1 Mon Sep 17 00:00:00 2001 From: "ron@tinyerp.com" <> Date: Fri, 22 Jul 2011 14:29:17 +0530 Subject: [PATCH 011/233] [IMP]: account: l10n fullness and inheritancy:Remove required=True from account_root_id,bank_account_view_id,tax_code_root_id and also optimize the code bzr revid: ron@tinyerp.com-20110722085917-rfnb8w8ycz0otuer --- addons/account/account.py | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/addons/account/account.py b/addons/account/account.py index 216c48ddb1b..09e61a8325a 100644 --- a/addons/account/account.py +++ b/addons/account/account.py @@ -2476,19 +2476,19 @@ class account_chart_template(osv.osv): _columns={ 'name': fields.char('Name', size=64, required=True), 'parent_id': fields.many2one('account.chart.template', 'Parent Chart Template'), - 'account_root_id': fields.many2one('account.account.template','Root Account',required=True,domain=[('parent_id','=',False)]), - 'tax_code_root_id': fields.many2one('account.tax.code.template','Root Tax Code',required=True,domain=[('parent_id','=',False)]), + 'account_root_id': fields.many2one('account.account.template', 'Root Account', domain=[('parent_id','=',False)]), + 'tax_code_root_id': fields.many2one('account.tax.code.template', 'Root Tax Code', domain=[('parent_id','=',False)]), 'tax_template_ids': fields.one2many('account.tax.template', 'chart_template_id', 'Tax Template List', help='List of all the taxes that have to be installed by the wizard'), - 'bank_account_view_id': fields.many2one('account.account.template','Bank Account',required=True), - 'property_account_receivable': fields.many2one('account.account.template','Receivable Account'), - 'property_account_payable': fields.many2one('account.account.template','Payable Account'), - 'property_account_expense_categ': fields.many2one('account.account.template','Expense Category Account'), - 'property_account_income_categ': fields.many2one('account.account.template','Income Category Account'), - 'property_account_expense': fields.many2one('account.account.template','Expense Account on Product Template'), - 'property_account_income': fields.many2one('account.account.template','Income Account on Product Template'), + 'bank_account_view_id': fields.many2one('account.account.template', 'Bank Account'), + 'property_account_receivable': fields.many2one('account.account.template', 'Receivable Account'), + 'property_account_payable': fields.many2one('account.account.template', 'Payable Account'), + 'property_account_expense_categ': fields.many2one('account.account.template', 'Expense Category Account'), + 'property_account_income_categ': fields.many2one('account.account.template', 'Income Category Account'), + 'property_account_expense': fields.many2one('account.account.template', 'Expense Account on Product Template'), + 'property_account_income': fields.many2one('account.account.template', 'Income Account on Product Template'), 'property_reserve_and_surplus_account': fields.many2one('account.account.template', 'Reserve and Profit/Loss Account', domain=[('type', '=', 'payable')], help='This Account is used for transferring Profit/Loss(If It is Profit: Amount will be added, Loss: Amount will be deducted.), Which is calculated from Profilt & Loss Report'), - 'property_account_income_opening': fields.many2one('account.account.template','Opening Entries Income Account'), - 'property_account_expense_opening': fields.many2one('account.account.template','Opening Entries Expense Account'), + 'property_account_income_opening': fields.many2one('account.account.template', 'Opening Entries Income Account'), + 'property_account_expense_opening': fields.many2one('account.account.template', 'Opening Entries Expense Account'), } account_chart_template() From aa245d62fa3fc461ecc7dcc0fa5241a7f69b5920 Mon Sep 17 00:00:00 2001 From: "Rucha (Open ERP)" Date: Fri, 22 Jul 2011 16:24:04 +0530 Subject: [PATCH 012/233] [REM]: l10n_multilang: Removed undefined onchange on COA template wizard bzr revid: rpa@tinyerp.com-20110722105404-4cxq8vn97atmu0jm --- addons/l10n_multilang/l10n_multilang.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/l10n_multilang/l10n_multilang.xml b/addons/l10n_multilang/l10n_multilang.xml index e4809aaa27f..7ad10f487db 100644 --- a/addons/l10n_multilang/l10n_multilang.xml +++ b/addons/l10n_multilang/l10n_multilang.xml @@ -9,7 +9,7 @@ - + From f9826a7f3c6c6afdaf9bc8a1c0d9d9ffd27af387 Mon Sep 17 00:00:00 2001 From: "ron@tinyerp.com" <> Date: Mon, 25 Jul 2011 11:09:34 +0530 Subject: [PATCH 013/233] [IMP] account: l10n_multilang: Copy Translation from Account Template to Destination object bzr revid: ron@tinyerp.com-20110725053934-zcbki8m3wyt4ilux --- addons/l10n_multilang/l10n_multilang.py | 77 ++++++++++++++++++++++++ addons/l10n_multilang/l10n_multilang.xml | 5 ++ 2 files changed, 82 insertions(+) diff --git a/addons/l10n_multilang/l10n_multilang.py b/addons/l10n_multilang/l10n_multilang.py index 85a19c9fd08..e8e700bd1f6 100644 --- a/addons/l10n_multilang/l10n_multilang.py +++ b/addons/l10n_multilang/l10n_multilang.py @@ -21,6 +21,9 @@ from osv import fields, osv import os +import netsvc + +logger=netsvc.Logger() class wizard_multi_charts_accounts(osv.osv_memory): """ @@ -32,6 +35,80 @@ class wizard_multi_charts_accounts(osv.osv_memory): """ _inherit = 'wizard.multi.charts.accounts' + def copy_translation(self, cr, uid, langs, in_obj, in_field, in_ids, out_obj, out_ids): + done = False + error = False + xlat_obj = self.pool.get('ir.translation') + while not done: + #compare template with Accounts + if len(in_ids) != len(out_ids): + logger.notifyChannel('addons.'+self._name, netsvc.LOG_ERROR, + 'generate translations from template for %s failed (error 1)!' % out_obj._name) + error = True + break + #copy Translation from Source to Destination object + for lang in langs: + cr.execute("SELECT src, value FROM ir_translation " \ + "WHERE name=%s AND type='model' AND lang=%s AND res_id IN %s " \ + "ORDER by res_id", + (in_obj._name + ',' + in_field, lang, tuple(in_ids))) + xlats = cr.fetchall() + #IF there is no Translation Available or missing some Translation + if len(xlats) != len(out_ids): + logger.notifyChannel('addons.'+self._name, netsvc.LOG_ERROR, + 'There is no Translation available for template %s !' % out_obj._name) + error = True + break + for i in range(len(out_ids)): + src = xlats[i][0] + value = xlats[i][1] + out_record = out_obj.browse(cr, uid, out_ids[i]) + #compare with source to destination object name + if getattr(out_record, in_field) != src: + logger.notifyChannel('addons.'+self._name, netsvc.LOG_ERROR, + 'generate translations from template for %s failed (error 3)!' % out_obj._name) + error = True + break + #Copy Translation + xlat_obj.create(cr, uid, { + 'name': out_obj._name + ',' + in_field, + 'type': 'model', + 'res_id': out_record.id, + 'lang': lang, + 'src': src, + 'value': value, + }) + done = True + if error: + raise osv.except_osv(_('Warning!'), + _('The generation of translations from the template for %s failed!' % out_obj._name)) + + def execute(self, cr, uid, ids, context=None): + super(wizard_multi_charts_accounts, self).execute(cr, uid, ids, context=context) + obj_multi = self.browse(cr, uid, ids[0], context=context) + obj_mod = self.pool.get('ir.module.module') + obj_acc_template = self.pool.get('account.account.template') + obj_acc = self.pool.get('account.account') + obj_data = self.pool.get('ir.model.data') + + company_id = obj_multi.company_id.id + acc_template_root_id = obj_multi.chart_template_id.account_root_id.id + acc_root_id = obj_acc.search(cr, uid, [('company_id', '=', company_id), ('parent_id', '=', None)])[0] + + # load languages + langs = [] + for lang in obj_multi.lang_ids: + langs.append(lang.code) + installed_mids = obj_mod.search(cr, uid, [('state', '=', 'installed')]) + for lang in langs: + obj_mod.update_translations(cr, uid, installed_mids, lang) + + # copy account.account translations + in_field = 'name' + in_ids = obj_acc_template.search(cr, uid, [('id', 'child_of', [acc_template_root_id])], order='id')[1:] + out_ids = obj_acc.search(cr, uid, [('id', 'child_of', [acc_root_id])], order='id')[1:] + self.copy_translation(cr, uid, langs, obj_acc_template, in_field, in_ids, obj_acc, out_ids) + def onchange_chart_template_id(self, cr, uid, ids, chart_template_id=False, context=None): res = super(wizard_multi_charts_accounts, self).onchange_chart_template_id(cr, uid, ids, chart_template_id, context=context) installed_lang = self.get_lang(cr, uid, chart_template_id, context=context) diff --git a/addons/l10n_multilang/l10n_multilang.xml b/addons/l10n_multilang/l10n_multilang.xml index 7ad10f487db..71563ce526c 100644 --- a/addons/l10n_multilang/l10n_multilang.xml +++ b/addons/l10n_multilang/l10n_multilang.xml @@ -1,6 +1,11 @@ + + + 25 + onskip + view.wizard.multi.chart From 06726846c4c819cfeafacf6acd9764c153afce2d Mon Sep 17 00:00:00 2001 From: "ron@tinyerp.com" <> Date: Tue, 26 Jul 2011 15:25:18 +0530 Subject: [PATCH 014/233] [ADD] account: l10n_multilang: 1)Add wizard=>to saw warning message 2)Optimize code of copy_translation method 3)checked indentation problems 4)remove Unused variable 5)Improved docstring bzr revid: ron@tinyerp.com-20110726095518-1irmhd3xr8mwfaui --- addons/l10n_multilang/l10n_multilang.py | 141 +++++++++++++---------- addons/l10n_multilang/l10n_multilang.xml | 19 ++- 2 files changed, 101 insertions(+), 59 deletions(-) diff --git a/addons/l10n_multilang/l10n_multilang.py b/addons/l10n_multilang/l10n_multilang.py index e8e700bd1f6..1e7ed1fef87 100644 --- a/addons/l10n_multilang/l10n_multilang.py +++ b/addons/l10n_multilang/l10n_multilang.py @@ -21,70 +21,94 @@ from osv import fields, osv import os -import netsvc +from tools.translate import _ + + +class translate_message(osv.osv_memory): + _name = "translate.message" + _description = "Give Message After Translation completed" + + def default_get(self, cr, uid, fields, context=None): + """ Get default values + @param self: The object pointer. + @param cr: A database cursor + @param uid: ID of the user currently logged in + @param fields: List of fields for default value + @param context: A standard dictionary + @return: Default values of fields + """ + if context is None: + context = {} + res ={} + if context.get('warning'): + if 'message' in fields: + res.update({'message': _(context.get('warning'))}) + return res + + _columns = { + 'message' : fields.text('Message', size=64, readonly=True), + } + +translate_message() -logger=netsvc.Logger() class wizard_multi_charts_accounts(osv.osv_memory): """ Change wizard that a new account chart for a company. - * load Default languages - * Replace creation of financial accounts by copy from template. - This change results in adherence to Belgian MAR numbering scheme for cash accounts. - * Create financial journals for each account of type liquidity + * Add option to install languages during the setup + * Copy translations for COA, Tax, Tax Code and Fiscal Position from templates to target objects. """ _inherit = 'wizard.multi.charts.accounts' - def copy_translation(self, cr, uid, langs, in_obj, in_field, in_ids, out_obj, out_ids): - done = False - error = False + def copy_translations(self, cr, uid, langs, in_obj, in_field, in_ids, out_obj, out_ids, context): + result = {} + if context is None: + context = {} xlat_obj = self.pool.get('ir.translation') - while not done: - #compare template with Accounts - if len(in_ids) != len(out_ids): - logger.notifyChannel('addons.'+self._name, netsvc.LOG_ERROR, - 'generate translations from template for %s failed (error 1)!' % out_obj._name) - error = True - break - #copy Translation from Source to Destination object - for lang in langs: - cr.execute("SELECT src, value FROM ir_translation " \ - "WHERE name=%s AND type='model' AND lang=%s AND res_id IN %s " \ - "ORDER by res_id", - (in_obj._name + ',' + in_field, lang, tuple(in_ids))) - xlats = cr.fetchall() - #IF there is no Translation Available or missing some Translation - if len(xlats) != len(out_ids): - logger.notifyChannel('addons.'+self._name, netsvc.LOG_ERROR, - 'There is no Translation available for template %s !' % out_obj._name) - error = True - break - for i in range(len(out_ids)): - src = xlats[i][0] - value = xlats[i][1] - out_record = out_obj.browse(cr, uid, out_ids[i]) - #compare with source to destination object name - if getattr(out_record, in_field) != src: - logger.notifyChannel('addons.'+self._name, netsvc.LOG_ERROR, - 'generate translations from template for %s failed (error 3)!' % out_obj._name) - error = True - break - #Copy Translation + #find the source from Account Template + result = [(x.id, x.name) for x in in_obj.browse(cr, uid, in_ids)] + src = dict(result) + message = '' + for lang in langs: + notdone = [] + #find the value from Translation + value = xlat_obj._get_ids(cr, uid, in_obj._name + ',' + in_field, 'model', lang, in_ids) + for j in range(len(in_ids)): + in_id = in_ids[j] + if not value[in_id]: + # if source have no translation available + notdone.append(src[in_id]) + else: + #copy Translation from Source to Destination object xlat_obj.create(cr, uid, { - 'name': out_obj._name + ',' + in_field, - 'type': 'model', - 'res_id': out_record.id, - 'lang': lang, - 'src': src, - 'value': value, - }) - done = True - if error: - raise osv.except_osv(_('Warning!'), - _('The generation of translations from the template for %s failed!' % out_obj._name)) - + 'name': out_obj._name + ',' + in_field, + 'type': 'model', + 'res_id': out_ids[j], + 'lang': lang, + 'src': src[in_id], + 'value': value, + }) + if notdone: + message += '\nLanguage:-%s \n\tThere is no translation available for following accounts: \n\t%s '\ + % (lang, '\n\t'.join(notdone)) + else: + message += '\nLanguage:-%s \n\tTranslation successfully done.' % (lang) + resource_id = self.pool.get('ir.model.data').get_object_reference(cr, uid, 'l10n_multilang', 'view_translate_message_wizard') + #open new wizard its for saw warning message + if message: + context.update({'warning': message}) + return { + 'view_type': 'form', + 'view_mode': 'form', + 'res_model': 'translate.message', + 'views': [(resource_id and resource_id[1] or False,'form')], + 'type': 'ir.actions.act_window', + 'target': 'new', + 'context': context + } + def execute(self, cr, uid, ids, context=None): - super(wizard_multi_charts_accounts, self).execute(cr, uid, ids, context=context) + res = super(wizard_multi_charts_accounts, self).execute(cr, uid, ids, context=context) obj_multi = self.browse(cr, uid, ids[0], context=context) obj_mod = self.pool.get('ir.module.module') obj_acc_template = self.pool.get('account.account.template') @@ -97,17 +121,18 @@ class wizard_multi_charts_accounts(osv.osv_memory): # load languages langs = [] + installed_mids = obj_mod.search(cr, uid, [('state', '=', 'installed')]) for lang in obj_multi.lang_ids: langs.append(lang.code) - installed_mids = obj_mod.search(cr, uid, [('state', '=', 'installed')]) - for lang in langs: - obj_mod.update_translations(cr, uid, installed_mids, lang) + obj_mod.update_translations(cr, uid, installed_mids, lang.code) # copy account.account translations - in_field = 'name' in_ids = obj_acc_template.search(cr, uid, [('id', 'child_of', [acc_template_root_id])], order='id')[1:] out_ids = obj_acc.search(cr, uid, [('id', 'child_of', [acc_root_id])], order='id')[1:] - self.copy_translation(cr, uid, langs, obj_acc_template, in_field, in_ids, obj_acc, out_ids) + result = self.copy_translations(cr, uid, langs, obj_acc_template, 'name', in_ids, obj_acc, out_ids, context) + if result: + return result + return {} def onchange_chart_template_id(self, cr, uid, ids, chart_template_id=False, context=None): res = super(wizard_multi_charts_accounts, self).onchange_chart_template_id(cr, uid, ids, chart_template_id, context=context) diff --git a/addons/l10n_multilang/l10n_multilang.xml b/addons/l10n_multilang/l10n_multilang.xml index 71563ce526c..02b06a9147d 100644 --- a/addons/l10n_multilang/l10n_multilang.xml +++ b/addons/l10n_multilang/l10n_multilang.xml @@ -1,7 +1,7 @@ - + 25 onskip @@ -27,6 +27,23 @@ + + + Translation Process + translate.message + form + + + + + + + + @@ -149,7 +149,7 @@ - + @@ -181,7 +181,7 @@ - + @@ -210,7 +210,7 @@ - + @@ -241,7 +241,7 @@ equalTo="input[name=new_pwd]" minlength="1"/> - + @@ -290,7 +290,7 @@ - + @@ -1130,9 +1130,9 @@
- - - + + +
@@ -1609,7 +1609,7 @@ minlength="1"/> - + From f7cd3aea92055fed7e92520a41a5d65b1b99e7bd Mon Sep 17 00:00:00 2001 From: "Quentin (OpenERP)" Date: Fri, 9 Dec 2011 10:33:14 +0100 Subject: [PATCH 146/233] [REF] account: code cleaning and removal of installable field in account.tax.template bzr revid: qdp-launchpad@openerp.com-20111209093314-b6onxfybgm1picp5 --- addons/account/account.py | 36 ++++++++++++++++----------------- addons/account/account_view.xml | 27 ++++++++++++------------- 2 files changed, 30 insertions(+), 33 deletions(-) diff --git a/addons/account/account.py b/addons/account/account.py index 342c2efcb76..89e10612471 100644 --- a/addons/account/account.py +++ b/addons/account/account.py @@ -2429,7 +2429,7 @@ class account_account_template(osv.osv): 'child_parent_ids':fields.one2many('account.account.template', 'parent_id', 'Children'), 'tax_ids': fields.many2many('account.tax.template', 'account_account_template_tax_rel', 'account_id', 'tax_id', 'Default Taxes'), 'nocreate': fields.boolean('Optional create', help="If checked, the new chart of accounts will not contain this by default."), - 'chart_template_id': fields.many2one('account.chart.template', 'Chart Template'), + 'chart_template_id': fields.many2one('account.chart.template', 'Chart Template', help="This optional field allow you to link an account template to a specific chart template that may differ from the one its root parent belongs to. This allow you to define chart templates that extend another and complete it with few new accounts (You don't need to define the whole structure that is common to both several times)."), } _defaults = { @@ -2466,26 +2466,27 @@ class account_account_template(osv.osv): res.append((record['id'],name )) return res - def generate_account(self, cr, uid, template_id, tax_template_ref, acc_template_ref, code_digits, company_id, context=None): + def generate_account(self, cr, uid, chart_template_id, tax_template_ref, acc_template_ref, code_digits, company_id, context=None): """ This method for generating accounts from templates. - @param cr: A database cursor. - @param uid: ID of the user currently logged in. - @param account_root_id: Root account id getting from current template. - @param tax_template_ref: Taxes templates reference for write taxes_id in account_account. - @param code_digits: Digit getting from wizard.multi.charts.accounts.,this is use for account code. - @param company_id: company_id selected from wizard.multi.charts.accounts. - @return : return acc_template_ref for reference purpose. + + :param chart_template_id: id of the chart template chosen in the wizard + :param tax_template_ref: Taxes templates reference for write taxes_id in account_account. + :paramacc_template_ref: dictionary with the mappping between the account templates and the real accounts. + :param code_digits: number of digits got from wizard.multi.charts.accounts, this is use for account code. + :param company_id: company_id selected from wizard.multi.charts.accounts. + :returns: return acc_template_ref for reference purpose. + :rtype: dict """ if context is None: context = {} obj_acc = self.pool.get('account.account') company_name = self.pool.get('res.company').browse(cr, uid, company_id, context=context).name - template = self.pool.get('account.chart.template').browse(cr, uid, template_id, context=context) + template = self.pool.get('account.chart.template').browse(cr, uid, chart_template_id, context=context) #deactivate the parent_store functionnality on account_account for rapidity purpose ctx = context.copy() ctx.update({'defer_parent_store_computation': True}) - children_acc_template = self.search(cr, uid, ['|', ('chart_template_id','=', [template_id]),'&',('parent_id','child_of', [template.account_root_id.id]),('chart_template_id','=', False), ('nocreate','!=',True)], order='id') + children_acc_template = self.search(cr, uid, ['|', ('chart_template_id','=', [chart_template_id]),'&',('parent_id','child_of', [template.account_root_id.id]),('chart_template_id','=', False), ('nocreate','!=',True)], order='id') for account_template in self.browse(cr, uid, children_acc_template, context=context): # skip the root of COA if it's not the main one if (template.account_root_id.id == account_template.id) and template.parent_id: @@ -2719,7 +2720,6 @@ class account_tax_template(osv.osv): 'description': fields.char('Internal Name', size=32), 'type_tax_use': fields.selection([('sale','Sale'),('purchase','Purchase'),('all','All')], 'Tax Use In', required=True,), 'price_include': fields.boolean('Tax Included in Price', help="Check this if the price you use on the product and invoices includes this tax."), - 'installable': fields.boolean('Should be Installed', help="Set this to False if you do not want to create real tax object from this template.") } def name_get(self, cr, uid, ids, context=None): @@ -2751,7 +2751,6 @@ class account_tax_template(osv.osv): 'include_base_amount': False, 'type_tax_use': 'all', 'price_include': 0, - 'installable': True } _order = 'sequence' @@ -3006,9 +3005,9 @@ class wizard_multi_charts_accounts(osv.osv_memory): if data.complete_tax_set: # default tax is given by the lowest sequence. For same sequence we will take the latest created as it will be the case for tax created while isntalling the generic chart of account sale_tax_ids = tax_templ_obj.search(cr, uid, [("chart_template_id" - , "=", chart_template_id), ('type_tax_use', 'in', ('sale','all')), ('installable', '=', True)], order="sequence, id desc") + , "=", chart_template_id), ('type_tax_use', 'in', ('sale','all'))], order="sequence, id desc") purchase_tax_ids = tax_templ_obj.search(cr, uid, [("chart_template_id" - , "=", chart_template_id), ('type_tax_use', 'in', ('purchase','all')), ('installable', '=', True)], order="sequence, id desc") + , "=", chart_template_id), ('type_tax_use', 'in', ('purchase','all'))], order="sequence, id desc") res['value'].update({'sale_tax': sale_tax_ids and sale_tax_ids[0] or False, 'purchase_tax': purchase_tax_ids and purchase_tax_ids[0] or False}) if data.code_digits: @@ -3035,11 +3034,11 @@ class wizard_multi_charts_accounts(osv.osv_memory): res.update({'chart_template_id': ids[0]}) if 'sale_tax' in fields: sale_tax_ids = tax_templ_obj.search(cr, uid, [("chart_template_id" - , "=", ids[0]), ('type_tax_use', 'in', ('sale','all')), ('installable', '=', True)], order="sequence") + , "=", ids[0]), ('type_tax_use', 'in', ('sale','all'))], order="sequence") res.update({'sale_tax': sale_tax_ids and sale_tax_ids[0] or False}) if 'purchase_tax' in fields: purchase_tax_ids = tax_templ_obj.search(cr, uid, [("chart_template_id" - , "=", ids[0]), ('type_tax_use', 'in', ('purchase','all')), ('installable', '=', True)], order="sequence") + , "=", ids[0]), ('type_tax_use', 'in', ('purchase','all'))], order="sequence") res.update({'purchase_tax': purchase_tax_ids and purchase_tax_ids[0] or False}) return res @@ -3260,7 +3259,7 @@ class wizard_multi_charts_accounts(osv.osv_memory): tax_code_ref.update(obj_tax_code_template.generate_tax_code(cr, uid, template.tax_code_root_id.id, company_id, context=context)) # Generate taxes from templates. - tax_templates = [x for x in template.tax_template_ids if x.installable] + tax_templates = [x for x in template.tax_template_ids] generated_tax_res = obj_tax_temp._generate_tax(cr, uid, tax_templates, tax_code_ref, company_id, context=context) taxes_ref.update(generated_tax_res['tax_template_to_tax']) @@ -3335,7 +3334,6 @@ class wizard_multi_charts_accounts(osv.osv_memory): 'ref_base_code_id': new_base_code_id, 'ref_tax_code_id': new_tax_code_id, 'type_tax_use': tax_type, - 'installable': True, 'type': 'percent', 'sequence': 0, 'chart_template_id': chart_template.id or False, diff --git a/addons/account/account_view.xml b/addons/account/account_view.xml index 80ce67d0e8f..fabf68935e9 100644 --- a/addons/account/account_view.xml +++ b/addons/account/account_view.xml @@ -1753,18 +1753,18 @@
- - - - - - - - - - - - + + + + + + + + + + + + @@ -2276,8 +2276,7 @@ - - + From 8e760071cbddd7aa2a52a33f9aa1de5d63c16b23 Mon Sep 17 00:00:00 2001 From: Xavier Morel Date: Fri, 9 Dec 2011 10:34:09 +0100 Subject: [PATCH 147/233] [EXT] extract translatable strings to pot files bzr revid: xmo@openerp.com-20111209093409-gjarrp10hwy0uogm --- addons/web/po/web.pot | 152 ++++++++++++---------- addons/web_calendar/po/web_calendar.pot | 6 +- addons/web_chat/po/web_chat.pot | 2 +- addons/web_dashboard/po/web_dashboard.pot | 14 +- addons/web_diagram/po/web_diagram.pot | 2 +- addons/web_gantt/po/web_gantt.pot | 14 +- addons/web_graph/po/web_graph.pot | 2 +- addons/web_hello/po/web_hello.pot | 2 +- addons/web_mobile/po/web_mobile.pot | 2 +- addons/web_rpc/po/web_rpc.pot | 2 +- 10 files changed, 109 insertions(+), 89 deletions(-) diff --git a/addons/web/po/web.pot b/addons/web/po/web.pot index 8ca40ae555e..9f8390e71e8 100644 --- a/addons/web/po/web.pot +++ b/addons/web/po/web.pot @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PROJECT VERSION\n" "Report-Msgid-Bugs-To: EMAIL@ADDRESS\n" -"POT-Creation-Date: 2011-12-05 11:50+0100\n" +"POT-Creation-Date: 2011-12-09 10:33+0100\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -18,8 +18,8 @@ msgstr "" "Generated-By: Babel 0.9.6\n" #: addons/web/static/src/js/data_import.js:73 -#: addons/web/static/src/js/view_form.js:2799 -#: addons/web/static/src/js/views.js:743 +#: addons/web/static/src/js/view_form.js:2746 +#: addons/web/static/src/js/views.js:803 msgid "Close" msgstr "" @@ -31,59 +31,67 @@ msgstr "" msgid "External ID" msgstr "" -#: addons/web/static/src/js/search.js:231 +#: addons/web/static/src/js/search.js:230 msgid "Filter Entry" msgstr "" -#: addons/web/static/src/js/search.js:233 -#: addons/web/static/src/js/search.js:274 addons/web/static/src/xml/base.xml:0 +#: addons/web/static/src/js/search.js:232 +#: addons/web/static/src/js/search.js:273 addons/web/static/src/xml/base.xml:0 msgid "Cancel" msgstr "" -#: addons/web/static/src/js/search.js:236 -#: addons/web/static/src/js/search.js:277 +#: addons/web/static/src/js/search.js:235 +#: addons/web/static/src/js/search.js:276 msgid "OK" msgstr "" -#: addons/web/static/src/js/search.js:272 addons/web/static/src/xml/base.xml:0 +#: addons/web/static/src/js/search.js:271 addons/web/static/src/xml/base.xml:0 msgid "Add to Dashboard" msgstr "" -#: addons/web/static/src/js/search.js:401 +#: addons/web/static/src/js/search.js:400 msgid "Invalid Search" msgstr "" -#: addons/web/static/src/js/search.js:401 +#: addons/web/static/src/js/search.js:400 msgid "triggered from search view" msgstr "" -#: addons/web/static/src/js/search.js:483 +#: addons/web/static/src/js/search.js:482 #, python-format msgid "Incorrect value for field %(fieldname)s: [%(value)s] is %(message)s" msgstr "" -#: addons/web/static/src/js/search.js:804 +#: addons/web/static/src/js/search.js:803 msgid "not a valid integer" msgstr "" -#: addons/web/static/src/js/search.js:818 +#: addons/web/static/src/js/search.js:817 msgid "not a valid number" msgstr "" -#: addons/web/static/src/js/search.js:1234 +#: addons/web/static/src/js/search.js:1233 msgid "contains" msgstr "" -#: addons/web/static/src/js/search.js:1235 +#: addons/web/static/src/js/search.js:1234 msgid "doesn't contain" msgstr "" +#: addons/web/static/src/js/search.js:1235 +#: addons/web/static/src/js/search.js:1250 +#: addons/web/static/src/js/search.js:1270 +#: addons/web/static/src/js/search.js:1290 +#: addons/web/static/src/js/search.js:1312 +msgid "is equal to" +msgstr "" + #: addons/web/static/src/js/search.js:1236 #: addons/web/static/src/js/search.js:1251 #: addons/web/static/src/js/search.js:1271 #: addons/web/static/src/js/search.js:1291 #: addons/web/static/src/js/search.js:1313 -msgid "is equal to" +msgid "is not equal to" msgstr "" #: addons/web/static/src/js/search.js:1237 @@ -91,7 +99,7 @@ msgstr "" #: addons/web/static/src/js/search.js:1272 #: addons/web/static/src/js/search.js:1292 #: addons/web/static/src/js/search.js:1314 -msgid "is not equal to" +msgid "greater than" msgstr "" #: addons/web/static/src/js/search.js:1238 @@ -99,7 +107,7 @@ msgstr "" #: addons/web/static/src/js/search.js:1273 #: addons/web/static/src/js/search.js:1293 #: addons/web/static/src/js/search.js:1315 -msgid "greater than" +msgid "less than" msgstr "" #: addons/web/static/src/js/search.js:1239 @@ -107,7 +115,7 @@ msgstr "" #: addons/web/static/src/js/search.js:1274 #: addons/web/static/src/js/search.js:1294 #: addons/web/static/src/js/search.js:1316 -msgid "less than" +msgid "greater or equal than" msgstr "" #: addons/web/static/src/js/search.js:1240 @@ -115,64 +123,52 @@ msgstr "" #: addons/web/static/src/js/search.js:1275 #: addons/web/static/src/js/search.js:1295 #: addons/web/static/src/js/search.js:1317 -msgid "greater or equal than" -msgstr "" - -#: addons/web/static/src/js/search.js:1241 -#: addons/web/static/src/js/search.js:1256 -#: addons/web/static/src/js/search.js:1276 -#: addons/web/static/src/js/search.js:1296 -#: addons/web/static/src/js/search.js:1318 msgid "less or equal than" msgstr "" -#: addons/web/static/src/js/search.js:1307 -#: addons/web/static/src/js/search.js:1332 +#: addons/web/static/src/js/search.js:1306 +#: addons/web/static/src/js/search.js:1331 msgid "is" msgstr "" -#: addons/web/static/src/js/search.js:1333 +#: addons/web/static/src/js/search.js:1332 msgid "is not" msgstr "" -#: addons/web/static/src/js/search.js:1346 +#: addons/web/static/src/js/search.js:1345 msgid "is true" msgstr "" -#: addons/web/static/src/js/search.js:1347 +#: addons/web/static/src/js/search.js:1346 msgid "is false" msgstr "" -#: addons/web/static/src/js/view_editor.js:182 +#: addons/web/static/src/js/view_editor.js:181 msgid "Do you really want to remove this view?" msgstr "" -#: addons/web/static/src/js/view_editor.js:454 +#: addons/web/static/src/js/view_editor.js:453 msgid "Do you really want to remove this node?" msgstr "" -#: addons/web/static/src/js/view_form.js:433 -msgid "Do you really want to delete this record?" -msgstr "" - -#: addons/web/static/src/js/view_form.js:448 +#: addons/web/static/src/js/view_form.js:387 msgid "Warning, the record has been modified, your changes will be discarded." msgstr "" -#: addons/web/static/src/js/view_form.js:656 +#: addons/web/static/src/js/view_form.js:595 msgid "Attachments" msgstr "" -#: addons/web/static/src/js/view_form.js:1880 +#: addons/web/static/src/js/view_form.js:1823 msgid "   Search More..." msgstr "" -#: addons/web/static/src/js/view_form.js:1893 +#: addons/web/static/src/js/view_form.js:1836 #, python-format msgid "   Create \"%s\"" msgstr "" -#: addons/web/static/src/js/view_form.js:1899 +#: addons/web/static/src/js/view_form.js:1842 msgid "   Create and Edit..." msgstr "" @@ -193,80 +189,84 @@ msgstr "" msgid "Undefined" msgstr "" -#: addons/web/static/src/js/views.js:482 +#: addons/web/static/src/js/view_page.js:44 +msgid "Do you really want to delete this record?" +msgstr "" + +#: addons/web/static/src/js/views.js:518 msgid "Search: " msgstr "" -#: addons/web/static/src/js/views.js:581 +#: addons/web/static/src/js/views.js:621 msgid "Customize" msgstr "" -#: addons/web/static/src/js/views.js:584 +#: addons/web/static/src/js/views.js:624 msgid "Manage Views" msgstr "" -#: addons/web/static/src/js/views.js:586 addons/web/static/src/js/views.js:590 -#: addons/web/static/src/js/views.js:595 +#: addons/web/static/src/js/views.js:626 addons/web/static/src/js/views.js:630 +#: addons/web/static/src/js/views.js:635 msgid "Manage views of the current object" msgstr "" -#: addons/web/static/src/js/views.js:588 +#: addons/web/static/src/js/views.js:628 msgid "Edit Workflow" msgstr "" -#: addons/web/static/src/js/views.js:593 +#: addons/web/static/src/js/views.js:633 msgid "Customize Object" msgstr "" -#: addons/web/static/src/js/views.js:597 +#: addons/web/static/src/js/views.js:637 msgid "Translate" msgstr "" -#: addons/web/static/src/js/views.js:599 +#: addons/web/static/src/js/views.js:639 msgid "Technical translation" msgstr "" -#: addons/web/static/src/js/views.js:604 +#: addons/web/static/src/js/views.js:644 msgid "Other Options" msgstr "" -#: addons/web/static/src/js/views.js:607 addons/web/static/src/xml/base.xml:0 +#: addons/web/static/src/js/views.js:647 addons/web/static/src/xml/base.xml:0 msgid "Import" msgstr "" -#: addons/web/static/src/js/views.js:610 addons/web/static/src/xml/base.xml:0 +#: addons/web/static/src/js/views.js:650 addons/web/static/src/xml/base.xml:0 msgid "Export" msgstr "" -#: addons/web/static/src/js/views.js:613 +#: addons/web/static/src/js/views.js:653 msgid "View Log" msgstr "" -#: addons/web/static/src/js/views.js:622 +#: addons/web/static/src/js/views.js:682 msgid "Reports" msgstr "" -#: addons/web/static/src/js/views.js:622 +#: addons/web/static/src/js/views.js:682 msgid "Actions" msgstr "" -#: addons/web/static/src/js/views.js:622 +#: addons/web/static/src/js/views.js:682 msgid "Links" msgstr "" -#: addons/web/static/src/js/views.js:702 +#: addons/web/static/src/js/views.js:762 msgid "You must choose at least one record." msgstr "" -#: addons/web/static/src/js/views.js:703 +#: addons/web/static/src/js/views.js:763 msgid "Warning" msgstr "" -#: addons/web/static/src/js/views.js:737 +#: addons/web/static/src/js/views.js:797 msgid "Translations" msgstr "" -#: addons/web/static/src/js/views.js:742 addons/web/static/src/xml/base.xml:0 +#: addons/web/static/src/js/views.js:802 addons/web/static/src/xml/base.xml:0 msgid "Save" msgstr "" @@ -382,6 +382,10 @@ msgstr "" msgid "Confirm new master password:" msgstr "" +#: addons/web/static/src/xml/base.xml:0 +msgid "Change Password" +msgstr "" + #: addons/web/static/src/xml/base.xml:0 msgid "User:" msgstr "" @@ -512,14 +516,6 @@ msgstr "" msgid "Last" msgstr "" -#: addons/web/static/src/xml/base.xml:0 -msgid "Edit" -msgstr "" - -#: addons/web/static/src/xml/base.xml:0 -msgid "Duplicate" -msgstr "" - #: addons/web/static/src/xml/base.xml:0 msgid "<<" msgstr "" @@ -536,6 +532,14 @@ msgstr "" msgid ">>" msgstr "" +#: addons/web/static/src/xml/base.xml:0 +msgid "Edit" +msgstr "" + +#: addons/web/static/src/xml/base.xml:0 +msgid "Duplicate" +msgstr "" + #: addons/web/static/src/xml/base.xml:0 msgid "Add" msgstr "" @@ -676,6 +680,10 @@ msgstr "" msgid "Action ID:" msgstr "" +#: addons/web/static/src/xml/base.xml:0 +msgid "Search" +msgstr "" + #: addons/web/static/src/xml/base.xml:0 msgid "Advanced Filter" msgstr "" diff --git a/addons/web_calendar/po/web_calendar.pot b/addons/web_calendar/po/web_calendar.pot index 1e431ffe6e9..f92c598a0bf 100644 --- a/addons/web_calendar/po/web_calendar.pot +++ b/addons/web_calendar/po/web_calendar.pot @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PROJECT VERSION\n" "Report-Msgid-Bugs-To: EMAIL@ADDRESS\n" -"POT-Creation-Date: 2011-12-05 11:50+0100\n" +"POT-Creation-Date: 2011-12-09 10:33+0100\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -17,11 +17,11 @@ msgstr "" "Content-Transfer-Encoding: 8bit\n" "Generated-By: Babel 0.9.6\n" -#: addons/web_calendar/static/src/js/calendar.js:409 +#: addons/web_calendar/static/src/js/calendar.js:412 msgid "Responsible" msgstr "" -#: addons/web_calendar/static/src/js/calendar.js:438 +#: addons/web_calendar/static/src/js/calendar.js:441 msgid "Navigator" msgstr "" diff --git a/addons/web_chat/po/web_chat.pot b/addons/web_chat/po/web_chat.pot index b5b0239b506..070ea446394 100644 --- a/addons/web_chat/po/web_chat.pot +++ b/addons/web_chat/po/web_chat.pot @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PROJECT VERSION\n" "Report-Msgid-Bugs-To: EMAIL@ADDRESS\n" -"POT-Creation-Date: 2011-12-05 11:50+0100\n" +"POT-Creation-Date: 2011-12-09 10:33+0100\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" diff --git a/addons/web_dashboard/po/web_dashboard.pot b/addons/web_dashboard/po/web_dashboard.pot index 7b02d91af36..201c979a547 100644 --- a/addons/web_dashboard/po/web_dashboard.pot +++ b/addons/web_dashboard/po/web_dashboard.pot @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PROJECT VERSION\n" "Report-Msgid-Bugs-To: EMAIL@ADDRESS\n" -"POT-Creation-Date: 2011-12-05 11:50+0100\n" +"POT-Creation-Date: 2011-12-09 10:33+0100\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -21,10 +21,6 @@ msgstr "" msgid "Reset" msgstr "" -#: addons/web_dashboard/static/src/xml/web_dashboard.xml:0 -msgid "Undo" -msgstr "" - #: addons/web_dashboard/static/src/xml/web_dashboard.xml:0 msgid "Change layout" msgstr "" @@ -33,6 +29,10 @@ msgstr "" msgid " " msgstr "" +#: addons/web_dashboard/static/src/xml/web_dashboard.xml:0 +msgid "Create" +msgstr "" + #: addons/web_dashboard/static/src/xml/web_dashboard.xml:0 msgid "Choose dashboard layout" msgstr "" @@ -52,7 +52,7 @@ msgid "" msgstr "" #: addons/web_dashboard/static/src/xml/web_dashboard.xml:0 -msgid "Welcome to your new OpenERP instance." +msgid "Welcome to OpenERP" msgstr "" #: addons/web_dashboard/static/src/xml/web_dashboard.xml:0 @@ -68,6 +68,6 @@ msgid "Choose the first OpenERP Application you want to install.." msgstr "" #: addons/web_dashboard/static/src/xml/web_dashboard.xml:0 -msgid "Install" +msgid "Please choose the first application to install." msgstr "" diff --git a/addons/web_diagram/po/web_diagram.pot b/addons/web_diagram/po/web_diagram.pot index e6e33177d21..91d96431684 100644 --- a/addons/web_diagram/po/web_diagram.pot +++ b/addons/web_diagram/po/web_diagram.pot @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PROJECT VERSION\n" "Report-Msgid-Bugs-To: EMAIL@ADDRESS\n" -"POT-Creation-Date: 2011-12-05 11:50+0100\n" +"POT-Creation-Date: 2011-12-09 10:33+0100\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" diff --git a/addons/web_gantt/po/web_gantt.pot b/addons/web_gantt/po/web_gantt.pot index b5b0239b506..9c91dda7f30 100644 --- a/addons/web_gantt/po/web_gantt.pot +++ b/addons/web_gantt/po/web_gantt.pot @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PROJECT VERSION\n" "Report-Msgid-Bugs-To: EMAIL@ADDRESS\n" -"POT-Creation-Date: 2011-12-05 11:50+0100\n" +"POT-Creation-Date: 2011-12-09 10:33+0100\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -17,3 +17,15 @@ msgstr "" "Content-Transfer-Encoding: 8bit\n" "Generated-By: Babel 0.9.6\n" +#: addons/web_gantt/static/src/js/gantt.js:49 +msgid "date_start is not defined " +msgstr "" + +#: addons/web_gantt/static/src/js/gantt.js:108 +msgid "date_start is not defined" +msgstr "" + +#: addons/web_gantt/static/src/xml/web_gantt.xml:0 +msgid "Create" +msgstr "" + diff --git a/addons/web_graph/po/web_graph.pot b/addons/web_graph/po/web_graph.pot index b5b0239b506..070ea446394 100644 --- a/addons/web_graph/po/web_graph.pot +++ b/addons/web_graph/po/web_graph.pot @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PROJECT VERSION\n" "Report-Msgid-Bugs-To: EMAIL@ADDRESS\n" -"POT-Creation-Date: 2011-12-05 11:50+0100\n" +"POT-Creation-Date: 2011-12-09 10:33+0100\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" diff --git a/addons/web_hello/po/web_hello.pot b/addons/web_hello/po/web_hello.pot index b5b0239b506..070ea446394 100644 --- a/addons/web_hello/po/web_hello.pot +++ b/addons/web_hello/po/web_hello.pot @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PROJECT VERSION\n" "Report-Msgid-Bugs-To: EMAIL@ADDRESS\n" -"POT-Creation-Date: 2011-12-05 11:50+0100\n" +"POT-Creation-Date: 2011-12-09 10:33+0100\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" diff --git a/addons/web_mobile/po/web_mobile.pot b/addons/web_mobile/po/web_mobile.pot index 5f4ed88d94e..6667eeb8d27 100644 --- a/addons/web_mobile/po/web_mobile.pot +++ b/addons/web_mobile/po/web_mobile.pot @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PROJECT VERSION\n" "Report-Msgid-Bugs-To: EMAIL@ADDRESS\n" -"POT-Creation-Date: 2011-12-05 11:50+0100\n" +"POT-Creation-Date: 2011-12-09 10:33+0100\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" diff --git a/addons/web_rpc/po/web_rpc.pot b/addons/web_rpc/po/web_rpc.pot index b5b0239b506..070ea446394 100644 --- a/addons/web_rpc/po/web_rpc.pot +++ b/addons/web_rpc/po/web_rpc.pot @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PROJECT VERSION\n" "Report-Msgid-Bugs-To: EMAIL@ADDRESS\n" -"POT-Creation-Date: 2011-12-05 11:50+0100\n" +"POT-Creation-Date: 2011-12-09 10:33+0100\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" From f4f3ee884c71c5606a5cee64ee4d3e9a739bc6c6 Mon Sep 17 00:00:00 2001 From: "Quentin (OpenERP)" Date: Fri, 9 Dec 2011 10:45:06 +0100 Subject: [PATCH 148/233] [REF] account: code cleaning and removal of fields_view_get useless overwriting bzr revid: qdp-launchpad@openerp.com-20111209094506-798lozt56rrihzj9 --- addons/account/account.py | 24 +++++++++--------------- addons/account/account_view.xml | 2 +- 2 files changed, 10 insertions(+), 16 deletions(-) diff --git a/addons/account/account.py b/addons/account/account.py index 89e10612471..8f85ade0aaa 100644 --- a/addons/account/account.py +++ b/addons/account/account.py @@ -2827,13 +2827,13 @@ class account_fiscal_position_template(osv.osv): def generate_fiscal_position(self, cr, uid, chart_temp_id, tax_template_ref, acc_template_ref, company_id, context=None): """ - This method generate Fiscal Position , Fiscal Position Accounts and Fiscal Position Taxes from templates. - @param cr: A database cursor. - @param uid: ID of the user currently logged in. - @param chart_temp_id: Chart Template Id. - @param taxes_ids: Taxes templates reference for generating account.fiscal.position.tax. - @param acc_template_ref: Account templates reference for generating account.fiscal.position.account. - @param company_id: company_id selected from wizard.multi.charts.accounts. + This method generate Fiscal Position, Fiscal Position Accounts and Fiscal Position Taxes from templates. + + :param chart_temp_id: Chart Template Id. + :param taxes_ids: Taxes templates reference for generating account.fiscal.position.tax. + :param acc_template_ref: Account templates reference for generating account.fiscal.position.account. + :param company_id: company_id selected from wizard.multi.charts.accounts. + :returns: True """ if context is None: context = {} @@ -2855,7 +2855,7 @@ class account_fiscal_position_template(osv.osv): 'account_dest_id': acc_template_ref[acc.account_dest_id.id], 'position_id': new_fp }) - return {} + return True account_fiscal_position_template() @@ -2989,7 +2989,7 @@ class wizard_multi_charts_accounts(osv.osv_memory): 'bank_accounts_id': fields.one2many('account.bank.accounts.wizard', 'bank_account_id', 'Cash and Banks', required=True), 'code_digits':fields.integer('# of Digits', required=True, help="No. of Digits to use for account code"), 'seq_journal':fields.boolean('Separated Journal Sequences', help="Check this box if you want to use a different sequence for each created journal. Otherwise, all will use the same sequence."), - "sale_tax": fields.many2one("account.tax.template", "Default Sales Tax"), + "sale_tax": fields.many2one("account.tax.template", "Default Sale Tax"), "purchase_tax": fields.many2one("account.tax.template", "Default Purchase Tax"), 'sale_tax_rate': fields.float('Sales Tax(%)'), 'purchase_tax_rate': fields.float('Purchase Tax(%)'), @@ -3048,7 +3048,6 @@ class wizard_multi_charts_accounts(osv.osv_memory): acc_template_obj = self.pool.get('account.chart.template') company_obj = self.pool.get('res.company') - template_ids = acc_template_obj.search(cr, uid, [('visible', '=', True)], context=context) company_ids = company_obj.search(cr, uid, [], context=context) #display in the widget selection of companies, only the companies that haven't been configured yet (but don't care about the demo chart of accounts) cr.execute("SELECT company_id FROM account_account WHERE active = 't' AND account_account.parent_id IS NULL AND name != %s", ("Chart For Automated Tests",)) @@ -3061,11 +3060,6 @@ class wizard_multi_charts_accounts(osv.osv_memory): if unconfigured_cmp: cmp_select = [(line.id, line.name) for line in company_obj.browse(cr, uid, unconfigured_cmp)] res['fields'][field]['selection'] = cmp_select - if field == 'chart_template_id': - res['fields'][field]['selection'] = [('', '')] - if template_ids: - template_select = [(template.id, template.name) for template in acc_template_obj.browse(cr, uid, template_ids)] - res['fields'][field]['selection'] = template_select return res def check_created_journals(self, cr, uid, vals_journal, company_id, context=None): diff --git a/addons/account/account_view.xml b/addons/account/account_view.xml index fabf68935e9..59a2a8eaa19 100644 --- a/addons/account/account_view.xml +++ b/addons/account/account_view.xml @@ -2444,7 +2444,7 @@ - + From 03a2c05f8ff27806d71e70f047ed03fa2c156ca0 Mon Sep 17 00:00:00 2001 From: Antony Lesuisse Date: Fri, 9 Dec 2011 10:53:09 +0100 Subject: [PATCH 149/233] [FIX] menu disapear bzr revid: al@openerp.com-20111209095309-krhje63k6cwvxdjq --- addons/web/static/src/js/chrome.js | 2 +- addons/web_dashboard/static/src/js/dashboard.js | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/addons/web/static/src/js/chrome.js b/addons/web/static/src/js/chrome.js index dc312706427..d4a9ccc45f1 100644 --- a/addons/web/static/src/js/chrome.js +++ b/addons/web/static/src/js/chrome.js @@ -840,7 +840,7 @@ openerp.web.Menu = openerp.web.Widget.extend(/** @lends openerp.web.Menu# */{ this.$secondary_menu = $("#" + secondary_menu_id); this.$secondary_menu.hide(); this.menu = false; - this.folded = false; + this.folded = true; if (window.localStorage) { this.folded = localStorage.getItem('oe_menu_folded') === 'true'; } diff --git a/addons/web_dashboard/static/src/js/dashboard.js b/addons/web_dashboard/static/src/js/dashboard.js index 91deb57a863..f285b64eca2 100644 --- a/addons/web_dashboard/static/src/js/dashboard.js +++ b/addons/web_dashboard/static/src/js/dashboard.js @@ -434,6 +434,7 @@ openerp.web_dashboard.ApplicationInstaller = openerp.web.Widget.extend({ this.action_manager.do_action({ type: 'ir.actions.act_window', res_model: 'ir.module.module', + domain: [['application','=',true]], views: [[false, 'kanban']], flags: { display_title:false, From f8ecc91b563be1a73acdd7fd773d7001f27080d6 Mon Sep 17 00:00:00 2001 From: "Quentin (OpenERP)" Date: Fri, 9 Dec 2011 10:53:18 +0100 Subject: [PATCH 150/233] [REF] account: code cleaning bzr revid: qdp-launchpad@openerp.com-20111209095318-k7d6atw857msm8qe --- addons/account/account.py | 21 ++++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-) diff --git a/addons/account/account.py b/addons/account/account.py index 8f85ade0aaa..5f69c52b832 100644 --- a/addons/account/account.py +++ b/addons/account/account.py @@ -3074,12 +3074,12 @@ class wizard_multi_charts_accounts(osv.osv_memory): def generate_journals(self, cr, uid, chart_template_id, acc_template_ref, company_id, context=None): """ - This method used for creating journals. - @param cr: A database cursor. - @param uid: ID of the user currently logged in. - @param chart_temp_id: Chart Template Id. - @param acc_template_ref: Account templates reference. - @param company_id: company_id selected from wizard.multi.charts.accounts. + This method is used for creating journals. + + :param chart_temp_id: Chart Template Id. + :param acc_template_ref: Account templates reference. + :param company_id: company_id selected from wizard.multi.charts.accounts. + :returns: True """ journal_data = self._prepare_all_journals(cr, uid, chart_template_id, acc_template_ref, company_id, context=context) for vals_journal in journal_data: @@ -3208,6 +3208,9 @@ class wizard_multi_charts_accounts(osv.osv_memory): :param company_id: id of the company the wizard is running for :param code_digits: integer that depicts the number of digits the accounts code should have in the COA :param obj_wizard: the current wizard for generating the COA from the templates + :param acc_ref: Mapping between ids of account templates and real accounts created from them + :param taxes_ref: Mapping between ids of tax templates and real taxes created from them + :param tax_code_ref: Mapping between ids of tax code templates and real tax codes created from them :returns: return a tuple with a dictionary containing * the mapping between the account template ids and the ids of the real accounts that have been generated from them, as first item, @@ -3235,6 +3238,9 @@ class wizard_multi_charts_accounts(osv.osv_memory): :param company_id: id of the company the wizard is running for :param code_digits: integer that depicts the number of digits the accounts code should have in the COA :param obj_wizard: the current wizard for generating the COA from the templates + :param acc_ref: Mapping between ids of account templates and real accounts created from them + :param taxes_ref: Mapping between ids of tax templates and real taxes created from them + :param tax_code_ref: Mapping between ids of tax code templates and real tax codes created from them :returns: return a tuple with a dictionary containing * the mapping between the account template ids and the ids of the real accounts that have been generated from them, as first item, @@ -3284,7 +3290,8 @@ class wizard_multi_charts_accounts(osv.osv_memory): ''' This function checks if the chosen chart template is configured as containing a full set of taxes, and if it's not the case, it creates the templates for account.tax.code and for account.account.tax objects accordingly - to the provided sale/purchase rates. + to the provided sale/purchase rates. Then it saves the new tax templates as default taxes to use for this chart + template. :param obj_wizard: browse record of wizard to generate COA from templates :param company_id: id of the company for wich the wizard is running From 9f682b4a27227fa026b82d632d276e059c19a9ac Mon Sep 17 00:00:00 2001 From: "Quentin (OpenERP)" Date: Fri, 9 Dec 2011 10:55:25 +0100 Subject: [PATCH 151/233] [IMP] account: added translate=True on name field of account_account_type bzr revid: qdp-launchpad@openerp.com-20111209095525-wjbethe8lv1ujrlo --- addons/account/account.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/account/account.py b/addons/account/account.py index 5f69c52b832..e2ce5ff8063 100644 --- a/addons/account/account.py +++ b/addons/account/account.py @@ -131,7 +131,7 @@ class account_account_type(osv.osv): _name = "account.account.type" _description = "Account Type" _columns = { - 'name': fields.char('Account Type', size=64, required=True), + 'name': fields.char('Account Type', size=64, required=True, translate=True), 'code': fields.char('Code', size=32, required=True), 'close_method': fields.selection([('none', 'None'), ('balance', 'Balance'), ('detail', 'Detail'), ('unreconciled', 'Unreconciled')], 'Deferral Method', required=True, help="""Set here the method that will be used to generate the end of year journal entries for all the accounts of this type. From 7f439f2ab5c26eafadc8dd4af2ff4adcc7cd11d3 Mon Sep 17 00:00:00 2001 From: "Quentin (OpenERP)" Date: Fri, 9 Dec 2011 10:59:45 +0100 Subject: [PATCH 152/233] [REM] l10n_multilang: removal of useless xml file bzr revid: qdp-launchpad@openerp.com-20111209095945-tuqed6v98v0qana3 --- addons/l10n_multilang/__openerp__.py | 1 - addons/l10n_multilang/l10n_multilang.xml | 11 ----------- 2 files changed, 12 deletions(-) delete mode 100644 addons/l10n_multilang/l10n_multilang.xml diff --git a/addons/l10n_multilang/__openerp__.py b/addons/l10n_multilang/__openerp__.py index 84a87b00f5c..e32c70d91be 100644 --- a/addons/l10n_multilang/__openerp__.py +++ b/addons/l10n_multilang/__openerp__.py @@ -35,7 +35,6 @@ 'init_xml': [], "depends" : ['account_accountant'], 'update_xml': [ - 'l10n_multilang.xml', 'l10n_multilang_demo.xml' ], 'demo_xml': [ diff --git a/addons/l10n_multilang/l10n_multilang.xml b/addons/l10n_multilang/l10n_multilang.xml deleted file mode 100644 index 8e8d1cafe39..00000000000 --- a/addons/l10n_multilang/l10n_multilang.xml +++ /dev/null @@ -1,11 +0,0 @@ - - - - - - 25 - onskip - - - - From ae52229410eb883b3fd7266be876de07858ccf19 Mon Sep 17 00:00:00 2001 From: "Quentin (OpenERP)" Date: Fri, 9 Dec 2011 11:03:23 +0100 Subject: [PATCH 153/233] [REM] l10n_multilang: removal of demo multi charts of account that are at the wrong place bzr revid: qdp-launchpad@openerp.com-20111209100323-9njp9s0fcfa7cht7 --- addons/l10n_multilang/__openerp__.py | 2 - addons/l10n_multilang/l10n_multilang_demo.xml | 357 ------------------ 2 files changed, 359 deletions(-) delete mode 100644 addons/l10n_multilang/l10n_multilang_demo.xml diff --git a/addons/l10n_multilang/__openerp__.py b/addons/l10n_multilang/__openerp__.py index e32c70d91be..197a416cc44 100644 --- a/addons/l10n_multilang/__openerp__.py +++ b/addons/l10n_multilang/__openerp__.py @@ -29,13 +29,11 @@ Analytic Chart of Accounts and Analytic Journals. * Setup wizard changes - Copy translations for COA, Tax, Tax Code and Fiscal Position from templates to target objects. - - Add option to install languages during the setup. """, 'website': 'http://www.openerp.com', 'init_xml': [], "depends" : ['account_accountant'], 'update_xml': [ - 'l10n_multilang_demo.xml' ], 'demo_xml': [ ], diff --git a/addons/l10n_multilang/l10n_multilang_demo.xml b/addons/l10n_multilang/l10n_multilang_demo.xml deleted file mode 100644 index a173cca6a2f..00000000000 --- a/addons/l10n_multilang/l10n_multilang_demo.xml +++ /dev/null @@ -1,357 +0,0 @@ - - - - - - - - Receivable - receivable - income - unreconciled - - - - Payable - payable - expense - unreconciled - - - - Asset View - asset - asset - - - - View - view - none - - - - Liability View - liability - liability - - - - Asset View - asset - asset - - - - - Demo Chart A - - - - Demo Chart B - - - - Demo Chart C - - - - - - Chart of Account A - 0 - view - - - - - - - Balance Sheet - A00 - view - - - - - - - - Profit and Loss - A01 - view - - - - - - - - A0011 - Bank Account A - - view - - - - - Debtors A - A00025 - receivable - - - - - - - Creditors A - A00026 - payable - - - - - - - - - Tax Template Root A - - - - Base - 001 A - - - - - Tax - 002 A - - - - - - - - Assets B - B00012 - view - - - - - - - - Liabilities B - B00014 - view - - - - - - - - Income B - B00021 - view - - - - - - - - Expense B - B00024 - view - - - - - - - - Creditors B - B00025 - payable - - - - - - - - B0031 - Bank Account B - - view - - - - - - - Chart of Account C - c0 - view - - - - - - - - Assets C - C00012 - view - - - - - - - - Liabilities C - C00014 - view - - - - - - - - Income C - C00021 - view - - - - - - - - Expense C - C00024 - other - - - - - - - - C0026 - Bank Account C - - view - - - - - - - Demo Chart A - - - - - - - - - Demo Chart B - - - - - - - - - Demo Chart C - - - - - - - - - - 10 - Tax 21% - Tax 21% - 0.21 - percent - - - - - - - 15 - VAT 6% - VAT 6% - 0.6 - percent - - - - - - - - - - - 12 - VAT 4% - VAT 4% - 0.4 - percent - - - - - - - - - 12 - Tax 12% - Tax 12% - 0.12 - percent - - - - - - - - Fiscal Position Template A - - - - - Fiscal Position Template B - - - - - - - - - - - - - - - - - - From e8e7f3dba7030ff4e6e2dc989eabe9b2a98a6ec6 Mon Sep 17 00:00:00 2001 From: niv-openerp Date: Fri, 9 Dec 2011 11:04:39 +0100 Subject: [PATCH 154/233] [fix] problem with menu disappearing bzr revid: nicolas.vanhoren@openerp.com-20111209100439-tttr4skd7mawnzs9 --- addons/web_dashboard/static/src/js/dashboard.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/addons/web_dashboard/static/src/js/dashboard.js b/addons/web_dashboard/static/src/js/dashboard.js index f285b64eca2..ed9cd467666 100644 --- a/addons/web_dashboard/static/src/js/dashboard.js +++ b/addons/web_dashboard/static/src/js/dashboard.js @@ -445,9 +445,11 @@ openerp.web_dashboard.ApplicationInstaller = openerp.web.Widget.extend({ pager: false }, }); + $('.secondary_menu', this.$element.closest('.openerp')).hide(); return r; }, stop: function() { + $('.secondary_menu', this.$element.closest('.openerp')).show(); this.action_manager.stop(); return this._super(); }, From 3cb695540e5c9a4eca303c26832fcb2b90599084 Mon Sep 17 00:00:00 2001 From: Xavier Morel Date: Fri, 9 Dec 2011 12:14:04 +0100 Subject: [PATCH 155/233] [IMP] stop hiding left menu bzr revid: xmo@openerp.com-20111209111404-sp53qc4q3ff80n0q --- addons/web/static/src/js/chrome.js | 6 +----- addons/web_dashboard/static/src/js/dashboard.js | 6 ++---- 2 files changed, 3 insertions(+), 9 deletions(-) diff --git a/addons/web/static/src/js/chrome.js b/addons/web/static/src/js/chrome.js index d4a9ccc45f1..3c212616496 100644 --- a/addons/web/static/src/js/chrome.js +++ b/addons/web/static/src/js/chrome.js @@ -838,9 +838,8 @@ openerp.web.Menu = openerp.web.Widget.extend(/** @lends openerp.web.Menu# */{ this._super(parent, element_id); this.secondary_menu_id = secondary_menu_id; this.$secondary_menu = $("#" + secondary_menu_id); - this.$secondary_menu.hide(); this.menu = false; - this.folded = true; + this.folded = false; if (window.localStorage) { this.folded = localStorage.getItem('oe_menu_folded') === 'true'; } @@ -912,9 +911,6 @@ openerp.web.Menu = openerp.web.Widget.extend(/** @lends openerp.web.Menu# */{ sub_menu_visible = $sub_menu.is(':visible'); this.$secondary_menu.find('.oe_secondary_menu').hide(); - if (this.$secondary_menu.hasClass('oe_folded')) { - this.$secondary_menu.show(); - } $('.active', this.$element.add(this.$secondary_menu)).removeClass('active'); $main_menu.add($clicked_menu).add($sub_menu).addClass('active'); diff --git a/addons/web_dashboard/static/src/js/dashboard.js b/addons/web_dashboard/static/src/js/dashboard.js index ed9cd467666..c717d629656 100644 --- a/addons/web_dashboard/static/src/js/dashboard.js +++ b/addons/web_dashboard/static/src/js/dashboard.js @@ -443,16 +443,14 @@ openerp.web_dashboard.ApplicationInstaller = openerp.web.Widget.extend({ action_buttons: false, sidebar: false, pager: false - }, + } }); - $('.secondary_menu', this.$element.closest('.openerp')).hide(); return r; }, stop: function() { - $('.secondary_menu', this.$element.closest('.openerp')).show(); this.action_manager.stop(); return this._super(); - }, + } }); From 89eb1140918c7389a2d67e189b96a8a5697cbe6b Mon Sep 17 00:00:00 2001 From: Xavier Morel Date: Fri, 9 Dec 2011 12:40:02 +0100 Subject: [PATCH 156/233] [ADD] API for immediate installation of modules (modules kanban view), buttons everywhere, remove weird kanban image fallback bzr revid: xmo@openerp.com-20111209114002-dlz79hxft05bhnqx --- openerp/addons/base/module/module.py | 14 +++++++++++++- openerp/addons/base/module/module_view.xml | 11 ++++------- 2 files changed, 17 insertions(+), 8 deletions(-) diff --git a/openerp/addons/base/module/module.py b/openerp/addons/base/module/module.py index 5db21282c65..a2fa5084c39 100644 --- a/openerp/addons/base/module/module.py +++ b/openerp/addons/base/module/module.py @@ -321,7 +321,19 @@ class module(osv.osv): def button_install(self, cr, uid, ids, context=None): self.state_update(cr, uid, ids, 'to install', ['uninstalled'], context) return dict(ACTION_DICT, name=_('Install')) - + + def button_immediate_install(self, cr, uid, ids, context=None): + """ Installs the selected module(s) immediately and fully, + returns the next res.config action to execute + + :param ids: identifiers of the modules to install + :returns: next res.config item to execute + :rtype: dict[str, object] + """ + self.state_update(cr, uid, ids, 'to install', ['uninstalled'], context) + cr.commit() + db, pool = pooler.restart_pool(cr.dbname, update_module=True) + return pool.get('res.config').next(db.cursor(), uid, [], context=context) def button_install_cancel(self, cr, uid, ids, context=None): self.write(cr, uid, ids, {'state': 'uninstalled', 'demo':False}) diff --git a/openerp/addons/base/module/module_view.xml b/openerp/addons/base/module/module_view.xml index 76aec91b98e..99468493814 100644 --- a/openerp/addons/base/module/module_view.xml +++ b/openerp/addons/base/module/module_view.xml @@ -70,8 +70,9 @@ + - +

@@ -79,13 +80,9 @@
Complex

- Install - + +
-
From 80de80c7dd0bccf2963faef39b29b668b28f039f Mon Sep 17 00:00:00 2001 From: Xavier Morel Date: Fri, 9 Dec 2011 12:53:16 +0100 Subject: [PATCH 157/233] [IMP] reduce noise in setting default values of module descriptor file bzr revid: xmo@openerp.com-20111209115316-2gqwmn2pi34vzu29 --- openerp/modules/module.py | 46 ++++++++++++++++++++------------------- 1 file changed, 24 insertions(+), 22 deletions(-) diff --git a/openerp/modules/module.py b/openerp/modules/module.py index 78f1f831920..4b9771636c7 100644 --- a/openerp/modules/module.py +++ b/openerp/modules/module.py @@ -231,9 +231,32 @@ def load_information_from_description_file(module): if terp_file: info = {} if os.path.isfile(terp_file) or zipfile.is_zipfile(mod_path+'.zip'): + # default values for descriptor + info = { + 'active': False, + 'application': False, + 'author': '', + 'category': 'Uncategorized', + 'certificate': None, + 'complexity': 'normal', + 'depends': [], + 'description': '', + 'icon': None, + 'installable': True, + 'license': 'AGPL-3', + 'name': False, + 'post_load': None, + 'version': '0.0.0', + 'web': False, + 'website': '', + } + info.update(itertools.izip( + 'depends data demo test init_xml update_xml demo_xml'.split(), + iter(list, None))) + terp_f = tools.file_open(terp_file) try: - info = eval(terp_f.read()) + info.update(eval(terp_f.read())) except Exception: logger.notifyChannel('modules', netsvc.LOG_ERROR, 'module %s: exception while evaluating file %s' % @@ -241,27 +264,6 @@ def load_information_from_description_file(module): raise finally: terp_f.close() - # TODO the version should probably be mandatory - info.setdefault('version', '0') - info.setdefault('category', 'Uncategorized') - info.setdefault('depends', []) - info.setdefault('author', '') - info.setdefault('website', '') - info.setdefault('name', False) - info.setdefault('description', '') - info.setdefault('complexity', 'normal') - info.setdefault('application', False) - info.setdefault('icon', 'images/icon.png') - info['certificate'] = info.get('certificate') or None - info['web'] = info.get('web') or False - info['license'] = info.get('license') or 'AGPL-3' - info.setdefault('installable', True) - info.setdefault('active', False) - # If the following is provided, it is called after the module is --loaded. - info.setdefault('post_load', None) - for kind in ['data', 'demo', 'test', - 'init_xml', 'update_xml', 'demo_xml']: - info.setdefault(kind, []) return info #TODO: refactor the logger in this file to follow the logging guidelines From c25475879c1f2af06899bcef8f9c32ced93bc192 Mon Sep 17 00:00:00 2001 From: Xavier Morel Date: Fri, 9 Dec 2011 13:02:07 +0100 Subject: [PATCH 158/233] [IMP] opening and getting data from module description file bzr revid: xmo@openerp.com-20111209120207-3kkyvwedbjez29rl --- openerp/modules/module.py | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/openerp/modules/module.py b/openerp/modules/module.py index 4b9771636c7..899fa6efece 100644 --- a/openerp/modules/module.py +++ b/openerp/modules/module.py @@ -254,16 +254,9 @@ def load_information_from_description_file(module): 'depends data demo test init_xml update_xml demo_xml'.split(), iter(list, None))) - terp_f = tools.file_open(terp_file) - try: + with tools.file_open(terp_file) as terp_f: info.update(eval(terp_f.read())) - except Exception: - logger.notifyChannel('modules', netsvc.LOG_ERROR, - 'module %s: exception while evaluating file %s' % - (module, terp_file)) - raise - finally: - terp_f.close() + return info #TODO: refactor the logger in this file to follow the logging guidelines From b240363efd1ea603b04d8c8200353637dd1f27fb Mon Sep 17 00:00:00 2001 From: Xavier Morel Date: Fri, 9 Dec 2011 13:27:07 +0100 Subject: [PATCH 159/233] [ADD] dummy icons to edi and acocunt_accountant bzr revid: xmo@openerp.com-20111209122707-b62m8tw4hltu8ba7 --- .../account_accountant/static/src/img/icon.png | Bin 0 -> 1132 bytes addons/edi/__openerp__.py | 1 + addons/edi/static/src/img/knowledge.png | Bin 0 -> 948 bytes 3 files changed, 1 insertion(+) create mode 100644 addons/account_accountant/static/src/img/icon.png create mode 100644 addons/edi/static/src/img/knowledge.png diff --git a/addons/account_accountant/static/src/img/icon.png b/addons/account_accountant/static/src/img/icon.png new file mode 100644 index 0000000000000000000000000000000000000000..611053684cca588d3a15317fc9535ed50fec19ec GIT binary patch literal 1132 zcmV-y1e5!TP)Tb9HrfczAeyeSL$2gN%%f zl9G~^mX@2Fo1&tks;a8Iyu8Q9#?{r;+}zyZ;o;`y=IQC_>gww5?(X#T^!WDm`T6+$ z{QME)Y|a1x00DGTPE!Ct=GbNc00VeQL_t(|+U=L=a-%pDM$q{aXZsF<|-12L?V$$Boc}I34WfA#MfuS=(jE6 zk$4E)KOBF|a-41)Td&til5oyLFh=9BXZ(yY!qfEnG{f`V!*qh zZ%MFe>ZU=3zTn5XD=FP25VcSNW@@p#oi1sD#9nrk;F@r`V2Q5o>)Q{IRHe3EW5Z%g z>-tt@A0cr{S&&jH0A+k8*%43aEA zPf>{lEk!WKq$ZTuPL{Y)V$YISX0=$ZMwWy=O_t=BCBahY)pBI9SS=TatH}~8qy}T{ zMGK^YNCnfV*!?VtBFSZo%WX!LaU4oMS#sotB-+^Qe|X(Vf}GxlB#z%rm%tgxZ%cXJ z1Hv|TrX(DbcVU#!*$hddc{sh^iAZ41O4f>VA*51Drj%4th8#&n8fwf`G1hsL%(%xR zV=Q6eSu0tus2FD}V!aL-WJ!Wh2qTKP(4CJkqB5W^R2&rN31*md*Eufkt$(po z)uirhq#Dv)q&oHM?|k2PiX_o_{Ex^ASs^QAg{+VjvO-qKV}X45@ZG7?;puD3A)kDE z>l8o%5g>haN6oJVAfNN&5BX5Ic!0!Lj*58l&Xkbtm#-IroE-xX;_1o$(?5Uz#v#tk zK#s4&-M??Wy3Co`2;bxP#m>z4#FjfV3%M^Z@_r3Ky~i2fo^$8MTgxDK?@t@D{rV}k z-z|j98S>I!|Ad#9dopdv7k=gSW$SXl_Y zj8;u2vG};M8fYm+J;{L1lvKzvW$cyovn0bDR0nmWP{fV~Y3VvZW9K%p2J`?KNqmeE6=9(D={uEu1r~8#uGj2tY1QzglyubT`URJU9m6BVkMgp`*oj^+XlCf zGScW3A=YdkomW*gZ2pMSM%jsk2UXB3Ktw~_ee`iXWTbwK?pnALi9zKmN+gJec=NO2 z#_v}BXxS5}D!rm7iZ{ErN0i);3yVvQKQ^09efh{HjF(Ug<8kHWj_+EIBRVy*Nl1t_ zBPDHehf$Vijgz{bvVM9&>Ns43=%9hBvz`6w(v;Ee<&V5;9&?NEQCmU5@i1; znEMOP1jL%{qw}xM;1qy2(|1FAc|kzf*>BU)nlWBO+{x`v{{*1^X8*hD*Jh$MmoCu| zZf7CW(V8`0bg+mod(1>@9wN!;g^%?g0xM*NtdJG5LRQHC6Y?(^ WR?AX;M{L>v0000 Date: Fri, 9 Dec 2011 13:28:03 +0100 Subject: [PATCH 160/233] [IMP] icon management in modules * If icon is present in descriptor file, use that path * Else try to find #{module}/static/src/img/icon.png * Else fallback on /base/static/src/img/icon.png bzr revid: xmo@openerp.com-20111209122803-elwonegpl8kut7pf --- .../static/src/img/{kanban_partner.png => icon.png} | Bin openerp/modules/module.py | 7 ++++++- 2 files changed, 6 insertions(+), 1 deletion(-) rename openerp/addons/base/static/src/img/{kanban_partner.png => icon.png} (100%) diff --git a/openerp/addons/base/static/src/img/kanban_partner.png b/openerp/addons/base/static/src/img/icon.png similarity index 100% rename from openerp/addons/base/static/src/img/kanban_partner.png rename to openerp/addons/base/static/src/img/icon.png diff --git a/openerp/modules/module.py b/openerp/modules/module.py index 899fa6efece..7f934275894 100644 --- a/openerp/modules/module.py +++ b/openerp/modules/module.py @@ -218,6 +218,11 @@ def get_module_resource(module, *args): return resource_path return False +def get_module_icon(module): + iconpath = ['static', 'src', 'img', 'icon.png'] + if get_module_resource(module, *iconpath): + return ('/' + module + '/') + '/'.join(iconpath) + return '/base/' + '/'.join(iconpath) def load_information_from_description_file(module): """ @@ -241,7 +246,7 @@ def load_information_from_description_file(module): 'complexity': 'normal', 'depends': [], 'description': '', - 'icon': None, + 'icon': get_module_icon(module), 'installable': True, 'license': 'AGPL-3', 'name': False, From 7010922d50f5e1e37f2050dbee1a6a5c7e6de4d7 Mon Sep 17 00:00:00 2001 From: "Yogesh (OpenERP)" Date: Fri, 9 Dec 2011 18:05:14 +0530 Subject: [PATCH 161/233] [FIX] clear value of date and datetime widget in search view on clear button. lp bug: https://launchpad.net/bugs/901665 fixed bzr revid: ysa@tinyerp.com-20111209123514-c54e5ea9tqjuc34s --- addons/web/static/src/js/search.js | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/addons/web/static/src/js/search.js b/addons/web/static/src/js/search.js index c3e27fc52be..0be95af2571 100644 --- a/addons/web/static/src/js/search.js +++ b/addons/web/static/src/js/search.js @@ -7,7 +7,7 @@ openerp.web.SearchView = openerp.web.Widget.extend(/** @lends openerp.web.Search /** * @constructs openerp.web.SearchView * @extends openerp.web.Widget - * + * * @param parent * @param element_id * @param dataset @@ -155,7 +155,7 @@ openerp.web.SearchView = openerp.web.Widget.extend(/** @lends openerp.web.Search var ext = new openerp.web.search.ExtendedSearch(this, this.model); lines.push([ext]); this.inputs.push(ext); - + var render = QWeb.render("SearchView", { 'view': data.fields_view['arch'], 'lines': lines, @@ -177,7 +177,7 @@ openerp.web.SearchView = openerp.web.Widget.extend(/** @lends openerp.web.Search $.when.apply(null, widget_starts).then(function () { self.ready.resolve(); }); - + this.reload_managed_filters(); }, reload_managed_filters: function() { @@ -409,6 +409,11 @@ openerp.web.SearchView = openerp.web.Widget.extend(/** @lends openerp.web.Search this.$element.find('table:last').hide(); $('.searchview_extended_groups_list').empty(); + _.each(this.inputs, function (input) { + if(input.datewidget && input.datewidget.value) { + input.datewidget.value = false; + } + }); setTimeout(this.on_clear, 0); }, /** @@ -1209,7 +1214,7 @@ openerp.web.search.ExtendedSearchProposition = openerp.web.OldWidget.extend(/** this.$element.find('.searchview_extended_prop_value').html( this.value.render({})); this.value.start(); - + }, get_proposition: function() { if ( this.attrs.selected == null) @@ -1356,7 +1361,7 @@ openerp.web.search.custom_filters = new openerp.web.Registry({ 'one2many': 'openerp.web.search.ExtendedSearchProposition.Char', 'many2one': 'openerp.web.search.ExtendedSearchProposition.Char', 'many2many': 'openerp.web.search.ExtendedSearchProposition.Char', - + 'datetime': 'openerp.web.search.ExtendedSearchProposition.DateTime', 'date': 'openerp.web.search.ExtendedSearchProposition.Date', 'integer': 'openerp.web.search.ExtendedSearchProposition.Integer', From 1feae8fa0c7e2c167cecac2f2c2af5aeec27fef0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Roberto=20L=C3=B3pez=20L=C3=B3pez=20=28OpenERP=29?= Date: Fri, 9 Dec 2011 14:19:29 +0100 Subject: [PATCH 162/233] modified according to review bzr revid: rlo@openerp.com-20111209131929-l672qxik23y4pka4 --- addons/web_livechat/static/src/js/web_livechat.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/addons/web_livechat/static/src/js/web_livechat.js b/addons/web_livechat/static/src/js/web_livechat.js index 5b5c4b3778e..36fd79cd1fa 100644 --- a/addons/web_livechat/static/src/js/web_livechat.js +++ b/addons/web_livechat/static/src/js/web_livechat.js @@ -40,7 +40,7 @@ openerp.web_livechat.Livechat = openerp.web.Widget.extend({ pwc.get_func('is_livechat_enable')().then(function(res) { console.log('result', res); if(res) { - self.$element.find('a').click(self.do_load_livechat); + self.$element.click(self.do_load_livechat); } else { self.do_action({type: 'ir.act.url', url: 'http://www.openerp.com/support-or-publisher-warranty-contract'}); } @@ -62,7 +62,7 @@ openerp.web_livechat.Livechat = openerp.web.Widget.extend({ evt.preventDefault(); var self = this; - this.$element.find('Header_Livechat').unbind('click', this.do_load_livechat); + this.$element.unbind('click', this.do_load_livechat); var lc_id = _.uniqueId('livechat_'); this.$element.attr('id', lc_id); From f9e55d29af050480911c15940daa057bb7da6000 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Roberto=20L=C3=B3pez=20L=C3=B3pez=20=28OpenERP=29?= Date: Fri, 9 Dec 2011 14:20:37 +0100 Subject: [PATCH 163/233] modified according to review bzr revid: rlo@openerp.com-20111209132037-d431geng6nfk00pp --- addons/web_livechat/static/src/js/web_livechat.js | 1 - 1 file changed, 1 deletion(-) diff --git a/addons/web_livechat/static/src/js/web_livechat.js b/addons/web_livechat/static/src/js/web_livechat.js index 36fd79cd1fa..d082734c456 100644 --- a/addons/web_livechat/static/src/js/web_livechat.js +++ b/addons/web_livechat/static/src/js/web_livechat.js @@ -22,7 +22,6 @@ var __lc_buttons = []; openerp.web_livechat = function (openerp) { - openerp.web_livechat.Livechat = openerp.web.Widget.extend({ template: 'Header-LiveChat', From 76ec7bea0598373d26f3e80d805b9c46a78585eb Mon Sep 17 00:00:00 2001 From: "Vidhin Mehta (OpenERP)" Date: Fri, 9 Dec 2011 19:18:09 +0530 Subject: [PATCH 164/233] [IMP]used pipe instead of then, bzr revid: vme@tinyerp.com-20111209134809-l7rh0th8lgk5gz2i --- addons/web/static/src/js/views.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/addons/web/static/src/js/views.js b/addons/web/static/src/js/views.js index 0d8621ddd49..2237665a10d 100644 --- a/addons/web/static/src/js/views.js +++ b/addons/web/static/src/js/views.js @@ -498,16 +498,16 @@ session.web.ViewManagerAction = session.web.ViewManager.extend(/** @lends oepner }, on_mode_switch: function (view_type, no_store) { var self = this; - - var switched = $.when(this._super(view_type, no_store)).then(function () { + + var switched = $.when(this._super(view_type, no_store)).pipe(function () { + self.shortcut_check(self.views[view_type]); self.$element.find('.oe-view-manager-logs:first') .addClass('oe-folded').removeClass('oe-has-more') .find('ul').empty(); - self.shortcut_check(self.views[view_type]); }); return $.when( switched - ).then(function() { + ).pipe(function() { var controller = self.views[self.active_view].controller, fvg = controller.fields_view, view_id = (fvg && fvg.view_id) || '--'; From c3bbd5c2d7db7f46fe1535edaaf60e314f553cf0 Mon Sep 17 00:00:00 2001 From: Antony Lesuisse Date: Fri, 9 Dec 2011 15:28:39 +0100 Subject: [PATCH 165/233] [MERGE] manual outlook plugin no binary yet bzr revid: al@openerp.com-20111209142839-wffacq9r3ckjxi3s --- addons/crm/crm_lead.py | 5 +- addons/hr_recruitment/hr_recruitment.py | 5 +- addons/mail/mail_message.py | 5 + addons/mail/mail_thread.py | 8 + addons/outlook/README | 29 - addons/outlook/__openerp__.py | 4 +- addons/outlook/installer.py | 17 +- addons/outlook/outlook_installer.xml | 4 +- .../Register-plugin.bat | 2 - .../Unregister-plugin.bat | 2 - .../plugin/openerp-outlook-plugin/addin.py | 301 - .../plugin/openerp-outlook-plugin/chilkat.py | 5609 ----------------- .../dialogs/__init__.py | 83 - .../dialogs/dialog_map.py | 1810 ------ .../openerp-outlook-plugin/dialogs/dlgcore.py | 325 - .../dialogs/dlgutils.py | 20 - .../dialogs/opt_processors.py | 320 - .../dialogs/processors.py | 147 - .../dialogs/resources/OpenERP_Logo.bmp | Bin 80062 -> 0 bytes .../dialogs/resources/__init__.py | 32 - .../dialogs/resources/dialogs.h | 224 - .../dialogs/resources/dialogs.py | 13 - .../dialogs/resources/dialogs.rc | 339 - .../dialogs/resources/openerp_logo.png | Bin 11053 -> 0 bytes .../dialogs/resources/openerp_logo1.bmp | Bin 306 -> 0 bytes .../dialogs/resources/rc2py.py | 41 - .../dialogs/resources/rcparser.py | 379 -- .../plugin/openerp-outlook-plugin/eml.py | 95 - .../plugin/openerp-outlook-plugin/manager.py | 195 - .../plugin/openerp-outlook-plugin/setup.iss | 105 - .../openerp-outlook-plugin/tiny_xmlrpc.py | 573 -- .../OpenERPClient/Model.cs | 78 + .../OpenERPClient/OpenERPClient.csproj | 69 + .../OpenERPClient/OpenERPConnect.cs | 397 ++ .../OpenERPClient/Properties/AssemblyInfo.cs | 36 + .../OpenERPClient/Record.cs | 69 + .../OpenERPClient/XMLRPCClient.cs | 388 ++ .../OpenERPOutlookPlugin.sln | 36 + .../OpenERPOutlookPlugin/AssemblyInfo.cs | 52 + .../OpenERPOutlookPlugin/Cache.cs | 55 + .../OpenERPOutlookPlugin/ConfigManager.cs | 109 + .../OpenERPOutlookPlugin/Connect.cs | 354 ++ .../OpenERPOutlookPlugin.cs | 223 + .../OpenERPOutlookPlugin.csproj | 235 + .../OpenERPOutlookPlugin.csproj.user | 12 + .../Properties/Resources.Designer.cs | 119 + .../Properties/Resources.resx | 145 + .../Properties/Settings.Designer.cs | 26 + .../Properties/Settings.settings | 6 + .../195737_152643643962_3595480_n.jpg | Bin 0 -> 6784 bytes .../Resources/Account.ico | Bin 0 -> 1150 bytes .../Resources/Account.png | Bin 0 -> 897 bytes .../Resources/Archive.png | Bin 0 -> 852 bytes .../OpenERPOutlookPlugin/Resources/Case.png | Bin 0 -> 816 bytes .../Resources/Contact.png | Bin 0 -> 703 bytes .../OpenERPOutlookPlugin/Resources/Create.png | Bin 0 -> 888 bytes .../OpenERPOutlookPlugin/Resources/Error.gif | Bin 0 -> 1037 bytes .../Resources/Invoice.png | Bin 0 -> 852 bytes .../OpenERPOutlookPlugin/Resources/Move.gif | Bin 0 -> 155 bytes .../Resources/MoveDown.png | Bin 0 -> 352 bytes .../Resources/MoveLeft.png | Bin 0 -> 363 bytes .../Resources/OpenERP_icon.ico | Bin 0 -> 12862 bytes .../Resources/Partner.png | Bin 0 -> 790 bytes .../Resources/Product.png | Bin 0 -> 796 bytes .../Resources/Project.png | Bin 0 -> 823 bytes .../OpenERPOutlookPlugin/Resources/Sale.png | Bin 0 -> 802 bytes .../OpenERPOutlookPlugin/Resources/Search.gif | Bin 0 -> 582 bytes .../Resources/Success.gif | Bin 0 -> 604 bytes .../OpenERPOutlookPlugin/Resources/Task.png | Bin 0 -> 867 bytes .../Resources/developped_by.png | Bin 0 -> 7192 bytes .../OpenERPOutlookPlugin/Resources/logo.png | Bin 0 -> 3981 bytes .../Resources/openerp.png | Bin 0 -> 2611 bytes .../Resources/perform.gif | Bin 0 -> 89 bytes .../Resources/settings.png | Bin 0 -> 2455 bytes .../OpenERPOutlookPlugin/Tools.cs | 173 + .../frm_choose_document_opt.Designer.cs | 137 + .../frm_choose_document_opt.cs | 98 + .../frm_choose_document_opt.resx | 153 + .../OpenERPOutlookPlugin/frm_contact.cs | 77 + .../frm_contact.designer.cs | 166 + .../OpenERPOutlookPlugin/frm_contact.resx | 180 + .../frm_create_doc.Designer.cs | 127 + .../OpenERPOutlookPlugin/frm_create_doc.cs | 79 + .../OpenERPOutlookPlugin/frm_create_doc.resx | 145 + .../frm_openerp_configuration.Designer.cs | 334 + .../frm_openerp_configuration.cs | 216 + .../frm_openerp_configuration.resx | 455 ++ .../frm_openerp_connection.Designer.cs | 162 + .../frm_openerp_connection.cs | 79 + .../frm_openerp_connection.resx | 180 + .../OpenERPOutlookPlugin/frm_partner.cs | 77 + .../frm_partner.designer.cs | 106 + .../OpenERPOutlookPlugin/frm_partner.resx | 180 + .../OpenERPOutlookPlugin/frm_push_mail.cs | 149 + .../frm_push_mail.designer.cs | 202 + .../OpenERPOutlookPlugin/frm_push_mail.resx | 145 + .../frm_select_partner.Designer.cs | 141 + .../frm_select_partner.cs | 121 + .../frm_select_partner.resx | 194 + .../OpenERPOutlookPluginSetup.vdproj | 988 +++ addons/plugin/plugin_handler.py | 44 +- 101 files changed, 7529 insertions(+), 10680 deletions(-) delete mode 100644 addons/outlook/README delete mode 100644 addons/outlook/plugin/openerp-outlook-plugin/Register-plugin.bat delete mode 100644 addons/outlook/plugin/openerp-outlook-plugin/Unregister-plugin.bat delete mode 100644 addons/outlook/plugin/openerp-outlook-plugin/addin.py delete mode 100644 addons/outlook/plugin/openerp-outlook-plugin/chilkat.py delete mode 100644 addons/outlook/plugin/openerp-outlook-plugin/dialogs/__init__.py delete mode 100644 addons/outlook/plugin/openerp-outlook-plugin/dialogs/dialog_map.py delete mode 100644 addons/outlook/plugin/openerp-outlook-plugin/dialogs/dlgcore.py delete mode 100644 addons/outlook/plugin/openerp-outlook-plugin/dialogs/dlgutils.py delete mode 100644 addons/outlook/plugin/openerp-outlook-plugin/dialogs/opt_processors.py delete mode 100644 addons/outlook/plugin/openerp-outlook-plugin/dialogs/processors.py delete mode 100644 addons/outlook/plugin/openerp-outlook-plugin/dialogs/resources/OpenERP_Logo.bmp delete mode 100644 addons/outlook/plugin/openerp-outlook-plugin/dialogs/resources/__init__.py delete mode 100644 addons/outlook/plugin/openerp-outlook-plugin/dialogs/resources/dialogs.h delete mode 100644 addons/outlook/plugin/openerp-outlook-plugin/dialogs/resources/dialogs.py delete mode 100644 addons/outlook/plugin/openerp-outlook-plugin/dialogs/resources/dialogs.rc delete mode 100644 addons/outlook/plugin/openerp-outlook-plugin/dialogs/resources/openerp_logo.png delete mode 100644 addons/outlook/plugin/openerp-outlook-plugin/dialogs/resources/openerp_logo1.bmp delete mode 100644 addons/outlook/plugin/openerp-outlook-plugin/dialogs/resources/rc2py.py delete mode 100644 addons/outlook/plugin/openerp-outlook-plugin/dialogs/resources/rcparser.py delete mode 100644 addons/outlook/plugin/openerp-outlook-plugin/eml.py delete mode 100644 addons/outlook/plugin/openerp-outlook-plugin/manager.py delete mode 100644 addons/outlook/plugin/openerp-outlook-plugin/setup.iss delete mode 100644 addons/outlook/plugin/openerp-outlook-plugin/tiny_xmlrpc.py create mode 100644 addons/outlook/static/openerp-outlook-plugin/OpenERPClient/Model.cs create mode 100644 addons/outlook/static/openerp-outlook-plugin/OpenERPClient/OpenERPClient.csproj create mode 100644 addons/outlook/static/openerp-outlook-plugin/OpenERPClient/OpenERPConnect.cs create mode 100644 addons/outlook/static/openerp-outlook-plugin/OpenERPClient/Properties/AssemblyInfo.cs create mode 100644 addons/outlook/static/openerp-outlook-plugin/OpenERPClient/Record.cs create mode 100644 addons/outlook/static/openerp-outlook-plugin/OpenERPClient/XMLRPCClient.cs create mode 100644 addons/outlook/static/openerp-outlook-plugin/OpenERPOutlookPlugin.sln create mode 100644 addons/outlook/static/openerp-outlook-plugin/OpenERPOutlookPlugin/AssemblyInfo.cs create mode 100644 addons/outlook/static/openerp-outlook-plugin/OpenERPOutlookPlugin/Cache.cs create mode 100644 addons/outlook/static/openerp-outlook-plugin/OpenERPOutlookPlugin/ConfigManager.cs create mode 100644 addons/outlook/static/openerp-outlook-plugin/OpenERPOutlookPlugin/Connect.cs create mode 100644 addons/outlook/static/openerp-outlook-plugin/OpenERPOutlookPlugin/OpenERPOutlookPlugin.cs create mode 100644 addons/outlook/static/openerp-outlook-plugin/OpenERPOutlookPlugin/OpenERPOutlookPlugin.csproj create mode 100644 addons/outlook/static/openerp-outlook-plugin/OpenERPOutlookPlugin/OpenERPOutlookPlugin.csproj.user create mode 100644 addons/outlook/static/openerp-outlook-plugin/OpenERPOutlookPlugin/Properties/Resources.Designer.cs create mode 100644 addons/outlook/static/openerp-outlook-plugin/OpenERPOutlookPlugin/Properties/Resources.resx create mode 100644 addons/outlook/static/openerp-outlook-plugin/OpenERPOutlookPlugin/Properties/Settings.Designer.cs create mode 100644 addons/outlook/static/openerp-outlook-plugin/OpenERPOutlookPlugin/Properties/Settings.settings create mode 100644 addons/outlook/static/openerp-outlook-plugin/OpenERPOutlookPlugin/Resources/195737_152643643962_3595480_n.jpg create mode 100644 addons/outlook/static/openerp-outlook-plugin/OpenERPOutlookPlugin/Resources/Account.ico create mode 100644 addons/outlook/static/openerp-outlook-plugin/OpenERPOutlookPlugin/Resources/Account.png create mode 100644 addons/outlook/static/openerp-outlook-plugin/OpenERPOutlookPlugin/Resources/Archive.png create mode 100644 addons/outlook/static/openerp-outlook-plugin/OpenERPOutlookPlugin/Resources/Case.png create mode 100644 addons/outlook/static/openerp-outlook-plugin/OpenERPOutlookPlugin/Resources/Contact.png create mode 100644 addons/outlook/static/openerp-outlook-plugin/OpenERPOutlookPlugin/Resources/Create.png create mode 100644 addons/outlook/static/openerp-outlook-plugin/OpenERPOutlookPlugin/Resources/Error.gif create mode 100644 addons/outlook/static/openerp-outlook-plugin/OpenERPOutlookPlugin/Resources/Invoice.png create mode 100644 addons/outlook/static/openerp-outlook-plugin/OpenERPOutlookPlugin/Resources/Move.gif create mode 100644 addons/outlook/static/openerp-outlook-plugin/OpenERPOutlookPlugin/Resources/MoveDown.png create mode 100644 addons/outlook/static/openerp-outlook-plugin/OpenERPOutlookPlugin/Resources/MoveLeft.png create mode 100644 addons/outlook/static/openerp-outlook-plugin/OpenERPOutlookPlugin/Resources/OpenERP_icon.ico create mode 100644 addons/outlook/static/openerp-outlook-plugin/OpenERPOutlookPlugin/Resources/Partner.png create mode 100644 addons/outlook/static/openerp-outlook-plugin/OpenERPOutlookPlugin/Resources/Product.png create mode 100644 addons/outlook/static/openerp-outlook-plugin/OpenERPOutlookPlugin/Resources/Project.png create mode 100644 addons/outlook/static/openerp-outlook-plugin/OpenERPOutlookPlugin/Resources/Sale.png create mode 100644 addons/outlook/static/openerp-outlook-plugin/OpenERPOutlookPlugin/Resources/Search.gif create mode 100644 addons/outlook/static/openerp-outlook-plugin/OpenERPOutlookPlugin/Resources/Success.gif create mode 100644 addons/outlook/static/openerp-outlook-plugin/OpenERPOutlookPlugin/Resources/Task.png create mode 100644 addons/outlook/static/openerp-outlook-plugin/OpenERPOutlookPlugin/Resources/developped_by.png create mode 100644 addons/outlook/static/openerp-outlook-plugin/OpenERPOutlookPlugin/Resources/logo.png create mode 100644 addons/outlook/static/openerp-outlook-plugin/OpenERPOutlookPlugin/Resources/openerp.png create mode 100644 addons/outlook/static/openerp-outlook-plugin/OpenERPOutlookPlugin/Resources/perform.gif create mode 100644 addons/outlook/static/openerp-outlook-plugin/OpenERPOutlookPlugin/Resources/settings.png create mode 100644 addons/outlook/static/openerp-outlook-plugin/OpenERPOutlookPlugin/Tools.cs create mode 100644 addons/outlook/static/openerp-outlook-plugin/OpenERPOutlookPlugin/frm_choose_document_opt.Designer.cs create mode 100644 addons/outlook/static/openerp-outlook-plugin/OpenERPOutlookPlugin/frm_choose_document_opt.cs create mode 100644 addons/outlook/static/openerp-outlook-plugin/OpenERPOutlookPlugin/frm_choose_document_opt.resx create mode 100644 addons/outlook/static/openerp-outlook-plugin/OpenERPOutlookPlugin/frm_contact.cs create mode 100644 addons/outlook/static/openerp-outlook-plugin/OpenERPOutlookPlugin/frm_contact.designer.cs create mode 100644 addons/outlook/static/openerp-outlook-plugin/OpenERPOutlookPlugin/frm_contact.resx create mode 100644 addons/outlook/static/openerp-outlook-plugin/OpenERPOutlookPlugin/frm_create_doc.Designer.cs create mode 100644 addons/outlook/static/openerp-outlook-plugin/OpenERPOutlookPlugin/frm_create_doc.cs create mode 100644 addons/outlook/static/openerp-outlook-plugin/OpenERPOutlookPlugin/frm_create_doc.resx create mode 100644 addons/outlook/static/openerp-outlook-plugin/OpenERPOutlookPlugin/frm_openerp_configuration.Designer.cs create mode 100644 addons/outlook/static/openerp-outlook-plugin/OpenERPOutlookPlugin/frm_openerp_configuration.cs create mode 100644 addons/outlook/static/openerp-outlook-plugin/OpenERPOutlookPlugin/frm_openerp_configuration.resx create mode 100644 addons/outlook/static/openerp-outlook-plugin/OpenERPOutlookPlugin/frm_openerp_connection.Designer.cs create mode 100644 addons/outlook/static/openerp-outlook-plugin/OpenERPOutlookPlugin/frm_openerp_connection.cs create mode 100644 addons/outlook/static/openerp-outlook-plugin/OpenERPOutlookPlugin/frm_openerp_connection.resx create mode 100644 addons/outlook/static/openerp-outlook-plugin/OpenERPOutlookPlugin/frm_partner.cs create mode 100644 addons/outlook/static/openerp-outlook-plugin/OpenERPOutlookPlugin/frm_partner.designer.cs create mode 100644 addons/outlook/static/openerp-outlook-plugin/OpenERPOutlookPlugin/frm_partner.resx create mode 100644 addons/outlook/static/openerp-outlook-plugin/OpenERPOutlookPlugin/frm_push_mail.cs create mode 100644 addons/outlook/static/openerp-outlook-plugin/OpenERPOutlookPlugin/frm_push_mail.designer.cs create mode 100644 addons/outlook/static/openerp-outlook-plugin/OpenERPOutlookPlugin/frm_push_mail.resx create mode 100644 addons/outlook/static/openerp-outlook-plugin/OpenERPOutlookPlugin/frm_select_partner.Designer.cs create mode 100644 addons/outlook/static/openerp-outlook-plugin/OpenERPOutlookPlugin/frm_select_partner.cs create mode 100644 addons/outlook/static/openerp-outlook-plugin/OpenERPOutlookPlugin/frm_select_partner.resx create mode 100644 addons/outlook/static/openerp-outlook-plugin/OpenERPOutlookPluginSetup/OpenERPOutlookPluginSetup.vdproj diff --git a/addons/crm/crm_lead.py b/addons/crm/crm_lead.py index 49272c97576..216a898bc88 100644 --- a/addons/crm/crm_lead.py +++ b/addons/crm/crm_lead.py @@ -748,10 +748,11 @@ class crm_lead(crm_case, osv.osv): self.write(cr, uid, [res_id], vals, context) return res_id - def message_update(self, cr, uid, ids, msg, vals={}, default_act='pending', context=None): + def message_update(self, cr, uid, ids, msg, vals=None, default_act='pending', context=None): if isinstance(ids, (str, int, long)): ids = [ids] - + if vals == None: + vals = {} super(crm_lead, self).message_update(cr, uid, ids, msg, context=context) if msg.get('priority') in dict(crm.AVAILABLE_PRIORITIES): diff --git a/addons/hr_recruitment/hr_recruitment.py b/addons/hr_recruitment/hr_recruitment.py index dbf0930c6bd..f81a2a8cd52 100644 --- a/addons/hr_recruitment/hr_recruitment.py +++ b/addons/hr_recruitment/hr_recruitment.py @@ -365,10 +365,11 @@ class hr_applicant(crm.crm_case, osv.osv): self.write(cr, uid, [res_id], vals, context) return res_id - def message_update(self, cr, uid, ids, msg, vals={}, default_act='pending', context=None): + def message_update(self, cr, uid, ids, msg, vals=None, default_act='pending', context=None): if isinstance(ids, (str, int, long)): ids = [ids] - + if vals is None: + vals = {} msg_from = msg['from'] vals.update({ 'description': msg['body_text'] diff --git a/addons/mail/mail_message.py b/addons/mail/mail_message.py index 159259f151d..fd00135816e 100644 --- a/addons/mail/mail_message.py +++ b/addons/mail/mail_message.py @@ -380,12 +380,16 @@ class mail_message(osv.osv): if 'To' in fields: msg['to'] = decode(msg_txt.get('To')) + if 'Delivered-To' in fields: msg['to'] = decode(msg_txt.get('Delivered-To')) if 'CC' in fields: msg['cc'] = decode(msg_txt.get('CC')) + if 'Cc' in fields: + msg['cc'] = decode(msg_txt.get('Cc')) + if 'Reply-To' in fields: msg['reply'] = decode(msg_txt.get('Reply-To')) @@ -455,6 +459,7 @@ class mail_message(osv.osv): msg['sub_type'] = msg['subtype'] or 'plain' return msg + def send(self, cr, uid, ids, auto_commit=False, context=None): """Sends the selected emails immediately, ignoring their current state (mails that have already been sent should not be passed diff --git a/addons/mail/mail_thread.py b/addons/mail/mail_thread.py index c8f7da9a5bb..70b536296bf 100644 --- a/addons/mail/mail_thread.py +++ b/addons/mail/mail_thread.py @@ -58,6 +58,14 @@ class mail_thread(osv.osv): 'message_ids': fields.one2many('mail.message', 'res_id', 'Messages', readonly=True), } + def message_capable_models(self, cr, uid, context=None): + ret_dict = {} + for model_name in self.pool.obj_list(): + model = self.pool.get(model_name) + if 'mail.thread' in getattr(model, '_inherit', []): + ret_dict[model_name] = model._description + return ret_dict + def message_thread_followers(self, cr, uid, ids, context=None): """Returns a list of email addresses of the people following this thread, including the sender of each mail, and the diff --git a/addons/outlook/README b/addons/outlook/README deleted file mode 100644 index 93f735ac1f8..00000000000 --- a/addons/outlook/README +++ /dev/null @@ -1,29 +0,0 @@ -OpenERP Outlook PLUG-IN Installation Guide - -Pre requirements : -====================================================================================== - 1.Python 2.6+ . python can be downloaded from http://www.python.org/download/releases/ . - 2.Python for Windows extensions - PyWin32 this module for python must be installed for appropriate version of the Python. It can be downloaded from - http://sourceforge.net/projects/pywin32/ or - http://starship.python.net/crew/mhammond/win32/ - 3.If you are using MS Outlook 2007 than you are required to install "Microsoft Exchange Server MAPI Client and Collaboration Data Objects 1.2.1 (CDO 1.21)". It can be downloaded from - http://www.microsoft.com/downloads/en/details.aspx?FamilyID=2714320D-C997-4DE1-986F-24F081725D36&displaylang=en - and With MS Outlook2003 Install inbuilt Collaboration Data Objects(CDO) while installing Outlook. - To read more regarding Collaboration Data Objects(CDO) click following link: - + http://support.microsoft.com/kb/171440 - -How to install openerp-outlook plug-in? -====================================================================================== - 1. Save the executable plug-in file. - 2. Close Outlook Application if Running. - 3. Run executable plug-in file and the folllow the instruction. - -How to uninstall openerp-outlook plug-in? -===================================================================================== - 1. Go to Control Panel Click "Add/Remove Programmes" - 2. You will entry, you will find entry named 'OpenERP Outlook Addin 1.0' select it and click Uninstall. - -Note : Plug In has been successfully tested with MS Office 2003 and MS Offcie 2007. - -Enjoy Archiving your Outlook E-mails to OpenERP. - diff --git a/addons/outlook/__openerp__.py b/addons/outlook/__openerp__.py index beab5aca648..9d1c5a554f4 100644 --- a/addons/outlook/__openerp__.py +++ b/addons/outlook/__openerp__.py @@ -25,7 +25,7 @@ 'version' : '1.0', 'author' : 'OpenERP SA', 'website' : 'http://www.openerp.com/', - 'depends' : ['base', 'mail'], + 'depends' : ['base', 'mail','plugin'], 'category' : 'Customer Relationship Management', 'description': ''' This module provides the Outlook Plug-in. @@ -33,7 +33,7 @@ This module provides the Outlook Plug-in. Outlook plug-in allows you to select an object that you’d like to add to your email and its attachments from MS Outlook. You can select a partner, a task, a project, an analytical account, or any other object and archive selected -mail into email.messages with attachments. +mail into mail.message with attachments. ''', 'init_xml' : [], 'demo_xml' : [], diff --git a/addons/outlook/installer.py b/addons/outlook/installer.py index 061c27da5e5..602afe0845d 100644 --- a/addons/outlook/installer.py +++ b/addons/outlook/installer.py @@ -32,7 +32,7 @@ class outlook_installer(osv.osv_memory): def default_get(self, cr, uid, fields, context=None): data = super(outlook_installer, self).default_get(cr, uid, fields, context=context) data['doc_file'] = 'http://doc.openerp.com/book/2/2_6_Comms/2_6_Comms_outlook.html' - file = open(addons.get_module_resource('outlook','plugin','openerp-outlook-addin.exe'), 'r') + file = open(addons.get_module_resource('outlook','plugin','openerp-outlook-plugin_v2.0','OpenERPOutlookPluginSetup','Release','OpenERPOutlookPluginSetup.msi'), 'r') data['plugin_file'] = base64.encodestring(file.read()) return data @@ -47,21 +47,18 @@ class outlook_installer(osv.osv_memory): _defaults = { 'outlook' : True, - 'name' : 'Openerp-Outlook-Addin.exe', + 'name' : 'OpenERPOutlookPlugin.msi', 'doc_name' : 'Installation Guide to OpenERP Outlook Plug-in.doc', 'description' : """ System requirements: - 1. Python 2.6+. - 2. Python for Windows extensions (PyWin32); this module must be installed for the appropriate version of Python. - 3.1 With MS Outlook 2007, install the package Collaboration Data Objects, version 1.2.1, http://www.microsoft.com/downloads/en/details.aspx?FamilyID=2714320D-C997-4DE1-986F-24F081725D36 - 3.2 With MS Outlook 2003, install the builtin Collaboration Data Objects(CDO) while installing Outlook. + 1. MS Outlook 2005 or above. + 2. MS .Net Framework 3.5 . + Plugin installation: - 1. Save the executable plug-in file. + 1. Save the msi plug-in file. 2. Close the Outlook application if it is open. - 3. Run the executable plug-in file, and follow the given instructions. - -Please refer to the README file for dependencies (external link: openobject-addons/outlook/README). + 3. Run the executable plug-in file (OpenERPOutlookPlugin.msi). """ } outlook_installer() diff --git a/addons/outlook/outlook_installer.xml b/addons/outlook/outlook_installer.xml index 7e2b7cd6d58..4cdb0127631 100644 --- a/addons/outlook/outlook_installer.xml +++ b/addons/outlook/outlook_installer.xml @@ -14,7 +14,9 @@ Install Outlook Plug-In
- This plug-in allows you to link your e-mail to OpenERP's documents. You can attach it to any existing one in OpenERP or create a new one. + This plug-in allows you to create new contact or link contact to an existing partner. +Also allows to link your e-mail to OpenERP's documents. +You can attach it to any existing one in OpenERP or create a new one.