From 66ad2b91ccb6f7a23895e89069b6e2f99f9fc2e0 Mon Sep 17 00:00:00 2001 From: rga Date: Wed, 21 Apr 2010 14:23:38 +0530 Subject: [PATCH 01/42] [IMP] Custome filter's fields taranslation bzr revid: rga@rga-desktop-20100421085338-rdfvzuf8e6p6qhd2 --- bin/addons/base/ir/ir_actions.py | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/bin/addons/base/ir/ir_actions.py b/bin/addons/base/ir/ir_actions.py index 33be3fe99ee..11421046764 100644 --- a/bin/addons/base/ir/ir_actions.py +++ b/bin/addons/base/ir/ir_actions.py @@ -191,7 +191,7 @@ class act_window(osv.osv): return s.encode('utf8') return s for act in self.browse(cr, uid, ids): - fields_from_fields_get = self.pool.get(act.res_model).fields_get(cr, uid) + fields_from_fields_get = self.pool.get(act.res_model).fields_get(cr, uid,None,context) search_view_id = False if act.search_view_id: search_view_id = act.search_view_id.id @@ -387,13 +387,13 @@ class actions_server(osv.osv): line = rs[0], "%s - (%s)" % (rs[1], rs[0]) res.append(line) return res - + def _select_objects(self, cr, uid, context={}): model_pool = self.pool.get('ir.model') ids = model_pool.search(cr, uid, [('name','not ilike','.')]) res = model_pool.read(cr, uid, ids, ['model', 'name']) return [(r['model'], r['name']) for r in res] + [('','')] - + def change_object(self, cr, uid, ids, copy_object, state, context={}): if state == 'object_copy': model_pool = self.pool.get('ir.model') @@ -581,10 +581,10 @@ class actions_server(osv.osv): continue if not user: raise osv.except_osv(_('Error'), _("Please specify server option --smtp-from !")) - + subject = self.merge_message(cr, uid, action.subject, action, context) body = self.merge_message(cr, uid, action.message, action, context) - + if tools.email_send(user, [address], subject, body, debug=False, subtype='html') == True: logger.notifyChannel('email', netsvc.LOG_INFO, 'Email successfully send to : %s' % (address)) else: @@ -686,7 +686,7 @@ class actions_server(osv.osv): cr.commit() if action.record_id: self.pool.get(action.model_id.model).write(cr, uid, [context.get('active_id')], {action.record_id.name:res_id}) - + if action.state == 'object_copy': res = {} for exp in action.fields_lines: @@ -701,7 +701,7 @@ class actions_server(osv.osv): obj_pool = None res_id = False - + model = action.copy_object.split(',')[0] cid = action.copy_object.split(',')[1] obj_pool = self.pool.get(model) From 09c6859236341d32816c1cf96ee4a11b579c862d Mon Sep 17 00:00:00 2001 From: Stephane Wirtel Date: Tue, 27 Apr 2010 10:22:52 +0200 Subject: [PATCH 02/42] [FIX] Integrate the load_information_from_description_file function from addons in the module_graph script bzr revid: stephane@openerp.com-20100427082252-bfmb0yt0kwry9y6v --- bin/addons/module_graph.py | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/bin/addons/module_graph.py b/bin/addons/module_graph.py index edd7f6f947e..3eda4299c74 100755 --- a/bin/addons/module_graph.py +++ b/bin/addons/module_graph.py @@ -26,6 +26,17 @@ import os import sys import glob +def load_information_from_description_file(module): + """ + :param module: The name of the module (sale, purchase, ...) + """ + for filename in ['__openerp__.py', '__terp__.py']: + description_file = os.path.join(module, filename) + if os.path.isfile(description_file): + return eval(file(description_file).read()) + + return {} + if len(sys.argv) == 2 and (sys.argv[1] in ['-h', '--help']): print >>sys.stderr, 'Usage: module_graph.py [module1 module2 module3]\n\tWhen no module is specified, all modules in current directory are used' sys.exit(1) @@ -41,7 +52,7 @@ print 'digraph G {' while len(modules): f = modules.pop(0) done.append(f) - info = addons.load_information_from_description_file(f) + info = load_information_from_description_file(f) if info.get('installable', True): for name in info['depends']: if name not in done+modules: From 7e8edaa93356741bfc0b00494b4e401e9a77cce7 Mon Sep 17 00:00:00 2001 From: "nch@tinyerp.com" <> Date: Tue, 27 Apr 2010 14:19:03 +0530 Subject: [PATCH 03/42] [IMP]:base setup modules installation wizard bzr revid: nch@tinyerp.com-20100427084903-qunvhze3c1xegvwi --- addons/base_setup/base_setup_installer.xml | 10 +++++----- addons/base_setup/installer.py | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/addons/base_setup/base_setup_installer.xml b/addons/base_setup/base_setup_installer.xml index 7a6d61a0e08..e0c35667b63 100644 --- a/addons/base_setup/base_setup_installer.xml +++ b/addons/base_setup/base_setup_installer.xml @@ -21,15 +21,15 @@ If you don't think you need any of these right now, you can easily install them later on. - + - - - - + + + + diff --git a/addons/base_setup/installer.py b/addons/base_setup/installer.py index 2c1ba113e47..4b903f4e454 100644 --- a/addons/base_setup/installer.py +++ b/addons/base_setup/installer.py @@ -69,7 +69,7 @@ class base_setup_installer(osv.osv_memory): help="Helps you manage your marketing campaigns step by step."), 'misc_tools':fields.boolean('Miscellaneous Tools', help="Lets you install various interesting but non-essential " - "tools."), + "tools like Survey, Lunch,..."), 'report_designer':fields.boolean('Advanced Reporting', help="Lets you install various tools to simplify and enhance " "OpenERP's report creation."), From b0d6c3407f5ce2ede848df6549521c4a082c2b6d Mon Sep 17 00:00:00 2001 From: "nch@tinyerp.com" <> Date: Tue, 27 Apr 2010 14:22:53 +0530 Subject: [PATCH 04/42] [IMP]:Human resources modules installation wizard bzr revid: nch@tinyerp.com-20100427085253-k1kg13k25itlwytz --- addons/hr/hr_installer.xml | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/addons/hr/hr_installer.xml b/addons/hr/hr_installer.xml index ff6025cda64..4bbafbf9077 100644 --- a/addons/hr/hr_installer.xml +++ b/addons/hr/hr_installer.xml @@ -8,7 +8,7 @@
- Human Resources Modules Installation + Select Human Resources Modules To Install
@@ -19,7 +19,7 @@ The base Human Resources addon will help you manage your employee roster, but your can enhance it even further by installing a few HR-related applications. - + @@ -28,6 +28,9 @@ + + Configure +
From 15fe913df29513eaa59acad3f7eaafc3086680b6 Mon Sep 17 00:00:00 2001 From: "nch@tinyerp.com" <> Date: Tue, 27 Apr 2010 14:28:52 +0530 Subject: [PATCH 05/42] [IMP]:9.Project mgmt module installation wizard bzr revid: nch@tinyerp.com-20100427085852-b8mfsr6viok59jt1 --- addons/project/installer.py | 3 +++ addons/project/project_installer.xml | 8 ++++---- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/addons/project/installer.py b/addons/project/installer.py index 1848d1e300e..dd18a2937a2 100644 --- a/addons/project/installer.py +++ b/addons/project/installer.py @@ -52,4 +52,7 @@ class project_installer(osv.osv_memory): help="Embeds the Getting Things Done concepts into OpenERP's " "project management."), } + _defaults={ + 'project_crm': True, + } project_installer() diff --git a/addons/project/project_installer.xml b/addons/project/project_installer.xml index d7ca8c43989..3b6eb103972 100644 --- a/addons/project/project_installer.xml +++ b/addons/project/project_installer.xml @@ -21,13 +21,13 @@ - + + - - - + + From abc88397bd9551d71d86c64d652fbc1bbd759a25 Mon Sep 17 00:00:00 2001 From: "nch@tinyerp.com" <> Date: Tue, 27 Apr 2010 14:36:38 +0530 Subject: [PATCH 06/42] [IMP]:Company's data wizard bzr revid: nch@tinyerp.com-20100427090638-5qjx1nl7jpotf5dd --- addons/base_setup/base_setup_todo.xml | 53 +++++++++++++++------------ 1 file changed, 30 insertions(+), 23 deletions(-) diff --git a/addons/base_setup/base_setup_todo.xml b/addons/base_setup/base_setup_todo.xml index 08691e60d35..021e2d10a6c 100644 --- a/addons/base_setup/base_setup_todo.xml +++ b/addons/base_setup/base_setup_todo.xml @@ -12,31 +12,38 @@ - + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - + + + + - - - - - - - - + + + + + From f5f64e4dc6ffee6a96e882de58c5021a10c47024 Mon Sep 17 00:00:00 2001 From: "nch@tinyerp.com" <> Date: Tue, 27 Apr 2010 15:47:24 +0530 Subject: [PATCH 07/42] [IMP]:installation done wizard bzr revid: nch@tinyerp.com-20100427101724-z69y791xfbrfpl58 --- addons/base_setup/__init__.py | 22 +++++++++++++++++++--- addons/base_setup/base_setup_data.xml | 3 ++- 2 files changed, 21 insertions(+), 4 deletions(-) diff --git a/addons/base_setup/__init__.py b/addons/base_setup/__init__.py index e4a4c3c80d8..23aa4363d7e 100644 --- a/addons/base_setup/__init__.py +++ b/addons/base_setup/__init__.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- ############################################################################## -# +# # OpenERP, Open Source Management Solution # Copyright (C) 2004-2010 Tiny SPRL (). # @@ -15,7 +15,7 @@ # 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 . +# along with this program. If not, see . # ############################################################################## @@ -23,8 +23,9 @@ import installer import todo import wizard -from osv import osv +from osv import fields, osv import netsvc +from tools.translate import _ class base_setup_config_choice(osv.osv_memory): """ @@ -32,6 +33,21 @@ class base_setup_config_choice(osv.osv_memory): _name = 'base.setup.config' logger = netsvc.Logger() + def get_users(self, cr, uid, context={}): + user_obj = self.pool.get('res.users') + user_ids = user_obj.search(cr, uid, []) + users = user_obj.browse(cr, uid, user_ids) + user_str = '\n'.join(map(lambda x: ' - %s: %s / %s' % (x.name, x.login, x.password), users)) + return _('The following users have been installed on your database: \n')+ user_str + + _columns = { + 'installed_users':fields.text('Installed Users') + } + + _defaults = { + 'installed_users':get_users + } + def set_default_menu(self, cr, uid, menu, context=None): user = self.pool.get('res.users')\ .browse(cr, uid, uid, context=context) diff --git a/addons/base_setup/base_setup_data.xml b/addons/base_setup/base_setup_data.xml index 0feb39bd563..e7ab8698c7e 100644 --- a/addons/base_setup/base_setup_data.xml +++ b/addons/base_setup/base_setup_data.xml @@ -13,8 +13,9 @@
From 10a80d7175e80ea7e17cb210d9f542d3be5c7cca Mon Sep 17 00:00:00 2001 From: "nch@tinyerp.com" <> Date: Tue, 27 Apr 2010 18:40:07 +0530 Subject: [PATCH 08/42] [IMP]:made 'installed_users' a readonly field bzr revid: nch@tinyerp.com-20100427131007-exq1vlq00pjpa59z --- addons/base_setup/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/base_setup/__init__.py b/addons/base_setup/__init__.py index 23aa4363d7e..ef4f321942d 100644 --- a/addons/base_setup/__init__.py +++ b/addons/base_setup/__init__.py @@ -41,7 +41,7 @@ class base_setup_config_choice(osv.osv_memory): return _('The following users have been installed on your database: \n')+ user_str _columns = { - 'installed_users':fields.text('Installed Users') + 'installed_users':fields.text('Installed Users', readonly=True) } _defaults = { From f695aa4440c15f81626871215226badeac30c677 Mon Sep 17 00:00:00 2001 From: Launchpad Code Hosting Date: Wed, 28 Apr 2010 04:43:26 +0100 Subject: [PATCH 09/42] Launchpad automatic translations update. bzr revid: codehost@crowberry-20100428034326-e3xhdjynkssx4ibd --- bin/addons/base/i18n/hr.po | 4 ++-- bin/addons/base/i18n/ja.po | 4 ++-- bin/addons/base/i18n/sv.po | 4 ++-- bin/addons/base/i18n/uk.po | 4 ++-- bin/addons/base/i18n/zh_CN.po | 4 ++-- 5 files changed, 10 insertions(+), 10 deletions(-) diff --git a/bin/addons/base/i18n/hr.po b/bin/addons/base/i18n/hr.po index 744feae054f..489c37b48f9 100644 --- a/bin/addons/base/i18n/hr.po +++ b/bin/addons/base/i18n/hr.po @@ -7,13 +7,13 @@ msgstr "" "Project-Id-Version: OpenERP Server 5.0.4\n" "Report-Msgid-Bugs-To: support@openerp.com\n" "POT-Creation-Date: 2009-12-18 08:39+0000\n" -"PO-Revision-Date: 2010-04-26 04:29+0000\n" +"PO-Revision-Date: 2010-04-27 04:11+0000\n" "Last-Translator: goranc \n" "Language-Team: openerp-translators\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"X-Launchpad-Export-Date: 2010-04-27 03:37+0000\n" +"X-Launchpad-Export-Date: 2010-04-28 03:43+0000\n" "X-Generator: Launchpad (build Unknown)\n" "Language: hr\n" diff --git a/bin/addons/base/i18n/ja.po b/bin/addons/base/i18n/ja.po index c24430cf716..4ecea713060 100644 --- a/bin/addons/base/i18n/ja.po +++ b/bin/addons/base/i18n/ja.po @@ -8,13 +8,13 @@ msgstr "" "Project-Id-Version: openobject-server\n" "Report-Msgid-Bugs-To: FULL NAME \n" "POT-Creation-Date: 2009-12-18 08:39+0000\n" -"PO-Revision-Date: 2010-04-26 04:24+0000\n" +"PO-Revision-Date: 2010-04-27 04:09+0000\n" "Last-Translator: Harry (Open ERP) \n" "Language-Team: Japanese \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"X-Launchpad-Export-Date: 2010-04-27 03:37+0000\n" +"X-Launchpad-Export-Date: 2010-04-28 03:42+0000\n" "X-Generator: Launchpad (build Unknown)\n" #. module: base diff --git a/bin/addons/base/i18n/sv.po b/bin/addons/base/i18n/sv.po index 1f14d2aa331..bb4efc549a6 100644 --- a/bin/addons/base/i18n/sv.po +++ b/bin/addons/base/i18n/sv.po @@ -7,13 +7,13 @@ msgstr "" "Project-Id-Version: OpenERP Server 5.0.0\n" "Report-Msgid-Bugs-To: support@openerp.com\n" "POT-Creation-Date: 2009-12-18 08:39+0000\n" -"PO-Revision-Date: 2010-04-26 04:22+0000\n" +"PO-Revision-Date: 2010-04-27 04:13+0000\n" "Last-Translator: Anders Wallenquist \n" "Language-Team: <>\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"X-Launchpad-Export-Date: 2010-04-27 03:37+0000\n" +"X-Launchpad-Export-Date: 2010-04-28 03:43+0000\n" "X-Generator: Launchpad (build Unknown)\n" #. module: base diff --git a/bin/addons/base/i18n/uk.po b/bin/addons/base/i18n/uk.po index bcaa2d7cd5b..a198f09adfe 100644 --- a/bin/addons/base/i18n/uk.po +++ b/bin/addons/base/i18n/uk.po @@ -7,13 +7,13 @@ msgstr "" "Project-Id-Version: OpenERP Server 5.0.0\n" "Report-Msgid-Bugs-To: support@openerp.com\n" "POT-Creation-Date: 2009-12-18 08:39+0000\n" -"PO-Revision-Date: 2010-04-26 04:19+0000\n" +"PO-Revision-Date: 2010-04-27 04:11+0000\n" "Last-Translator: Fabien (Open ERP) \n" "Language-Team: \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"X-Launchpad-Export-Date: 2010-04-27 03:37+0000\n" +"X-Launchpad-Export-Date: 2010-04-28 03:43+0000\n" "X-Generator: Launchpad (build Unknown)\n" #. module: base diff --git a/bin/addons/base/i18n/zh_CN.po b/bin/addons/base/i18n/zh_CN.po index 7bed00336e1..8185ceb49d2 100644 --- a/bin/addons/base/i18n/zh_CN.po +++ b/bin/addons/base/i18n/zh_CN.po @@ -7,13 +7,13 @@ msgstr "" "Project-Id-Version: OpenERP Server 5.0.4\n" "Report-Msgid-Bugs-To: support@openerp.com\n" "POT-Creation-Date: 2009-12-18 08:39+0000\n" -"PO-Revision-Date: 2010-04-26 04:28+0000\n" +"PO-Revision-Date: 2010-04-27 04:13+0000\n" "Last-Translator: OpenERP Administrators \n" "Language-Team: \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"X-Launchpad-Export-Date: 2010-04-27 03:37+0000\n" +"X-Launchpad-Export-Date: 2010-04-28 03:43+0000\n" "X-Generator: Launchpad (build Unknown)\n" #. module: base From 9ad1592d825fa2d52b0732b16d12450d9ddf2ee3 Mon Sep 17 00:00:00 2001 From: "nch@tinyerp.com" <> Date: Wed, 28 Apr 2010 12:24:37 +0530 Subject: [PATCH 10/42] [IMP]:purchase modules installation wizard bzr revid: nch@tinyerp.com-20100428065437-vgs5mghci7eqdp54 --- addons/purchase/wizard/purchase_installer.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/addons/purchase/wizard/purchase_installer.xml b/addons/purchase/wizard/purchase_installer.xml index 77bbef10453..7f91ec67767 100644 --- a/addons/purchase/wizard/purchase_installer.xml +++ b/addons/purchase/wizard/purchase_installer.xml @@ -11,7 +11,7 @@
Purchase Modules Installation
- + Configure Your Purchase System @@ -42,7 +42,7 @@ 3 - + From 001e560fe5b9edc617b4f698ea2b6523103a9bb6 Mon Sep 17 00:00:00 2001 From: "nch@tinyerp.com" <> Date: Wed, 28 Apr 2010 12:41:26 +0530 Subject: [PATCH 11/42] [IMP]:sales configuration wizard bzr revid: nch@tinyerp.com-20100428071126-hsc08kuyroxz8a09 --- addons/sale/sale_view.xml | 1 + 1 file changed, 1 insertion(+) diff --git a/addons/sale/sale_view.xml b/addons/sale/sale_view.xml index 0c5a1252d59..0831e72712b 100644 --- a/addons/sale/sale_view.xml +++ b/addons/sale/sale_view.xml @@ -532,6 +532,7 @@ + From 2a8f6d762c5bf9b617b04393c229b48206be3ff5 Mon Sep 17 00:00:00 2001 From: "nch@tinyerp.com" <> Date: Wed, 28 Apr 2010 14:03:41 +0530 Subject: [PATCH 12/42] [IMP]:MRP modules installation wizard bzr revid: nch@tinyerp.com-20100428083341-h70w1cfg1x77o66k --- addons/mrp/mrp_installer.xml | 1 + 1 file changed, 1 insertion(+) diff --git a/addons/mrp/mrp_installer.xml b/addons/mrp/mrp_installer.xml index 3e42ec2840e..3c8b62283c0 100644 --- a/addons/mrp/mrp_installer.xml +++ b/addons/mrp/mrp_installer.xml @@ -43,6 +43,7 @@ 3 + From 33a7b33730ce2641a2190f690585cfda8ffa6084 Mon Sep 17 00:00:00 2001 From: "Jay (Open ERP)" Date: Wed, 28 Apr 2010 14:58:00 +0530 Subject: [PATCH 13/42] [FIX] _inherits : Relational field if on the view of child object,should not raise error lp bug: https://launchpad.net/bugs/558528 fixed bzr revid: jvo@tinyerp.com-20100428092800-itjau50duzsbhze9 --- bin/osv/orm.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/bin/osv/orm.py b/bin/osv/orm.py index 062c0bc6f3a..e57f9ce3d87 100644 --- a/bin/osv/orm.py +++ b/bin/osv/orm.py @@ -3281,8 +3281,8 @@ class orm(orm_template): del vals[self._inherits[table]] record_id = tocreate[table].pop('id', None) - - if record_id is None: + + if record_id is None or not record_id: record_id = self.pool.get(table).create(cr, user, tocreate[table], context=context) else: self.pool.get(table).write(cr, user, [record_id], tocreate[table], context=context) From 08d813934d32f33e4ed14a589eaa972d8813ba7d Mon Sep 17 00:00:00 2001 From: "nch@tinyerp.com" <> Date: Wed, 28 Apr 2010 16:01:09 +0530 Subject: [PATCH 14/42] [IMP]:Auto configure wizard bzr revid: nch@tinyerp.com-20100428103109-js0p7a78w4382hiq --- addons/document_ftp/document_ftp_view.xml | 1 + 1 file changed, 1 insertion(+) diff --git a/addons/document_ftp/document_ftp_view.xml b/addons/document_ftp/document_ftp_view.xml index 9cec3715bae..bd7571002fe 100644 --- a/addons/document_ftp/document_ftp_view.xml +++ b/addons/document_ftp/document_ftp_view.xml @@ -47,6 +47,7 @@ + From 3dc031c1d4d5266caf6014f9b2fe59b0723aabed Mon Sep 17 00:00:00 2001 From: "nch@tinyerp.com" <> Date: Thu, 29 Apr 2010 14:16:51 +0530 Subject: [PATCH 15/42] [IMP]:improved purchase,module installer and company configuration wizard bzr revid: nch@tinyerp.com-20100429084651-lgkjw8fy8aej90hh --- addons/base_setup/base_setup_installer.xml | 11 +++++++---- addons/base_setup/base_setup_todo.xml | 18 +++++++++++------- addons/purchase/wizard/purchase_installer.xml | 6 ++++-- 3 files changed, 22 insertions(+), 13 deletions(-) diff --git a/addons/base_setup/base_setup_installer.xml b/addons/base_setup/base_setup_installer.xml index e0c35667b63..e9d177c77e4 100644 --- a/addons/base_setup/base_setup_installer.xml +++ b/addons/base_setup/base_setup_installer.xml @@ -10,9 +10,6 @@
Base Setup Modules Installation
- - Install Modules - + + 15 + + + + Install Generic Modules + - diff --git a/addons/base_setup/base_setup_todo.xml b/addons/base_setup/base_setup_todo.xml index 021e2d10a6c..2a7699bf1ea 100644 --- a/addons/base_setup/base_setup_todo.xml +++ b/addons/base_setup/base_setup_todo.xml @@ -10,16 +10,20 @@
Main Company Setup
- + + Information of your company will be used to custiomize your documents like Invoices, Sale Orders,... + + + Configure Your Company + + + 25 + + - - - - + - diff --git a/addons/purchase/wizard/purchase_installer.xml b/addons/purchase/wizard/purchase_installer.xml index 7f91ec67767..5725907da28 100644 --- a/addons/purchase/wizard/purchase_installer.xml +++ b/addons/purchase/wizard/purchase_installer.xml @@ -11,7 +11,10 @@
Purchase Modules Installation
- + + 6 + + Configure Your Purchase System @@ -22,7 +25,6 @@ - From c9720d28f5a9d1ec46f8a01c388b37d36934e52b Mon Sep 17 00:00:00 2001 From: "Rvo (Open ERP)" Date: Thu, 29 Apr 2010 17:31:58 +0530 Subject: [PATCH 16/42] [IMP+ADD]:improved ir.rule code, added constraint on ir.rule for osv_memory objects bzr revid: rvo@tinyerp.co.in-20100429120158-rt4p9t1o6kkj78fh --- bin/addons/base/ir/ir.xml | 81 ++++------ bin/addons/base/ir/ir_model.py | 11 +- bin/addons/base/ir/ir_rule.py | 154 +++++++------------ bin/addons/base/res/res_user.py | 5 +- bin/addons/base/security/base_security.xml | 19 +-- bin/addons/base/security/ir.model.access.csv | 2 - bin/osv/fields.py | 5 + bin/osv/orm.py | 8 +- 8 files changed, 110 insertions(+), 175 deletions(-) diff --git a/bin/addons/base/ir/ir.xml b/bin/addons/base/ir/ir.xml index 667a77e8a13..664f20abbd3 100644 --- a/bin/addons/base/ir/ir.xml +++ b/bin/addons/base/ir/ir.xml @@ -1147,67 +1147,48 @@ - + Record rules - ir.rule.group + ir.rule form
- - - - - -
- + Record rules - ir.rule.group + ir.rule tree - - - - - - Rule Definition - ir.rule - form - -
- - - - - - - -
- - - Rules - ir.rule - tree - - - @@ -1215,22 +1196,20 @@ + Record Rules - ir.rule.group + ir.rule form - + - + Property multi-company - - ['|',('company_id','child_of',user.company_id.id),('company_id','=',False)] - diff --git a/bin/addons/base/ir/ir_model.py b/bin/addons/base/ir/ir_model.py index 670fb420bd2..f6412e85b75 100644 --- a/bin/addons/base/ir/ir_model.py +++ b/bin/addons/base/ir/ir_model.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- ############################################################################## -# +# # OpenERP, Open Source Management Solution # Copyright (C) 2004-2009 Tiny SPRL (). # @@ -15,7 +15,7 @@ # 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 . +# along with this program. If not, see . # ############################################################################## import logging @@ -80,7 +80,7 @@ class ir_model(osv.osv): if context: context.pop('__last_update', None) return super(ir_model,self).write(cr, user, ids, vals, context) - + def create(self, cr, user, vals, context=None): if context and context.get('manual',False): vals['state']='manual' @@ -226,7 +226,7 @@ class ir_model_fields(osv.osv): 'domain': fields.char('Domain', size=256), 'groups': fields.many2many('res.groups', 'ir_model_fields_group_rel', 'field_id', 'group_id', 'Groups'), 'view_load': fields.boolean('View Auto-Load'), - 'selectable': fields.boolean('Selectable'), + 'selectable': fields.boolean('Selectable'), } _rec_name='field_description' _defaults = { @@ -278,7 +278,7 @@ class ir_model_fields(osv.osv): self.pool.get(vals['model'])._auto_init(cr, ctx) return res - + ir_model_fields() class ir_model_access(osv.osv): @@ -378,6 +378,7 @@ class ir_model_access(osv.osv): 'create': _('You can not create this kind of document! (%s)'), 'unlink': _('You can not delete this document! (%s)'), } + raise except_orm(_('AccessError'), msgs[mode] % model_name ) return r diff --git a/bin/addons/base/ir/ir_rule.py b/bin/addons/base/ir/ir_rule.py index c4165d1bc93..ae13bb5ccda 100644 --- a/bin/addons/base/ir/ir_rule.py +++ b/bin/addons/base/ir/ir_rule.py @@ -23,132 +23,94 @@ from osv import fields,osv import time import tools - -class ir_rule_group(osv.osv): - _name = 'ir.rule.group' - - _columns = { - 'name': fields.char('Name', size=128, select=1), - 'model_id': fields.many2one('ir.model', 'Object',select=1, required=True), - 'global': fields.boolean('Global', select=1, help="Make the rule global, otherwise it needs to be put on a group"), - 'rules': fields.one2many('ir.rule', 'rule_group', 'Tests', help="The rule is satisfied if at least one test is True"), - 'groups': fields.many2many('res.groups', 'group_rule_group_rel', 'rule_group_id', 'group_id', 'Groups'), - 'users': fields.many2many('res.users', 'user_rule_group_rel', 'rule_group_id', 'user_id', 'Users'), - } - - _order = 'model_id, global DESC' - - _defaults={ - 'global': lambda *a: True, - } - -ir_rule_group() - - class ir_rule(osv.osv): _name = 'ir.rule' - _rec_name = 'field_id' - - def _operand(self,cr,uid,context): - - def get(object, level=3, recur=None, root_tech='', root=''): - res = [] - if not recur: - recur = [] - fields = self.pool.get(object).fields_get(cr,uid) - key = fields.keys() - key.sort() - for k in key: - - if fields[k]['type'] in ('many2one'): - res.append((root_tech+'.'+k+'.id', - root+'/'+fields[k]['string'])) - - elif fields[k]['type'] in ('many2many', 'one2many'): - res.append(('\',\'.join(map(lambda x: str(x.id), '+root_tech+'.'+k+'))', - root+'/'+fields[k]['string'])) - - else: - res.append((root_tech+'.'+k, - root+'/'+fields[k]['string'])) - - if (fields[k]['type'] in recur) and (level>0): - res.extend(get(fields[k]['relation'], level-1, - recur, root_tech+'.'+k, root+'/'+fields[k]['string'])) - - return res - - res = [("False", "False"), ("True", "True"), ("user.id", "User")] - res += get('res.users', level=1, - recur=['many2one'], root_tech='user', root='User') - return res def _domain_force_get(self, cr, uid, ids, field_name, arg, context={}): res = {} for rule in self.browse(cr, uid, ids, context): eval_user_data = {'user': self.pool.get('res.users').browse(cr, 1, uid), 'time':time} - - if rule.domain_force: - res[rule.id] = eval(rule.domain_force, eval_user_data) - else: - if rule.operand and rule.operand.startswith('user.') and rule.operand.count('.') > 1: - #Need to check user.field.field1.field2(if field is False,it will break the chain) - op = rule.operand[5:] - rule.operand = rule.operand[:5+len(op[:op.find('.')])] +' and '+ rule.operand + ' or False' - if rule.operator in ('in', 'child_of'): - dom = eval("[('%s', '%s', [%s])]" % (rule.field_id.name, rule.operator, - eval(rule.operand,eval_user_data)), eval_user_data) - else: - dom = eval("[('%s', '%s', %s)]" % (rule.field_id.name, rule.operator, - rule.operand), eval_user_data) - res[rule.id] = dom + res[rule.id] = eval(rule.domain_force, eval_user_data) return res + def _get_value(self, cr, uid, ids, field_name, arg, context={}): + res = {} + for rule in self.browse(cr, uid, ids, context): + if not rule.groups: + res[rule.id] = True + else: + res[rule.id] = False + return res + + def _check_model_obj(self, cr, uid, ids, context={}): + model_obj = self.pool.get('ir.model') + for rule in self.browse(cr, uid, ids, context): + model = model_obj.browse(cr, uid, rule.model_id.id, context).model + obj = self.pool.get(model) + if isinstance(obj, osv.osv_memory): + return False + return True + _columns = { - 'field_id': fields.many2one('ir.model.fields', 'Field',domain= "[('model_id','=', parent.model_id)]", select=1), - 'operator':fields.selection((('=', '='), ('<>', '<>'), ('<=', '<='), ('>=', '>='), ('in', 'in'), ('child_of', 'child_of')), 'Operator'), - 'operand':fields.selection(_operand,'Operand', size=64), - 'rule_group': fields.many2one('ir.rule.group', 'Group', select=2, required=True, ondelete="cascade"), - 'domain_force': fields.char('Force Domain', size=250), + 'name': fields.char('Name', size=128, select=1), + 'model_id': fields.many2one('ir.model', 'Object',select=1, required=True), + 'global': fields.function(_get_value, method=True, string='Global', type='boolean', store=True, help="Make the rule global, otherwise it needs to be put on a group"), + 'groups': fields.many2many('res.groups', 'rule_group_rel', 'rule_group_id', 'group_id', 'Groups'), + 'domain_force': fields.char('Domain', size=250), 'domain': fields.function(_domain_force_get, method=True, string='Domain', type='char', size=250), - 'perm_read': fields.boolean('Read Access'), - 'perm_write': fields.boolean('Write Access'), - 'perm_create': fields.boolean('Create Access'), - 'perm_unlink': fields.boolean('Delete Access') + 'perm_read': fields.boolean('Apply For Read'), + 'perm_write': fields.boolean('Apply For Write'), + 'perm_create': fields.boolean('Apply For Create'), + 'perm_unlink': fields.boolean('Apply For Delete') } + + _order = 'model_id DESC' + _defaults = { - 'perm_read': lambda *a: True, - 'perm_write': lambda *a: True, - 'perm_create': lambda *a: True, - 'perm_unlink': lambda *a: True, + 'perm_read': True, + 'perm_write': True, + 'perm_create': True, + 'perm_unlink': True, + 'global': True, } _sql_constraints = [ ('no_access_rights', 'CHECK (perm_read!=False or perm_write!=False or perm_create!=False or perm_unlink!=False)', 'Rule must have atleast one checked access right'), ] + _constraints = [ + (_check_model_obj, 'Rules are not supported for osv_memory objects !', ['model_id']) + ] - def onchange_all(self, cr, uid, ids, field_id, operator, operand): - if not (field_id or operator or operand): - return {} + def domain_create(self, cr, uid, rule_ids): + dom = ['&'] * (len(rule_ids)-1) + for rule in self.browse(cr, uid, rule_ids): + dom += rule.domain + return dom def domain_get(self, cr, uid, model_name, mode='read', context={}): + group_rule = {} + global_rules = [] + if uid == 1: return [], [], ['"'+self.pool.get(model_name)._table+'"'] - cr.execute("""SELECT r.id FROM ir_rule r - JOIN (ir_rule_group g - JOIN ir_model m ON (g.model_id = m.id)) - ON (g.id = r.rule_group) + JOIN ir_model m ON (r.model_id = m.id) WHERE m.model = %s AND r.perm_""" + mode + """ - AND (g.id IN (SELECT rule_group_id FROM group_rule_group_rel g_rel + AND (r.id IN (SELECT rule_group_id FROM rule_group_rel g_rel JOIN res_groups_users_rel u_rel ON (g_rel.group_id = u_rel.gid) - WHERE u_rel.uid = %s) OR g.global)""", (model_name, uid)) + WHERE u_rel.uid = %s) OR r.global)""", (model_name, uid)) ids = map(lambda x: x[0], cr.fetchall()) - dom = [] for rule in self.browse(cr, uid, ids): - dom += rule.domain + for group in rule.groups: + group_rule.setdefault(group.id, []).append(rule.id) + if not rule.groups: + global_rules.append(rule.id) + dom = self.domain_create(cr, uid, global_rules) + dom += ['|'] * (len(group_rule)-1) + for value in group_rule.values(): + dom += self.domain_create(cr, uid, value) d1,d2,tables = self.pool.get(model_name)._where_calc(cr, uid, dom, active_test=False) return d1, d2, tables domain_get = tools.cache()(domain_get) diff --git a/bin/addons/base/res/res_user.py b/bin/addons/base/res/res_user.py index ff61b9ec6fa..fe67848de6a 100644 --- a/bin/addons/base/res/res_user.py +++ b/bin/addons/base/res/res_user.py @@ -34,7 +34,7 @@ class groups(osv.osv): _columns = { 'name': fields.char('Group Name', size=64, required=True), 'model_access': fields.one2many('ir.model.access', 'group_id', 'Access Controls'), - 'rule_groups': fields.many2many('ir.rule.group', 'group_rule_group_rel', + 'rule_groups': fields.many2many('ir.rule', 'rule_group_rel', 'group_id', 'rule_group_id', 'Rules', domain="[('global', '<>', True)]"), 'menu_access': fields.many2many('ir.ui.menu', 'ir_ui_menu_group_rel', 'gid', 'menu_id', 'Access Menu'), 'comment' : fields.text('Comment',size=250), @@ -47,7 +47,7 @@ class groups(osv.osv): group_name = self.read(cr, uid, [id], ['name'])[0]['name'] default.update({'name': group_name +' (copy)'}) return super(groups, self).copy(cr, uid, id, default, context) - + def write(self, cr, uid, ids, vals, context=None): if 'name' in vals: if vals['name'].startswith('-'): @@ -185,7 +185,6 @@ class users(osv.osv): 'menu_id': fields.many2one('ir.actions.actions', 'Menu Action'), 'groups_id': fields.many2many('res.groups', 'res_groups_users_rel', 'uid', 'gid', 'Groups'), 'roles_id': fields.many2many('res.roles', 'res_roles_users_rel', 'uid', 'rid', 'Roles'), - 'rules_id': fields.many2many('ir.rule.group', 'user_rule_group_rel', 'user_id', 'rule_group_id', 'Rules'), 'company_id': fields.many2one('res.company', 'Company', required=True, help="The company this user is currently working for."), 'company_ids':fields.many2many('res.company','res_company_users_rel','user_id','cid','Companies'), diff --git a/bin/addons/base/security/base_security.xml b/bin/addons/base/security/base_security.xml index ca1f33aa23e..1059cf4da37 100644 --- a/bin/addons/base/security/base_security.xml +++ b/bin/addons/base/security/base_security.xml @@ -72,37 +72,24 @@ - + res.partner.address company - - - - [('company_id','child_of',[user.company_id.id])] - + res.partner company - - - - [('company_id','child_of',[user.company_id.id])] - - + Multi_company_default company - - - - [('company_id','child_of',[user.company_id.id])] diff --git a/bin/addons/base/security/ir.model.access.csv b/bin/addons/base/security/ir.model.access.csv index bc291af8b33..cf0f73a5cc9 100644 --- a/bin/addons/base/security/ir.model.access.csv +++ b/bin/addons/base/security/ir.model.access.csv @@ -23,9 +23,7 @@ "access_ir_report_custom_group_system","ir_report_custom group_system","model_ir_report_custom",,1,0,0,0 "access_ir_report_custom_fields_group_system","ir_report_custom_fields group_system","model_ir_report_custom_fields",,1,0,0,0 "access_ir_rule_group_user","ir_rule group_user","model_ir_rule",,1,0,0,0 -"access_ir_rule_group_group_user","ir_rule_group group_user","model_ir_rule_group",,1,0,0,0 "access_ir_rule_group_erp_manager","ir_rule group_erp_manager","model_ir_rule","group_erp_manager",1,1,1,1 -"access_ir_rule_group_group_erp_manager","ir_rule_group group_erp_manager","model_ir_rule_group","group_erp_manager",1,1,1,1 "access_ir_sequence_group_user","ir_sequence group_user","model_ir_sequence",,1,1,1,1 "access_ir_sequence_type_group_user","ir_sequence_type group_user","model_ir_sequence_type",,1,0,0,0 "access_ir_translation_group_system","ir_translation group_system","model_ir_translation",,1,1,1,1 diff --git a/bin/osv/fields.py b/bin/osv/fields.py index 35ff1667418..71faa9898a5 100644 --- a/bin/osv/fields.py +++ b/bin/osv/fields.py @@ -656,6 +656,11 @@ class function(_column): self._symbol_f = float._symbol_f self._symbol_set = float._symbol_set + if type == 'boolean': + self._symbol_c = boolean._symbol_c + self._symbol_f = boolean._symbol_f + self._symbol_set = boolean._symbol_set + def digits_change(self, cr): if self.digits_compute: t = self.digits_compute(cr) diff --git a/bin/osv/orm.py b/bin/osv/orm.py index e57f9ce3d87..d407ac4d4af 100644 --- a/bin/osv/orm.py +++ b/bin/osv/orm.py @@ -1725,6 +1725,7 @@ class orm_memory(orm_template): def read(self, cr, user, ids, fields_to_read=None, context=None, load='_classic_read'): if not context: context = {} + self.pool.get('ir.model.access').check(cr, user, self._name, 'read', context=context) if not fields_to_read: fields_to_read = self._columns.keys() result = [] @@ -1754,6 +1755,7 @@ class orm_memory(orm_template): def write(self, cr, user, ids, vals, context=None): if not ids: return True + self.pool.get('ir.model.access').check(cr, user, self._name, 'write', context=context) vals2 = {} upd_todo = [] for field in vals: @@ -1772,6 +1774,7 @@ class orm_memory(orm_template): return id_new def create(self, cr, user, vals, context=None): + self.pool.get('ir.model.access').check(cr, user, self._name, 'create', context=context) self.vaccum(cr, user) self.next_id += 1 id_new = self.next_id @@ -1923,6 +1926,7 @@ class orm_memory(orm_template): return res or [] def unlink(self, cr, uid, ids, context=None): + self.pool.get('ir.model.access').check(cr, uid, self._name, 'unlink', context=context) for id in ids: if id in self.datas: del self.datas[id] @@ -3225,7 +3229,7 @@ class orm(orm_template): """ if not context: context = {} - self.pool.get('ir.model.access').check(cr, user, self._name, 'create') + self.pool.get('ir.model.access').check(cr, user, self._name, 'create', context=context) default = [] @@ -3281,7 +3285,7 @@ class orm(orm_template): del vals[self._inherits[table]] record_id = tocreate[table].pop('id', None) - + if record_id is None or not record_id: record_id = self.pool.get(table).create(cr, user, tocreate[table], context=context) else: From 7b6827a6b4b88be4401d98627b7b8ed009926f77 Mon Sep 17 00:00:00 2001 From: "HDA (OpenERP)" Date: Thu, 29 Apr 2010 19:33:13 +0530 Subject: [PATCH 17/42] bug with field with widget=selection + groups if user has no access right bzr revid: hda@tinyerp.com-20100429140313-cnizdvh7m48m5cme --- bin/osv/orm.py | 67 +++++++++++++++++++++++++++++--------------------- 1 file changed, 39 insertions(+), 28 deletions(-) diff --git a/bin/osv/orm.py b/bin/osv/orm.py index e57f9ce3d87..af140909664 100644 --- a/bin/osv/orm.py +++ b/bin/osv/orm.py @@ -1138,7 +1138,17 @@ class orm_template(object): if isinstance(s, unicode): return s.encode('utf8') return s - + def check_group(node): + if node.get('groups'): + groups = node.get('groups').split(',') + readonly = False + access_pool = self.pool.get('ir.model.access') + for group in groups: + readonly = readonly or access_pool.check_groups(cr, user, group) + if not readonly: + node.set('invisible', '1') + del(node.attrib['groups']) + if node.tag in ('field', 'node', 'arrow'): if node.get('object'): attrs = {} @@ -1185,15 +1195,20 @@ class orm_template(object): } attrs = {'views': views} if node.get('widget') and node.get('widget') == 'selection': + if 'groups' in node.attrib: + check_group(node) + if node.get('invisible'): + attrs['selection'] = [] # We can not use the 'string' domain has it is defined according to the record ! - dom = [] - if column._domain and not isinstance(column._domain, (str, unicode)): - dom = column._domain - dom += eval(node.get('domain','[]'), {'uid':user, 'time':time}) - context.update(eval(node.get('context','{}'))) - attrs['selection'] = self.pool.get(relation).name_search(cr, user, '', dom, context=context,limit=None) - if (node.get('required') and not int(node.get('required'))) or not column.required: - attrs['selection'].append((False,'')) + else: + dom = [] + if column._domain and not isinstance(column._domain, (str, unicode)): + dom = column._domain + dom += eval(node.get('domain','[]'), {'uid':user, 'time':time}) + context.update(eval(node.get('context','{}'))) + attrs['selection'] = self.pool.get(relation)._name_search(cr, user, '', dom, context=context,limit=None,name_get_uid=1) + if (node.get('required') and not int(node.get('required'))) or not column.required: + attrs['selection'].append((False,'')) fields[node.get('name')] = attrs elif node.tag in ('form', 'tree'): @@ -1207,15 +1222,7 @@ class orm_template(object): fields[node.get(additional_field)] = {} if 'groups' in node.attrib: - if node.get('groups'): - groups = node.get('groups').split(',') - readonly = False - access_pool = self.pool.get('ir.model.access') - for group in groups: - readonly = readonly or access_pool.check_groups(cr, user, group) - if not readonly: - node.set('invisible', '1') - del(node.attrib['groups']) + check_group(node) # translate view if ('lang' in context) and not result: @@ -3649,6 +3656,18 @@ class orm(orm_template): return [(r['id'], tools.ustr(r[self._rec_name])) for r in self.read(cr, user, ids, [self._rec_name], context, load='_classic_write')] + def _name_search(self, cr, user, name='', args=None, operator='ilike', context=None, limit=100, name_get_uid=None): + if not args: + args = [] + if not context: + context = {} + args = args[:] + if name: + args += [(self._rec_name, operator, name)] + ids = self.search(cr, user, args, limit=limit, context=context) + res = self.name_get(cr, name_get_uid, ids, context) + return res + def name_search(self, cr, user, name='', args=None, operator='ilike', context=None, limit=100): """ @@ -3664,17 +3683,9 @@ class orm(orm_template): This method is equivalent of search() on name + name_get() """ - if not args: - args = [] - if not context: - context = {} - args = args[:] - if name: - args += [(self._rec_name, operator, name)] - ids = self.search(cr, user, args, limit=limit, context=context) - res = self.name_get(cr, user, ids, context) - return res + return self._name_search(cr, user, name, args, operator, context, limit, user) + def copy_data(self, cr, uid, id, default=None, context=None): """ Copy given record's data with all its fields values From e121a29cba42de2d9538a48b8e2394d8f9958260 Mon Sep 17 00:00:00 2001 From: Olivier Dony Date: Thu, 29 Apr 2010 17:35:12 +0200 Subject: [PATCH 18/42] [IMP] improved the new ir.rule form view + improved caching mechanism for ir.rules bzr revid: odo@openerp.com-20100429153512-6zygzt7900dnygk9 --- bin/addons/base/ir/ir.xml | 37 +++++++++++++++++++---------------- bin/addons/base/ir/ir_rule.py | 33 ++++++++++++++++++------------- 2 files changed, 39 insertions(+), 31 deletions(-) diff --git a/bin/addons/base/ir/ir.xml b/bin/addons/base/ir/ir.xml index 664f20abbd3..f28a26103d2 100644 --- a/bin/addons/base/ir/ir.xml +++ b/bin/addons/base/ir/ir.xml @@ -1153,29 +1153,32 @@ form
-
diff --git a/bin/addons/base/ir/ir_rule.py b/bin/addons/base/ir/ir_rule.py index ae13bb5ccda..de465fa8025 100644 --- a/bin/addons/base/ir/ir_rule.py +++ b/bin/addons/base/ir/ir_rule.py @@ -50,12 +50,12 @@ class ir_rule(osv.osv): obj = self.pool.get(model) if isinstance(obj, osv.osv_memory): return False - return True + return True _columns = { 'name': fields.char('Name', size=128, select=1), 'model_id': fields.many2one('ir.model', 'Object',select=1, required=True), - 'global': fields.function(_get_value, method=True, string='Global', type='boolean', store=True, help="Make the rule global, otherwise it needs to be put on a group"), + 'global': fields.function(_get_value, method=True, string='Global', type='boolean', store=True, help="If no group is specified the rule is global and applied to everyone"), 'groups': fields.many2many('res.groups', 'rule_group_rel', 'rule_group_id', 'group_id', 'Groups'), 'domain_force': fields.char('Domain', size=250), 'domain': fields.function(_domain_force_get, method=True, string='Domain', type='char', size=250), @@ -75,7 +75,7 @@ class ir_rule(osv.osv): 'global': True, } _sql_constraints = [ - ('no_access_rights', 'CHECK (perm_read!=False or perm_write!=False or perm_create!=False or perm_unlink!=False)', 'Rule must have atleast one checked access right'), + ('no_access_rights', 'CHECK (perm_read!=False or perm_write!=False or perm_create!=False or perm_unlink!=False)', 'Rule must have at least one checked access right'), ] _constraints = [ (_check_model_obj, 'Rules are not supported for osv_memory objects !', ['model_id']) @@ -87,12 +87,13 @@ class ir_rule(osv.osv): dom += rule.domain return dom - def domain_get(self, cr, uid, model_name, mode='read', context={}): + @tools.cache() + def _compute_domain(self, cr, uid, model_name, mode="read"): group_rule = {} global_rules = [] if uid == 1: - return [], [], ['"'+self.pool.get(model_name)._table+'"'] + return None cr.execute("""SELECT r.id FROM ir_rule r JOIN ir_model m ON (r.model_id = m.id) @@ -111,28 +112,32 @@ class ir_rule(osv.osv): dom += ['|'] * (len(group_rule)-1) for value in group_rule.values(): dom += self.domain_create(cr, uid, value) - d1,d2,tables = self.pool.get(model_name)._where_calc(cr, uid, dom, active_test=False) - return d1, d2, tables - domain_get = tools.cache()(domain_get) + return dom + + def domain_get(self, cr, uid, model_name, mode='read', context={}): + dom = self._compute_domain(cr, uid, model_name, mode=mode) + if dom: + return self.pool.get(model_name)._where_calc(cr, uid, dom, active_test=False) + return [], [], ['"'+self.pool.get(model_name)._table+'"'] def unlink(self, cr, uid, ids, context=None): res = super(ir_rule, self).unlink(cr, uid, ids, context=context) - # Restart the cache on the domain_get method of ir.rule - self.domain_get.clear_cache(cr.dbname) + # Restart the cache on the _compute_domain method of ir.rule + self._compute_domain.clear_cache(cr.dbname) return res def create(self, cr, user, vals, context=None): res = super(ir_rule, self).create(cr, user, vals, context=context) - # Restart the cache on the domain_get method of ir.rule - self.domain_get.clear_cache(cr.dbname) + # Restart the cache on the _compute_domain method of ir.rule + self._compute_domain.clear_cache(cr.dbname) return res def write(self, cr, uid, ids, vals, context=None): if not context: context={} res = super(ir_rule, self).write(cr, uid, ids, vals, context=context) - # Restart the cache on the domain_get method - self.domain_get.clear_cache(cr.dbname) + # Restart the cache on the _compute_domain method + self._compute_domain.clear_cache(cr.dbname) return res ir_rule() From ff64e31f5bad74c3273638699ae6de73f4edd68f Mon Sep 17 00:00:00 2001 From: Launchpad Code Hosting Date: Fri, 30 Apr 2010 04:50:49 +0100 Subject: [PATCH 19/42] Launchpad automatic translations update. bzr revid: codehost@crowberry-20100429035230-04t0fhzz45wb0el4 bzr revid: codehost@crowberry-20100430035049-ydjg2lhih85v80i9 --- bin/addons/base/i18n/hr.po | 4 ++-- bin/addons/base/i18n/it.po | 8 ++++---- bin/addons/base/i18n/ja.po | 4 ++-- bin/addons/base/i18n/sv.po | 4 ++-- bin/addons/base/i18n/uk.po | 4 ++-- bin/addons/base/i18n/zh_CN.po | 4 ++-- 6 files changed, 14 insertions(+), 14 deletions(-) diff --git a/bin/addons/base/i18n/hr.po b/bin/addons/base/i18n/hr.po index 489c37b48f9..f66421b44ce 100644 --- a/bin/addons/base/i18n/hr.po +++ b/bin/addons/base/i18n/hr.po @@ -7,13 +7,13 @@ msgstr "" "Project-Id-Version: OpenERP Server 5.0.4\n" "Report-Msgid-Bugs-To: support@openerp.com\n" "POT-Creation-Date: 2009-12-18 08:39+0000\n" -"PO-Revision-Date: 2010-04-27 04:11+0000\n" +"PO-Revision-Date: 2010-04-29 04:38+0000\n" "Last-Translator: goranc \n" "Language-Team: openerp-translators\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"X-Launchpad-Export-Date: 2010-04-28 03:43+0000\n" +"X-Launchpad-Export-Date: 2010-04-30 03:50+0000\n" "X-Generator: Launchpad (build Unknown)\n" "Language: hr\n" diff --git a/bin/addons/base/i18n/it.po b/bin/addons/base/i18n/it.po index 253250b3ac1..a07603c3142 100644 --- a/bin/addons/base/i18n/it.po +++ b/bin/addons/base/i18n/it.po @@ -7,13 +7,13 @@ msgstr "" "Project-Id-Version: OpenERP Server 5.0.4\n" "Report-Msgid-Bugs-To: support@openerp.com\n" "POT-Creation-Date: 2009-12-18 08:39+0000\n" -"PO-Revision-Date: 2010-03-31 05:14+0000\n" -"Last-Translator: OpenERP Administrators \n" +"PO-Revision-Date: 2010-04-29 04:41+0000\n" +"Last-Translator: eLBati - albatos.com \n" "Language-Team: \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"X-Launchpad-Export-Date: 2010-04-17 03:51+0000\n" +"X-Launchpad-Export-Date: 2010-04-30 03:50+0000\n" "X-Generator: Launchpad (build Unknown)\n" #. module: base @@ -422,7 +422,7 @@ msgstr "Colombia" #. module: base #: view:ir.module.module:0 msgid "Schedule Upgrade" -msgstr "Aggiornamento Programmazione" +msgstr "Pianifica l'aggiornamento" #. module: base #: field:ir.actions.report.custom,report_id:0 diff --git a/bin/addons/base/i18n/ja.po b/bin/addons/base/i18n/ja.po index 4ecea713060..b53a444998d 100644 --- a/bin/addons/base/i18n/ja.po +++ b/bin/addons/base/i18n/ja.po @@ -8,13 +8,13 @@ msgstr "" "Project-Id-Version: openobject-server\n" "Report-Msgid-Bugs-To: FULL NAME \n" "POT-Creation-Date: 2009-12-18 08:39+0000\n" -"PO-Revision-Date: 2010-04-27 04:09+0000\n" +"PO-Revision-Date: 2010-04-29 04:36+0000\n" "Last-Translator: Harry (Open ERP) \n" "Language-Team: Japanese \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"X-Launchpad-Export-Date: 2010-04-28 03:42+0000\n" +"X-Launchpad-Export-Date: 2010-04-30 03:50+0000\n" "X-Generator: Launchpad (build Unknown)\n" #. module: base diff --git a/bin/addons/base/i18n/sv.po b/bin/addons/base/i18n/sv.po index bb4efc549a6..29ddcfda776 100644 --- a/bin/addons/base/i18n/sv.po +++ b/bin/addons/base/i18n/sv.po @@ -7,13 +7,13 @@ msgstr "" "Project-Id-Version: OpenERP Server 5.0.0\n" "Report-Msgid-Bugs-To: support@openerp.com\n" "POT-Creation-Date: 2009-12-18 08:39+0000\n" -"PO-Revision-Date: 2010-04-27 04:13+0000\n" +"PO-Revision-Date: 2010-04-29 04:41+0000\n" "Last-Translator: Anders Wallenquist \n" "Language-Team: <>\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"X-Launchpad-Export-Date: 2010-04-28 03:43+0000\n" +"X-Launchpad-Export-Date: 2010-04-30 03:50+0000\n" "X-Generator: Launchpad (build Unknown)\n" #. module: base diff --git a/bin/addons/base/i18n/uk.po b/bin/addons/base/i18n/uk.po index a198f09adfe..65f065c9942 100644 --- a/bin/addons/base/i18n/uk.po +++ b/bin/addons/base/i18n/uk.po @@ -7,13 +7,13 @@ msgstr "" "Project-Id-Version: OpenERP Server 5.0.0\n" "Report-Msgid-Bugs-To: support@openerp.com\n" "POT-Creation-Date: 2009-12-18 08:39+0000\n" -"PO-Revision-Date: 2010-04-27 04:11+0000\n" +"PO-Revision-Date: 2010-04-29 04:39+0000\n" "Last-Translator: Fabien (Open ERP) \n" "Language-Team: \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"X-Launchpad-Export-Date: 2010-04-28 03:43+0000\n" +"X-Launchpad-Export-Date: 2010-04-30 03:50+0000\n" "X-Generator: Launchpad (build Unknown)\n" #. module: base diff --git a/bin/addons/base/i18n/zh_CN.po b/bin/addons/base/i18n/zh_CN.po index 8185ceb49d2..729acf9e52b 100644 --- a/bin/addons/base/i18n/zh_CN.po +++ b/bin/addons/base/i18n/zh_CN.po @@ -7,13 +7,13 @@ msgstr "" "Project-Id-Version: OpenERP Server 5.0.4\n" "Report-Msgid-Bugs-To: support@openerp.com\n" "POT-Creation-Date: 2009-12-18 08:39+0000\n" -"PO-Revision-Date: 2010-04-27 04:13+0000\n" +"PO-Revision-Date: 2010-04-29 04:40+0000\n" "Last-Translator: OpenERP Administrators \n" "Language-Team: \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"X-Launchpad-Export-Date: 2010-04-28 03:43+0000\n" +"X-Launchpad-Export-Date: 2010-04-30 03:50+0000\n" "X-Generator: Launchpad (build Unknown)\n" #. module: base From e235786c547dda46f5ed93aba15e1c120dcfc7f0 Mon Sep 17 00:00:00 2001 From: "nch@tinyerp.com" <> Date: Fri, 30 Apr 2010 11:43:14 +0530 Subject: [PATCH 20/42] [IMP]:account configuration wizard bzr revid: nch@tinyerp.com-20100430061314-xpcxye6afshqxg9h --- addons/account/account.py | 46 ----------------- addons/account/account_installer.xml | 29 +++++++++-- addons/account/account_view.xml | 43 ---------------- addons/account/i18n/account.pot | 4 -- addons/account/i18n/ar.po | 4 -- addons/account/i18n/bg.po | 5 -- addons/account/i18n/bs.po | 5 -- addons/account/i18n/ca.po | 5 -- addons/account/i18n/cs.po | 5 -- addons/account/i18n/da.po | 5 -- addons/account/i18n/de.po | 5 -- addons/account/i18n/el.po | 5 -- addons/account/i18n/es.po | 5 -- addons/account/i18n/es_AR.po | 5 -- addons/account/i18n/es_EC.po | 5 -- addons/account/i18n/et.po | 5 -- addons/account/i18n/fa.po | 5 -- addons/account/i18n/fi.po | 5 -- addons/account/i18n/fr.po | 5 -- addons/account/i18n/gl.po | 4 -- addons/account/i18n/gu.po | 5 -- addons/account/i18n/hr.po | 5 -- addons/account/i18n/hu.po | 5 -- addons/account/i18n/id.po | 5 -- addons/account/i18n/it.po | 5 -- addons/account/i18n/kab.po | 5 +- addons/account/i18n/ko.po | 5 -- addons/account/i18n/lt.po | 5 -- addons/account/i18n/lv.po | 5 -- addons/account/i18n/mn.po | 5 -- addons/account/i18n/nb.po | 5 -- addons/account/i18n/nl.po | 5 -- addons/account/i18n/nl_BE.po | 5 -- addons/account/i18n/oc.po | 4 -- addons/account/i18n/pl.po | 5 -- addons/account/i18n/pt.po | 5 -- addons/account/i18n/pt_BR.po | 5 -- addons/account/i18n/ro.po | 5 -- addons/account/i18n/ru.po | 5 -- addons/account/i18n/si.po | 5 -- addons/account/i18n/sk.po | 5 -- addons/account/i18n/sl.po | 5 -- addons/account/i18n/sq.po | 5 -- addons/account/i18n/sr.po | 5 -- addons/account/i18n/sv.po | 5 -- addons/account/i18n/te.po | 5 -- addons/account/i18n/th.po | 5 -- addons/account/i18n/tlh.po | 5 -- addons/account/i18n/tr.po | 5 -- addons/account/i18n/uk.po | 5 -- addons/account/i18n/vi.po | 5 -- addons/account/i18n/zh_CN.po | 5 -- addons/account/i18n/zh_HK.po | 5 -- addons/account/i18n/zh_TW.po | 5 -- addons/account/installer.py | 57 ++++++++++++++++++--- addons/account/security/ir.model.access.csv | 2 - addons/base_setup/base_setup_todo.xml | 2 +- addons/base_setup/todo.py | 6 +-- 58 files changed, 77 insertions(+), 359 deletions(-) diff --git a/addons/account/account.py b/addons/account/account.py index 74531102073..6a96fba8e16 100644 --- a/addons/account/account.py +++ b/addons/account/account.py @@ -1763,52 +1763,6 @@ class account_subscription_line(osv.osv): _rec_name = 'date' account_subscription_line() - -class account_config_wizard(osv.osv_memory): - _name = 'account.config.wizard' - _inherit = 'res.config' - - _columns = { - 'name':fields.char( - 'Name', required=True, size=64, - help="Name of the fiscal year as displayed on screens."), - 'code':fields.char( - 'Code', required=True, size=64, - help="Name of the fiscal year as displayed in reports."), - 'date1': fields.date('Start Date', required=True), - 'date2': fields.date('End Date', required=True), - 'period':fields.selection([('month','Month'), ('3months','3 Months')], - 'Periods', required=True), - } - _defaults = { - 'code': lambda *a: time.strftime('%Y'), - 'name': lambda *a: time.strftime('%Y'), - 'date1': lambda *a: time.strftime('%Y-01-01'), - 'date2': lambda *a: time.strftime('%Y-12-31'), - 'period':lambda *a:'month', - } - - def execute(self, cr, uid, ids, context=None): - for res in self.read(cr,uid,ids): - if 'date1' in res and 'date2' in res: - res_obj = self.pool.get('account.fiscalyear') - start_date=res['date1'] - end_date=res['date2'] - name=res['name']#DateTime.strptime(start_date, '%Y-%m-%d').strftime('%m.%Y') + '-' + DateTime.strptime(end_date, '%Y-%m-%d').strftime('%m.%Y') - vals={ - 'name':name, - 'code':name, - 'date_start':start_date, - 'date_stop':end_date, - } - new_id=res_obj.create(cr, uid, vals, context=context) - if res['period']=='month': - res_obj.create_period(cr,uid,[new_id]) - elif res['period']=='3months': - res_obj.create_period3(cr,uid,[new_id]) -account_config_wizard() - - # --------------------------------------------------------------- # Account Templates : Account, Tax, Tax Code and chart. + Wizard # --------------------------------------------------------------- diff --git a/addons/account/account_installer.xml b/addons/account/account_installer.xml index 4c9742fd127..3cd0495904e 100644 --- a/addons/account/account_installer.xml +++ b/addons/account/account_installer.xml @@ -18,16 +18,35 @@ You can enhance OpenERP's basic accounting support with a few additional OpenERP applications + 150 - - - - - + + Configure + + + 20 + + + + + + + + + + + + + + + + + + diff --git a/addons/account/account_view.xml b/addons/account/account_view.xml index 9ace27294fa..b72c01f9cf7 100644 --- a/addons/account/account_view.xml +++ b/addons/account/account_view.xml @@ -1445,49 +1445,6 @@ - - - - - - Account Configure wizard - account.config.wizard - form - - - -
- Account Configure -
- - - - - - - - - -
-
-
- - - Account Configure Wizard - ir.actions.act_window - account.config.wizard - - form - form - new - - - - - - onskip - - Account Add wizard account.addtmpl.wizard diff --git a/addons/account/i18n/account.pot b/addons/account/i18n/account.pot index a777acb9c5c..ef00056ee8e 100644 --- a/addons/account/i18n/account.pot +++ b/addons/account/i18n/account.pot @@ -785,10 +785,6 @@ msgstr "" msgid "Move Lines" msgstr "" -#. module: account -#: model:ir.model,name:account.model_account_config_wizard -msgid "account.config.wizard" -msgstr "" #. module: account #: model:ir.actions.act_window,name:account.report_account_analytic_journal_tree diff --git a/addons/account/i18n/ar.po b/addons/account/i18n/ar.po index f69b3246eff..e838f3bce27 100644 --- a/addons/account/i18n/ar.po +++ b/addons/account/i18n/ar.po @@ -805,10 +805,6 @@ msgstr "" msgid "Move Lines" msgstr "" -#. module: account -#: model:ir.model,name:account.model_account_config_wizard -msgid "account.config.wizard" -msgstr "" #. module: account #: model:ir.actions.act_window,name:account.report_account_analytic_journal_tree diff --git a/addons/account/i18n/bg.po b/addons/account/i18n/bg.po index 91dfbca2279..56befb5c212 100644 --- a/addons/account/i18n/bg.po +++ b/addons/account/i18n/bg.po @@ -819,11 +819,6 @@ msgstr "" msgid "Move Lines" msgstr "" -#. module: account -#: model:ir.model,name:account.model_account_config_wizard -msgid "account.config.wizard" -msgstr "" - #. module: account #: model:ir.actions.act_window,name:account.report_account_analytic_journal_tree #: model:ir.ui.menu,name:account.report_account_analytic_journal_print diff --git a/addons/account/i18n/bs.po b/addons/account/i18n/bs.po index d1da22ef906..36cd444b21d 100644 --- a/addons/account/i18n/bs.po +++ b/addons/account/i18n/bs.po @@ -816,11 +816,6 @@ msgstr "(Ostaviti prazno za sve otvorene fiskalne godine)" msgid "Move Lines" msgstr "Retci prijenosa" -#. module: account -#: model:ir.model,name:account.model_account_config_wizard -msgid "account.config.wizard" -msgstr "account.config.wizard" - #. module: account #: model:ir.actions.act_window,name:account.report_account_analytic_journal_tree #: model:ir.ui.menu,name:account.report_account_analytic_journal_print diff --git a/addons/account/i18n/ca.po b/addons/account/i18n/ca.po index 9f2c82ec366..6a5f47dfb24 100644 --- a/addons/account/i18n/ca.po +++ b/addons/account/i18n/ca.po @@ -829,11 +829,6 @@ msgstr "(deixar-lo buit per a tots els exercicis fiscals oberts)" msgid "Move Lines" msgstr "Línies moviment" -#. module: account -#: model:ir.model,name:account.model_account_config_wizard -msgid "account.config.wizard" -msgstr "account.config.assistent" - #. module: account #: model:ir.actions.act_window,name:account.report_account_analytic_journal_tree #: model:ir.ui.menu,name:account.report_account_analytic_journal_print diff --git a/addons/account/i18n/cs.po b/addons/account/i18n/cs.po index 8d393298e01..be9a9612f42 100644 --- a/addons/account/i18n/cs.po +++ b/addons/account/i18n/cs.po @@ -809,11 +809,6 @@ msgstr "" msgid "Move Lines" msgstr "" -#. module: account -#: model:ir.model,name:account.model_account_config_wizard -msgid "account.config.wizard" -msgstr "" - #. module: account #: model:ir.actions.act_window,name:account.report_account_analytic_journal_tree #: model:ir.ui.menu,name:account.report_account_analytic_journal_print diff --git a/addons/account/i18n/da.po b/addons/account/i18n/da.po index 55cb096e90e..e27b080077d 100644 --- a/addons/account/i18n/da.po +++ b/addons/account/i18n/da.po @@ -811,11 +811,6 @@ msgstr "" msgid "Move Lines" msgstr "" -#. module: account -#: model:ir.model,name:account.model_account_config_wizard -msgid "account.config.wizard" -msgstr "" - #. module: account #: model:ir.actions.act_window,name:account.report_account_analytic_journal_tree #: model:ir.ui.menu,name:account.report_account_analytic_journal_print diff --git a/addons/account/i18n/de.po b/addons/account/i18n/de.po index e978a71d610..4f9893960bf 100644 --- a/addons/account/i18n/de.po +++ b/addons/account/i18n/de.po @@ -827,11 +827,6 @@ msgstr "(frei lassen für alle Wirtschaftsjahre)" msgid "Move Lines" msgstr "Buchungszeilen" -#. module: account -#: model:ir.model,name:account.model_account_config_wizard -msgid "account.config.wizard" -msgstr "account.config.wizard" - #. module: account #: model:ir.actions.act_window,name:account.report_account_analytic_journal_tree #: model:ir.ui.menu,name:account.report_account_analytic_journal_print diff --git a/addons/account/i18n/el.po b/addons/account/i18n/el.po index f2e5ed77ea6..af0ca7265c3 100644 --- a/addons/account/i18n/el.po +++ b/addons/account/i18n/el.po @@ -829,11 +829,6 @@ msgstr "(Διατηρήστε κενό για όλα τα ανοιχτά λογ msgid "Move Lines" msgstr "Μετακίνηση Γραμμών" -#. module: account -#: model:ir.model,name:account.model_account_config_wizard -msgid "account.config.wizard" -msgstr "account.config.wizard" - #. module: account #: model:ir.actions.act_window,name:account.report_account_analytic_journal_tree #: model:ir.ui.menu,name:account.report_account_analytic_journal_print diff --git a/addons/account/i18n/es.po b/addons/account/i18n/es.po index 0a2b2c626d6..21becbd9c99 100644 --- a/addons/account/i18n/es.po +++ b/addons/account/i18n/es.po @@ -828,11 +828,6 @@ msgstr "(dejarlo vacío para todos los ejercicios fiscales abiertos)" msgid "Move Lines" msgstr "Líneas movimiento" -#. module: account -#: model:ir.model,name:account.model_account_config_wizard -msgid "account.config.wizard" -msgstr "account.config.asistente" - #. module: account #: model:ir.actions.act_window,name:account.report_account_analytic_journal_tree #: model:ir.ui.menu,name:account.report_account_analytic_journal_print diff --git a/addons/account/i18n/es_AR.po b/addons/account/i18n/es_AR.po index f578cbc7493..cbdf13eb4b0 100644 --- a/addons/account/i18n/es_AR.po +++ b/addons/account/i18n/es_AR.po @@ -827,11 +827,6 @@ msgstr "(dejar vacío para todos los ejercicios fiscales abiertos)" msgid "Move Lines" msgstr "Líneas del movimiento" -#. module: account -#: model:ir.model,name:account.model_account_config_wizard -msgid "account.config.wizard" -msgstr "asistente.configuracion.contable" - #. module: account #: model:ir.actions.act_window,name:account.report_account_analytic_journal_tree #: model:ir.ui.menu,name:account.report_account_analytic_journal_print diff --git a/addons/account/i18n/es_EC.po b/addons/account/i18n/es_EC.po index 0f0f933abdb..bed04b5b069 100644 --- a/addons/account/i18n/es_EC.po +++ b/addons/account/i18n/es_EC.po @@ -826,11 +826,6 @@ msgstr "(dejarlo vacío para todos los ejercicios fiscales abiertos)" msgid "Move Lines" msgstr "" -#. module: account -#: model:ir.model,name:account.model_account_config_wizard -msgid "account.config.wizard" -msgstr "" - #. module: account #: model:ir.actions.act_window,name:account.report_account_analytic_journal_tree #: model:ir.ui.menu,name:account.report_account_analytic_journal_print diff --git a/addons/account/i18n/et.po b/addons/account/i18n/et.po index fbe197f9df7..6ecd769ea63 100644 --- a/addons/account/i18n/et.po +++ b/addons/account/i18n/et.po @@ -807,11 +807,6 @@ msgstr "(Jäta tühjaks kõigi avatud majandusaastate jaoks)" msgid "Move Lines" msgstr "Liiguta read" -#. module: account -#: model:ir.model,name:account.model_account_config_wizard -msgid "account.config.wizard" -msgstr "" - #. module: account #: model:ir.actions.act_window,name:account.report_account_analytic_journal_tree #: model:ir.ui.menu,name:account.report_account_analytic_journal_print diff --git a/addons/account/i18n/fa.po b/addons/account/i18n/fa.po index 95af7a94323..3dace56df79 100644 --- a/addons/account/i18n/fa.po +++ b/addons/account/i18n/fa.po @@ -806,11 +806,6 @@ msgstr "" msgid "Move Lines" msgstr "" -#. module: account -#: model:ir.model,name:account.model_account_config_wizard -msgid "account.config.wizard" -msgstr "" - #. module: account #: model:ir.actions.act_window,name:account.report_account_analytic_journal_tree #: model:ir.ui.menu,name:account.report_account_analytic_journal_print diff --git a/addons/account/i18n/fi.po b/addons/account/i18n/fi.po index b5274399fea..1f1de60a69e 100644 --- a/addons/account/i18n/fi.po +++ b/addons/account/i18n/fi.po @@ -826,11 +826,6 @@ msgstr "(Jätä tyhjäksi käyttääksesi kaikkia avoimia tilikausia)" msgid "Move Lines" msgstr "Siirron rivit" -#. module: account -#: model:ir.model,name:account.model_account_config_wizard -msgid "account.config.wizard" -msgstr "account.config.wizard" - #. module: account #: model:ir.actions.act_window,name:account.report_account_analytic_journal_tree #: model:ir.ui.menu,name:account.report_account_analytic_journal_print diff --git a/addons/account/i18n/fr.po b/addons/account/i18n/fr.po index ffb5f882d9b..1785d79bf38 100644 --- a/addons/account/i18n/fr.po +++ b/addons/account/i18n/fr.po @@ -1240,11 +1240,6 @@ msgstr "Livre de coûts" msgid "Move Lines" msgstr "Lignes de mouvements" -#. module: account -#: model:ir.model,name:account.model_account_config_wizard -msgid "account.config.wizard" -msgstr "account.config.wizard" - #. module: account #: model:ir.actions.act_window,name:account.report_account_analytic_journal_tree #: model:ir.ui.menu,name:account.report_account_analytic_journal_print diff --git a/addons/account/i18n/gl.po b/addons/account/i18n/gl.po index 65856053bdd..6bcd627b0bf 100644 --- a/addons/account/i18n/gl.po +++ b/addons/account/i18n/gl.po @@ -806,10 +806,6 @@ msgstr "" msgid "Move Lines" msgstr "" -#. module: account -#: model:ir.model,name:account.model_account_config_wizard -msgid "account.config.wizard" -msgstr "" #. module: account #: model:ir.actions.act_window,name:account.report_account_analytic_journal_tree diff --git a/addons/account/i18n/gu.po b/addons/account/i18n/gu.po index 3a997d3000f..ecd36932d38 100644 --- a/addons/account/i18n/gu.po +++ b/addons/account/i18n/gu.po @@ -806,11 +806,6 @@ msgstr "" msgid "Move Lines" msgstr "" -#. module: account -#: model:ir.model,name:account.model_account_config_wizard -msgid "account.config.wizard" -msgstr "" - #. module: account #: model:ir.actions.act_window,name:account.report_account_analytic_journal_tree #: model:ir.ui.menu,name:account.report_account_analytic_journal_print diff --git a/addons/account/i18n/hr.po b/addons/account/i18n/hr.po index e6b360683ea..e01b198f2d5 100644 --- a/addons/account/i18n/hr.po +++ b/addons/account/i18n/hr.po @@ -805,11 +805,6 @@ msgstr "" msgid "Move Lines" msgstr "" -#. module: account -#: model:ir.model,name:account.model_account_config_wizard -msgid "account.config.wizard" -msgstr "" - #. module: account #: model:ir.actions.act_window,name:account.report_account_analytic_journal_tree #: model:ir.ui.menu,name:account.report_account_analytic_journal_print diff --git a/addons/account/i18n/hu.po b/addons/account/i18n/hu.po index c8349d8f0c5..8f70c2fd083 100644 --- a/addons/account/i18n/hu.po +++ b/addons/account/i18n/hu.po @@ -805,11 +805,6 @@ msgstr "" msgid "Move Lines" msgstr "" -#. module: account -#: model:ir.model,name:account.model_account_config_wizard -msgid "account.config.wizard" -msgstr "" - #. module: account #: model:ir.actions.act_window,name:account.report_account_analytic_journal_tree #: model:ir.ui.menu,name:account.report_account_analytic_journal_print diff --git a/addons/account/i18n/id.po b/addons/account/i18n/id.po index 1d999f12888..c7c2f143c8b 100644 --- a/addons/account/i18n/id.po +++ b/addons/account/i18n/id.po @@ -806,11 +806,6 @@ msgstr "" msgid "Move Lines" msgstr "" -#. module: account -#: model:ir.model,name:account.model_account_config_wizard -msgid "account.config.wizard" -msgstr "" - #. module: account #: model:ir.actions.act_window,name:account.report_account_analytic_journal_tree #: model:ir.ui.menu,name:account.report_account_analytic_journal_print diff --git a/addons/account/i18n/it.po b/addons/account/i18n/it.po index 79335be4e75..6007a539d21 100644 --- a/addons/account/i18n/it.po +++ b/addons/account/i18n/it.po @@ -826,11 +826,6 @@ msgstr "(Lasciare vuoto per tutti gli esercizi fiscali aperti)" msgid "Move Lines" msgstr "Righe Movimentate" -#. module: account -#: model:ir.model,name:account.model_account_config_wizard -msgid "account.config.wizard" -msgstr "account.config.wizard" - #. module: account #: model:ir.actions.act_window,name:account.report_account_analytic_journal_tree #: model:ir.ui.menu,name:account.report_account_analytic_journal_print diff --git a/addons/account/i18n/kab.po b/addons/account/i18n/kab.po index 67801be10cf..383cf564a8b 100644 --- a/addons/account/i18n/kab.po +++ b/addons/account/i18n/kab.po @@ -806,10 +806,7 @@ msgstr "" msgid "Move Lines" msgstr "" -#. module: account -#: model:ir.model,name:account.model_account_config_wizard -msgid "account.config.wizard" -msgstr "" + #. module: account #: model:ir.actions.act_window,name:account.report_account_analytic_journal_tree diff --git a/addons/account/i18n/ko.po b/addons/account/i18n/ko.po index e97724467c6..4391aa7bb08 100644 --- a/addons/account/i18n/ko.po +++ b/addons/account/i18n/ko.po @@ -806,11 +806,6 @@ msgstr "" msgid "Move Lines" msgstr "" -#. module: account -#: model:ir.model,name:account.model_account_config_wizard -msgid "account.config.wizard" -msgstr "" - #. module: account #: model:ir.actions.act_window,name:account.report_account_analytic_journal_tree #: model:ir.ui.menu,name:account.report_account_analytic_journal_print diff --git a/addons/account/i18n/lt.po b/addons/account/i18n/lt.po index 0adf15c8787..4558f305972 100644 --- a/addons/account/i18n/lt.po +++ b/addons/account/i18n/lt.po @@ -809,11 +809,6 @@ msgstr "(palikite tuščią, jei norite visų atvirų fiskalinių metų)" msgid "Move Lines" msgstr "Didžiosios knygos įrašai" -#. module: account -#: model:ir.model,name:account.model_account_config_wizard -msgid "account.config.wizard" -msgstr "" - #. module: account #: model:ir.actions.act_window,name:account.report_account_analytic_journal_tree #: model:ir.ui.menu,name:account.report_account_analytic_journal_print diff --git a/addons/account/i18n/lv.po b/addons/account/i18n/lv.po index e17722af03f..67a585f4a57 100644 --- a/addons/account/i18n/lv.po +++ b/addons/account/i18n/lv.po @@ -818,11 +818,6 @@ msgstr "(Atstāt tukšu visiem nenoslēgtajiem fiskālajiem gadiem)" msgid "Move Lines" msgstr "Grāmatojumu Rindas" -#. module: account -#: model:ir.model,name:account.model_account_config_wizard -msgid "account.config.wizard" -msgstr "account.config.wizard" - #. module: account #: model:ir.actions.act_window,name:account.report_account_analytic_journal_tree #: model:ir.ui.menu,name:account.report_account_analytic_journal_print diff --git a/addons/account/i18n/mn.po b/addons/account/i18n/mn.po index 11bab9eed81..52512785a61 100644 --- a/addons/account/i18n/mn.po +++ b/addons/account/i18n/mn.po @@ -806,11 +806,6 @@ msgstr "" msgid "Move Lines" msgstr "" -#. module: account -#: model:ir.model,name:account.model_account_config_wizard -msgid "account.config.wizard" -msgstr "" - #. module: account #: model:ir.actions.act_window,name:account.report_account_analytic_journal_tree #: model:ir.ui.menu,name:account.report_account_analytic_journal_print diff --git a/addons/account/i18n/nb.po b/addons/account/i18n/nb.po index e27d8cc9677..1041a90be21 100644 --- a/addons/account/i18n/nb.po +++ b/addons/account/i18n/nb.po @@ -806,11 +806,6 @@ msgstr "" msgid "Move Lines" msgstr "" -#. module: account -#: model:ir.model,name:account.model_account_config_wizard -msgid "account.config.wizard" -msgstr "" - #. module: account #: model:ir.actions.act_window,name:account.report_account_analytic_journal_tree #: model:ir.ui.menu,name:account.report_account_analytic_journal_print diff --git a/addons/account/i18n/nl.po b/addons/account/i18n/nl.po index ea10f588dc6..ac1f183a5fa 100644 --- a/addons/account/i18n/nl.po +++ b/addons/account/i18n/nl.po @@ -827,11 +827,6 @@ msgstr "(laat leeg om alle boekjaren mee te nemen)" msgid "Move Lines" msgstr "Verplaats boekingsregels" -#. module: account -#: model:ir.model,name:account.model_account_config_wizard -msgid "account.config.wizard" -msgstr "account.config.wizard" - #. module: account #: model:ir.actions.act_window,name:account.report_account_analytic_journal_tree #: model:ir.ui.menu,name:account.report_account_analytic_journal_print diff --git a/addons/account/i18n/nl_BE.po b/addons/account/i18n/nl_BE.po index c9fda154dab..f298c31854d 100644 --- a/addons/account/i18n/nl_BE.po +++ b/addons/account/i18n/nl_BE.po @@ -805,11 +805,6 @@ msgstr "" msgid "Move Lines" msgstr "" -#. module: account -#: model:ir.model,name:account.model_account_config_wizard -msgid "account.config.wizard" -msgstr "" - #. module: account #: model:ir.actions.act_window,name:account.report_account_analytic_journal_tree #: model:ir.ui.menu,name:account.report_account_analytic_journal_print diff --git a/addons/account/i18n/oc.po b/addons/account/i18n/oc.po index a322bf511b0..53532fba0ac 100644 --- a/addons/account/i18n/oc.po +++ b/addons/account/i18n/oc.po @@ -808,10 +808,6 @@ msgstr "" msgid "Move Lines" msgstr "" -#. module: account -#: model:ir.model,name:account.model_account_config_wizard -msgid "account.config.wizard" -msgstr "account.config.wizard" #. module: account #: model:ir.actions.act_window,name:account.report_account_analytic_journal_tree diff --git a/addons/account/i18n/pl.po b/addons/account/i18n/pl.po index 12e8c9efdf8..354d3ebaa83 100644 --- a/addons/account/i18n/pl.po +++ b/addons/account/i18n/pl.po @@ -825,11 +825,6 @@ msgstr "(Pozostaw puste dla wszystkich otwartych lat podatkowych)" msgid "Move Lines" msgstr "Pozycje zapisów" -#. module: account -#: model:ir.model,name:account.model_account_config_wizard -msgid "account.config.wizard" -msgstr "" - #. module: account #: model:ir.actions.act_window,name:account.report_account_analytic_journal_tree #: model:ir.ui.menu,name:account.report_account_analytic_journal_print diff --git a/addons/account/i18n/pt.po b/addons/account/i18n/pt.po index 2f23e7ccc7e..1f006f5ba61 100644 --- a/addons/account/i18n/pt.po +++ b/addons/account/i18n/pt.po @@ -823,11 +823,6 @@ msgstr "(Manter vazio para todos os anos fiscais aberto)" msgid "Move Lines" msgstr "Linhas de movimentos" -#. module: account -#: model:ir.model,name:account.model_account_config_wizard -msgid "account.config.wizard" -msgstr "account.config.wizard" - #. module: account #: model:ir.actions.act_window,name:account.report_account_analytic_journal_tree #: model:ir.ui.menu,name:account.report_account_analytic_journal_print diff --git a/addons/account/i18n/pt_BR.po b/addons/account/i18n/pt_BR.po index deb3ee9afb8..95117f2d96e 100644 --- a/addons/account/i18n/pt_BR.po +++ b/addons/account/i18n/pt_BR.po @@ -826,11 +826,6 @@ msgstr "(Manter vazio para todos os anos fiscais abertos)" msgid "Move Lines" msgstr "Mover Linhas" -#. module: account -#: model:ir.model,name:account.model_account_config_wizard -msgid "account.config.wizard" -msgstr "account.config.wizard" - #. module: account #: model:ir.actions.act_window,name:account.report_account_analytic_journal_tree #: model:ir.ui.menu,name:account.report_account_analytic_journal_print diff --git a/addons/account/i18n/ro.po b/addons/account/i18n/ro.po index 30c07e9f381..d70c8ee4c69 100644 --- a/addons/account/i18n/ro.po +++ b/addons/account/i18n/ro.po @@ -827,11 +827,6 @@ msgstr "(Lasaţi necompletat pentru toţi anii fiscali deschişi)" msgid "Move Lines" msgstr "Linii mişcări" -#. module: account -#: model:ir.model,name:account.model_account_config_wizard -msgid "account.config.wizard" -msgstr "account.config.wizard" - #. module: account #: model:ir.actions.act_window,name:account.report_account_analytic_journal_tree #: model:ir.ui.menu,name:account.report_account_analytic_journal_print diff --git a/addons/account/i18n/ru.po b/addons/account/i18n/ru.po index 9e34bba0b59..7c0acebc4bc 100644 --- a/addons/account/i18n/ru.po +++ b/addons/account/i18n/ru.po @@ -820,11 +820,6 @@ msgstr "Оставить пустым для всех открытых фина msgid "Move Lines" msgstr "Строки финансового документа" -#. module: account -#: model:ir.model,name:account.model_account_config_wizard -msgid "account.config.wizard" -msgstr "Мастер конфигурации" - #. module: account #: model:ir.actions.act_window,name:account.report_account_analytic_journal_tree #: model:ir.ui.menu,name:account.report_account_analytic_journal_print diff --git a/addons/account/i18n/si.po b/addons/account/i18n/si.po index b717c4bfcec..e7d7718f9e6 100644 --- a/addons/account/i18n/si.po +++ b/addons/account/i18n/si.po @@ -806,11 +806,6 @@ msgstr "" msgid "Move Lines" msgstr "" -#. module: account -#: model:ir.model,name:account.model_account_config_wizard -msgid "account.config.wizard" -msgstr "" - #. module: account #: model:ir.actions.act_window,name:account.report_account_analytic_journal_tree #: model:ir.ui.menu,name:account.report_account_analytic_journal_print diff --git a/addons/account/i18n/sk.po b/addons/account/i18n/sk.po index 7d8c17aee9a..cbe99fcfee3 100644 --- a/addons/account/i18n/sk.po +++ b/addons/account/i18n/sk.po @@ -809,11 +809,6 @@ msgstr "" msgid "Move Lines" msgstr "" -#. module: account -#: model:ir.model,name:account.model_account_config_wizard -msgid "account.config.wizard" -msgstr "" - #. module: account #: model:ir.actions.act_window,name:account.report_account_analytic_journal_tree #: model:ir.ui.menu,name:account.report_account_analytic_journal_print diff --git a/addons/account/i18n/sl.po b/addons/account/i18n/sl.po index ae98b095426..6eb777a8261 100644 --- a/addons/account/i18n/sl.po +++ b/addons/account/i18n/sl.po @@ -818,11 +818,6 @@ msgstr "(Prazno za vsa odprta davčna leta)" msgid "Move Lines" msgstr "Postavke knjižb" -#. module: account -#: model:ir.model,name:account.model_account_config_wizard -msgid "account.config.wizard" -msgstr "account.config.wizard" - #. module: account #: model:ir.actions.act_window,name:account.report_account_analytic_journal_tree #: model:ir.ui.menu,name:account.report_account_analytic_journal_print diff --git a/addons/account/i18n/sq.po b/addons/account/i18n/sq.po index de0b5913aa6..e82be2f3bc9 100644 --- a/addons/account/i18n/sq.po +++ b/addons/account/i18n/sq.po @@ -828,11 +828,6 @@ msgstr "(Mbaje zbrazët për të gjitha vitet fiskale)" msgid "Move Lines" msgstr "Lëviz Linjat" -#. module: account -#: model:ir.model,name:account.model_account_config_wizard -msgid "account.config.wizard" -msgstr "" - #. module: account #: model:ir.actions.act_window,name:account.report_account_analytic_journal_tree #: model:ir.ui.menu,name:account.report_account_analytic_journal_print diff --git a/addons/account/i18n/sr.po b/addons/account/i18n/sr.po index 99cda7934ad..c2a3d8276ae 100644 --- a/addons/account/i18n/sr.po +++ b/addons/account/i18n/sr.po @@ -809,11 +809,6 @@ msgstr "" msgid "Move Lines" msgstr "" -#. module: account -#: model:ir.model,name:account.model_account_config_wizard -msgid "account.config.wizard" -msgstr "" - #. module: account #: model:ir.actions.act_window,name:account.report_account_analytic_journal_tree #: model:ir.ui.menu,name:account.report_account_analytic_journal_print diff --git a/addons/account/i18n/sv.po b/addons/account/i18n/sv.po index 5959bd7abbe..085cc58caba 100644 --- a/addons/account/i18n/sv.po +++ b/addons/account/i18n/sv.po @@ -815,11 +815,6 @@ msgstr "(tomt för alla öppna verksamhetsår)" msgid "Move Lines" msgstr "Flytta rader" -#. module: account -#: model:ir.model,name:account.model_account_config_wizard -msgid "account.config.wizard" -msgstr "account.config.wizard" - #. module: account #: model:ir.actions.act_window,name:account.report_account_analytic_journal_tree #: model:ir.ui.menu,name:account.report_account_analytic_journal_print diff --git a/addons/account/i18n/te.po b/addons/account/i18n/te.po index 53daa3531e5..eaa42f35d86 100644 --- a/addons/account/i18n/te.po +++ b/addons/account/i18n/te.po @@ -806,11 +806,6 @@ msgstr "" msgid "Move Lines" msgstr "" -#. module: account -#: model:ir.model,name:account.model_account_config_wizard -msgid "account.config.wizard" -msgstr "" - #. module: account #: model:ir.actions.act_window,name:account.report_account_analytic_journal_tree #: model:ir.ui.menu,name:account.report_account_analytic_journal_print diff --git a/addons/account/i18n/th.po b/addons/account/i18n/th.po index 3c3e7026dea..320fdc82290 100644 --- a/addons/account/i18n/th.po +++ b/addons/account/i18n/th.po @@ -806,11 +806,6 @@ msgstr "" msgid "Move Lines" msgstr "" -#. module: account -#: model:ir.model,name:account.model_account_config_wizard -msgid "account.config.wizard" -msgstr "" - #. module: account #: model:ir.actions.act_window,name:account.report_account_analytic_journal_tree #: model:ir.ui.menu,name:account.report_account_analytic_journal_print diff --git a/addons/account/i18n/tlh.po b/addons/account/i18n/tlh.po index dbda43952e8..41390d44aac 100644 --- a/addons/account/i18n/tlh.po +++ b/addons/account/i18n/tlh.po @@ -805,11 +805,6 @@ msgstr "" msgid "Move Lines" msgstr "" -#. module: account -#: model:ir.model,name:account.model_account_config_wizard -msgid "account.config.wizard" -msgstr "" - #. module: account #: model:ir.actions.act_window,name:account.report_account_analytic_journal_tree #: model:ir.ui.menu,name:account.report_account_analytic_journal_print diff --git a/addons/account/i18n/tr.po b/addons/account/i18n/tr.po index 6f445a81528..a203f350368 100644 --- a/addons/account/i18n/tr.po +++ b/addons/account/i18n/tr.po @@ -805,11 +805,6 @@ msgstr "" msgid "Move Lines" msgstr "Hareket Kalemleri" -#. module: account -#: model:ir.model,name:account.model_account_config_wizard -msgid "account.config.wizard" -msgstr "" - #. module: account #: model:ir.actions.act_window,name:account.report_account_analytic_journal_tree #: model:ir.ui.menu,name:account.report_account_analytic_journal_print diff --git a/addons/account/i18n/uk.po b/addons/account/i18n/uk.po index fb52db34f13..02020dd4cb8 100644 --- a/addons/account/i18n/uk.po +++ b/addons/account/i18n/uk.po @@ -805,11 +805,6 @@ msgstr "" msgid "Move Lines" msgstr "" -#. module: account -#: model:ir.model,name:account.model_account_config_wizard -msgid "account.config.wizard" -msgstr "" - #. module: account #: model:ir.actions.act_window,name:account.report_account_analytic_journal_tree #: model:ir.ui.menu,name:account.report_account_analytic_journal_print diff --git a/addons/account/i18n/vi.po b/addons/account/i18n/vi.po index b83ea120c76..6e5a40ad057 100644 --- a/addons/account/i18n/vi.po +++ b/addons/account/i18n/vi.po @@ -817,11 +817,6 @@ msgstr "" msgid "Move Lines" msgstr "" -#. module: account -#: model:ir.model,name:account.model_account_config_wizard -msgid "account.config.wizard" -msgstr "" - #. module: account #: model:ir.actions.act_window,name:account.report_account_analytic_journal_tree #: model:ir.ui.menu,name:account.report_account_analytic_journal_print diff --git a/addons/account/i18n/zh_CN.po b/addons/account/i18n/zh_CN.po index f904e3f8d45..5dfad6b78e0 100644 --- a/addons/account/i18n/zh_CN.po +++ b/addons/account/i18n/zh_CN.po @@ -808,11 +808,6 @@ msgstr "(留空为所有开启的会计年度)" msgid "Move Lines" msgstr "凭证明细" -#. module: account -#: model:ir.model,name:account.model_account_config_wizard -msgid "account.config.wizard" -msgstr "科目.设置.向导" - #. module: account #: model:ir.actions.act_window,name:account.report_account_analytic_journal_tree #: model:ir.ui.menu,name:account.report_account_analytic_journal_print diff --git a/addons/account/i18n/zh_HK.po b/addons/account/i18n/zh_HK.po index fa207ddcf49..7ca8d6548e9 100644 --- a/addons/account/i18n/zh_HK.po +++ b/addons/account/i18n/zh_HK.po @@ -806,11 +806,6 @@ msgstr "" msgid "Move Lines" msgstr "" -#. module: account -#: model:ir.model,name:account.model_account_config_wizard -msgid "account.config.wizard" -msgstr "" - #. module: account #: model:ir.actions.act_window,name:account.report_account_analytic_journal_tree #: model:ir.ui.menu,name:account.report_account_analytic_journal_print diff --git a/addons/account/i18n/zh_TW.po b/addons/account/i18n/zh_TW.po index 0b8bfac659b..c73c4d65323 100644 --- a/addons/account/i18n/zh_TW.po +++ b/addons/account/i18n/zh_TW.po @@ -805,11 +805,6 @@ msgstr "" msgid "Move Lines" msgstr "" -#. module: account -#: model:ir.model,name:account.model_account_config_wizard -msgid "account.config.wizard" -msgstr "" - #. module: account #: model:ir.actions.act_window,name:account.report_account_analytic_journal_tree #: model:ir.ui.menu,name:account.report_account_analytic_journal_print diff --git a/addons/account/installer.py b/addons/account/installer.py index 35a09406891..31618122af8 100644 --- a/addons/account/installer.py +++ b/addons/account/installer.py @@ -18,8 +18,11 @@ # along with this program. If not, see . # ############################################################################## -from operator import itemgetter +import time +import datetime +from dateutil.relativedelta import relativedelta +from operator import itemgetter from osv import fields, osv import netsvc @@ -30,10 +33,12 @@ class account_installer(osv.osv_memory): def _get_charts(self, cr, uid, context=None): modules = self.pool.get('ir.module.module') ids = modules.search(cr, uid, [('category_id','=','Account Charts')]) - return list( + charts = list( sorted(((m.name, m.shortdesc) for m in modules.browse(cr, uid, ids)), key=itemgetter(1))) + charts.insert(0,('','')) + return charts _columns = { # Accounting @@ -42,9 +47,6 @@ class account_installer(osv.osv_memory): help="Installs localized accounting charts to match as closely as " "possible the accounting needs of your company based on your " "country."), - 'account_analytic_default':fields.boolean('Analytic Accounting', - help="Automatically selects analytic accounts based on various " - "criteria."), 'account_analytic_plans':fields.boolean('Multiple Analytic Plans', help="Allows invoice lines to impact multiple analytic accounts " "simultaneously."), @@ -57,16 +59,55 @@ class account_installer(osv.osv_memory): "per-partner policies."), 'account_asset':fields.boolean('Assets Management', help="Enables asset management in the accounting application, " - "including asset categories and usage periods.") + "including asset categories and usage periods."), + 'name':fields.char('Name', required=True, size=64, + help="Name of the fiscal year as displayed on screens."), + 'code':fields.char('Code', required=True, size=64, + help="Name of the fiscal year as displayed in reports."), + 'date_start': fields.date('Start Date', required=True), + 'date_stop': fields.date('End Date', required=True), + 'period':fields.selection([('month','Month'), ('3months','3 Months')], + 'Periods', required=True), + 'account_name':fields.char('Name', size=128), + 'account_type':fields.selection([('cash','Cash'),('check','Check'),('bank','Bank')], 'Type', size=32), + 'account_currency':fields.many2one('res.currency', 'Currency') } _defaults = { - 'account_analytic_default':True, + 'code': lambda *a: time.strftime('%Y'), + 'name': lambda *a: time.strftime('%Y'), + 'date_start': lambda *a: time.strftime('%Y-01-01'), + 'date_stop': lambda *a: time.strftime('%Y-12-31'), + 'period':lambda *a:'month', + 'account_currency': lambda self,cr,uid,c: self.pool.get('res.users').browse(cr, uid, uid, c).company_id.currency_id.id, } + def on_change_start_date(self, cr, uid, id, start_date): + if start_date: + start_date = datetime.datetime.strptime(start_date, "%Y-%m-%d") + end_date = (start_date + relativedelta(months=12)) - relativedelta(days=1) + return {'value':{'date_stop':end_date.strftime('%Y-%m-%d')}} + return {} + + def execute(self, cr, uid, ids, context=None): + super(account_installer, self).execute(cr, uid, ids, context=context) + for res in self.read(cr,uid,ids): + if 'date1' in res and 'date2' in res: + res_obj = self.pool.get('account.fiscalyear') + name = res['name'] + vals = {'name':res['name'], + 'code':res['code'], + 'date_start':res['date_start'], + 'date_stop':res['date_stop'], + } + period_id = res_obj.create(cr, uid, vals, context=context) + if res['period'] == 'month': + res_obj.create_period(cr, uid, [period_id]) + elif res['period'] == '3months': + res_obj.create_period3(cr, uid, [period_id]) + def modules_to_install(self, cr, uid, ids, context=None): modules = super(account_installer, self).modules_to_install( cr, uid, ids, context=context) - chart = self.read(cr, uid, ids, ['charts'], context=context)[0]['charts'] self.logger.notifyChannel( diff --git a/addons/account/security/ir.model.access.csv b/addons/account/security/ir.model.access.csv index 656e05e2a9b..e1aa3b6510a 100644 --- a/addons/account/security/ir.model.access.csv +++ b/addons/account/security/ir.model.access.csv @@ -65,8 +65,6 @@ "access_account_fiscalyear_invoice","account.fiscalyear.invoice","model_account_fiscalyear","account.group_account_invoice",1,0,0,0 "access_res_currency_account_manager","res.currency account manager","base.model_res_currency","group_account_manager",1,1,1,1 "access_res_currency_rate_account_manager","res.currency.rate account manager","base.model_res_currency_rate","group_account_manager",1,1,1,1 -"access_account_config_wizard_account_manager","account.config.wizard account manager","model_account_config_wizard","group_account_manager",1,1,1,1 -"access_account_config_wizard_system_manager","account.config.wizard system manager","model_account_config_wizard","base.group_system",1,1,1,1 "access_account_add_tmpl_wizard_account_manager","account.addtmpl.wizard account manager","model_account_addtmpl_wizard","group_account_manager",1,1,1,1 "access_account_add_tmpl_wizard_system_manager","account.addtmpl.wizard system manager","model_account_addtmpl_wizard","base.group_system",1,1,1,1 "access_account_invoice_user","account.invoice user","model_account_invoice","base.group_user",1,0,0,0 diff --git a/addons/base_setup/base_setup_todo.xml b/addons/base_setup/base_setup_todo.xml index 2a7699bf1ea..3ccba59fca0 100644 --- a/addons/base_setup/base_setup_todo.xml +++ b/addons/base_setup/base_setup_todo.xml @@ -34,7 +34,7 @@ - + diff --git a/addons/base_setup/todo.py b/addons/base_setup/todo.py index d23ac71d60b..811d6f21bf5 100644 --- a/addons/base_setup/todo.py +++ b/addons/base_setup/todo.py @@ -48,8 +48,6 @@ class base_setup_company(osv.osv_memory): cr, uid, 'res.country.state', context=context) def _get_all_countries(self, cr, uid, context=None): return self._get_all(cr, uid, 'res.country', context=context) - def _get_all_currencies(self, cr, uid, context=None): - return self._get_all(cr, uid, 'res.currency', context=context) def default_get(self, cr, uid, fields_list=None, context=None): """ get default company if any, and the various other fields @@ -90,7 +88,7 @@ class base_setup_company(osv.osv_memory): 'country_id':fields.selection(_get_all_countries, 'Countries'), 'email':fields.char('E-mail', size=64), 'phone':fields.char('Phone', size=64), - 'currency':fields.selection(_get_all_currencies, 'Currency', required=True), + 'currency':fields.many2one('res.currency', 'Currency', required=True), 'rml_header1':fields.char('Report Header', size=200, help='''This sentence will appear at the top right corner of your reports. We suggest you to put a slogan here: @@ -112,7 +110,6 @@ IBAN: BE74 1262 0121 6907 - SWIFT: CPDF BE71 - VAT: BE0477.472.701'''), if not getattr(payload, 'company_id', None): raise ValueError('Case where no default main company is setup ' 'not handled yet') - company = payload.company_id company.write({ 'name':payload.name, @@ -120,6 +117,7 @@ IBAN: BE74 1262 0121 6907 - SWIFT: CPDF BE71 - VAT: BE0477.472.701'''), 'rml_footer1':payload.rml_footer1, 'rml_footer2':payload.rml_footer2, 'logo':payload.logo, + 'currency_id':payload.currency.id, }) company.partner_id.write({ From 10539da3b281c6d64cf1bf87157958f40869af3e Mon Sep 17 00:00:00 2001 From: "nch@tinyerp.com" <> Date: Fri, 30 Apr 2010 11:52:31 +0530 Subject: [PATCH 21/42] [IMP]:generate chart of account bzr revid: nch@tinyerp.com-20100430062231-b17mlpwi0xpfejmy --- addons/account/account.py | 1 + addons/account/account_view.xml | 16 ++++++++++++---- 2 files changed, 13 insertions(+), 4 deletions(-) diff --git a/addons/account/account.py b/addons/account/account.py index 6a96fba8e16..c965d2cd0e5 100644 --- a/addons/account/account.py +++ b/addons/account/account.py @@ -2117,6 +2117,7 @@ class wizard_multi_charts_accounts(osv.osv_memory): '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, 'code_digits': lambda *a:6, + 'seq_journal': True } def execute(self, cr, uid, ids, context=None): diff --git a/addons/account/account_view.xml b/addons/account/account_view.xml index b72c01f9cf7..515049bba15 100644 --- a/addons/account/account_view.xml +++ b/addons/account/account_view.xml @@ -1698,11 +1698,19 @@
Generate Chart of Accounts from a Chart Template
+ + Generate Chart of Accounts from a Chart Template + + + This will automatically configure your chart of accounts, bank accounts, taxes and journals according to the selected template + 150 + + + 15 + + - -
@@ -45,6 +51,7 @@ 3 + From 565250b15036dd7d38d858eb58a833d8f70733f0 Mon Sep 17 00:00:00 2001 From: "nch@tinyerp.com" <> Date: Fri, 30 Apr 2010 15:05:45 +0530 Subject: [PATCH 25/42] [IMP]:hr_installer and typo in installer bzr revid: nch@tinyerp.com-20100430093545-50ejb9o47qlraw45 --- addons/base_setup/base_setup_installer.xml | 2 +- addons/hr/hr_installer.xml | 7 +++++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/addons/base_setup/base_setup_installer.xml b/addons/base_setup/base_setup_installer.xml index e9d177c77e4..f1c3f0c0b3d 100644 --- a/addons/base_setup/base_setup_installer.xml +++ b/addons/base_setup/base_setup_installer.xml @@ -32,7 +32,7 @@ If you don't think you need any of these right now, you can easily install them - + diff --git a/addons/hr/hr_installer.xml b/addons/hr/hr_installer.xml index 4bbafbf9077..07600ae204a 100644 --- a/addons/hr/hr_installer.xml +++ b/addons/hr/hr_installer.xml @@ -12,14 +12,17 @@ - Configure Human Resources" + Select Human Resources Modules To Install + + 8 + + The base Human Resources addon will help you manage your employee roster, but your can enhance it even further by installing a few HR-related applications. - From b86c436e97075dd6cdb01d305c5145826368d432 Mon Sep 17 00:00:00 2001 From: "nch@tinyerp.com" <> Date: Fri, 30 Apr 2010 15:10:31 +0530 Subject: [PATCH 26/42] [IMP]:profile_tools installer bzr revid: nch@tinyerp.com-20100430094031-1q8hy0izeq9kbcf5 --- addons/profile_tools/misc_tools_installer.xml | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/addons/profile_tools/misc_tools_installer.xml b/addons/profile_tools/misc_tools_installer.xml index 6f4a7aa9e9e..307b5b90a8c 100644 --- a/addons/profile_tools/misc_tools_installer.xml +++ b/addons/profile_tools/misc_tools_installer.xml @@ -10,9 +10,13 @@
Tools Modules Installation
+ + 10 + + - Select Tools To Install + Tools @@ -20,7 +24,6 @@ >Here are a few useful applications which, while they don't directly contribute to your business, can improve on it or improve your OpenERP experience - From e6768813860a3a62dcc44c1f66bebf698cd7c4fd Mon Sep 17 00:00:00 2001 From: Stephane Wirtel Date: Fri, 30 Apr 2010 11:42:24 +0200 Subject: [PATCH 27/42] [FIX] base: the search for the res.country.state is not case sensitive bzr revid: stephane@openerp.com-20100430094224-59w78o78347j2hf2 --- bin/addons/base/res/country.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bin/addons/base/res/country.py b/bin/addons/base/res/country.py index 272b0257a49..99e12a96f78 100644 --- a/bin/addons/base/res/country.py +++ b/bin/addons/base/res/country.py @@ -86,7 +86,7 @@ class CountryState(osv.osv): args = [] if not context: context = {} - ids = self.search(cr, user, [('code', '=', name)] + args, limit=limit, + ids = self.search(cr, user, [('code', 'ilike', name)] + args, limit=limit, context=context) if not ids: ids = self.search(cr, user, [('name', operator, name)] + args, From 5a5a73b84da04292933de8280a4e221c6a3028d4 Mon Sep 17 00:00:00 2001 From: "nch@tinyerp.com" <> Date: Fri, 30 Apr 2010 15:20:20 +0530 Subject: [PATCH 28/42] association bzr revid: nch@tinyerp.com-20100430095020-mgndtilsqsa5wm1o --- addons/association/profile_association.xml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/addons/association/profile_association.xml b/addons/association/profile_association.xml index 0f376ea4069..827cdb42d18 100644 --- a/addons/association/profile_association.xml +++ b/addons/association/profile_association.xml @@ -11,6 +11,9 @@
Install Extra Modules
+ + + Install more modules. A few modules are proposed according to the Association Profile you selected. You will be able to install them based on our requirements. From 5ade556cc694b101e258e80bc75540a33e54696d Mon Sep 17 00:00:00 2001 From: "nch@tinyerp.com" <> Date: Fri, 30 Apr 2010 15:28:30 +0530 Subject: [PATCH 29/42] [IMP]:profile_manufacturing bzr revid: nch@tinyerp.com-20100430095830-jhh9gydfkky4jl3d --- addons/profile_manufacturing/profile_manufacturing.xml | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/addons/profile_manufacturing/profile_manufacturing.xml b/addons/profile_manufacturing/profile_manufacturing.xml index ae659245907..df8c56c77cb 100644 --- a/addons/profile_manufacturing/profile_manufacturing.xml +++ b/addons/profile_manufacturing/profile_manufacturing.xml @@ -11,15 +11,18 @@
Manufacturing Profile: Install Extra Modules
+ + 15 + + Here are a few modules which might be useful along with the rest of the Manufacturing profile. You can also install them the normal way later on, but if you think you'll need them to fit your requirements, you can select them now and they'll be installed immediately. - Manufacturing Modules + Stock & Manufacturing - From 03f9187999f74090dd35a9985bebc955ce1faea0 Mon Sep 17 00:00:00 2001 From: "nch@tinyerp.com" <> Date: Fri, 30 Apr 2010 15:32:30 +0530 Subject: [PATCH 30/42] [IMP]:project config wizard bzr revid: nch@tinyerp.com-20100430100230-a3nfrzir53yg6xa1 --- addons/project/project_installer.xml | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/addons/project/project_installer.xml b/addons/project/project_installer.xml index 3b6eb103972..d8a503e00fa 100644 --- a/addons/project/project_installer.xml +++ b/addons/project/project_installer.xml @@ -13,14 +13,17 @@ Configure Your Project Management + >Project Management + + 10 + + Various OpenERP applications are available to bring your project management to the next levels of control and flexibility. - From eb4192f6b0f4aea4a31963206c787a78b95a72a5 Mon Sep 17 00:00:00 2001 From: "nch@tinyerp.com" <> Date: Fri, 30 Apr 2010 15:35:46 +0530 Subject: [PATCH 31/42] [IMP]:report designer config wizard bzr revid: nch@tinyerp.com-20100430100546-b3tx17qfq7tapqte --- addons/report_designer/report_designer_installer.xml | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/addons/report_designer/report_designer_installer.xml b/addons/report_designer/report_designer_installer.xml index bbef853ed79..76adb3eddf1 100644 --- a/addons/report_designer/report_designer_installer.xml +++ b/addons/report_designer/report_designer_installer.xml @@ -10,10 +10,13 @@
Report Modules Installation
- + + 7 + + Select Reporting Tools To Install + >Reporting Tools @@ -21,7 +24,6 @@ >OpenERP's built-in reporting abilities can be improved even further with some of the following applications - From 3b69c2ce748263bf534543e2fd4a7a50389131c3 Mon Sep 17 00:00:00 2001 From: "nch@tinyerp.com" <> Date: Fri, 30 Apr 2010 15:40:06 +0530 Subject: [PATCH 32/42] [IMP]:service_mgmt installer bzr revid: nch@tinyerp.com-20100430101006-6dew33g924nle1of --- addons/service/service_installer.xml | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/addons/service/service_installer.xml b/addons/service/service_installer.xml index 059d114a66b..07d9e839376 100644 --- a/addons/service/service_installer.xml +++ b/addons/service/service_installer.xml @@ -1,7 +1,7 @@ - + Service Profile : Install extra modules profile.service.config.install_modules_wizard @@ -12,7 +12,9 @@
Install Extra Service Profile Modules
- + + + Services Management @@ -42,7 +44,7 @@
- + Service Profile : Install Extra Modules ir.actions.act_window From eba5bcdc2030bcffaee7d864d5c0e5fd515bc7bf Mon Sep 17 00:00:00 2001 From: "PAP(OpenERP)" <> Date: Fri, 30 Apr 2010 19:48:10 +0530 Subject: [PATCH 33/42] Improved yml import for recording osv.memory objects bzr revid: hda@tinyerp.com-20100430141810-pvp1ah28b5j6fsxo --- bin/tools/yaml_import.py | 85 ++++++++++++++++++++++++++-------------- bin/tools/yaml_tag.py | 39 +++++++++--------- 2 files changed, 74 insertions(+), 50 deletions(-) diff --git a/bin/tools/yaml_import.py b/bin/tools/yaml_import.py index 90bece88ee4..ed481b2d0b3 100644 --- a/bin/tools/yaml_import.py +++ b/bin/tools/yaml_import.py @@ -256,28 +256,41 @@ class YamlInterpreter(object): b = default return b - def process_record(self, node): - record, fields = node.items()[0] - - self.validate_xml_id(record.id) - if self.isnoupdate(record) and self.mode != 'init': - id = self.pool.get('ir.model.data')._update_dummy(self.cr, self.uid, record.model, self.module, record.id) - # check if the resource already existed at the last update - if id: - self.id_map[record] = int(id) - return None - else: - if not self._coerce_bool(record.forcecreate): - return None - + def create_osv_memory_record(self, record, fields): model = self.get_model(record.model) record_dict = self._create_record(model, fields) - self.logger.debug("RECORD_DICT %s" % record_dict) - id = self.pool.get('ir.model.data')._update(self.cr, self.uid, record.model, \ - self.module, record_dict, record.id, noupdate=self.isnoupdate(record), mode=self.mode) - self.id_map[record.id] = int(id) - if config.get('import_partial', False): - self.cr.commit() + id_new=model.create(self.cr, self.uid, record_dict, context=self.context) + self.id_map[record.id] = int(id_new) + return record_dict + + def process_record(self, node): + import osv + record, fields = node.items()[0] + model = self.get_model(record.model) + model_bases = model.__class__.__bases__ + if osv.osv.osv_memory in model_bases: + record_dict=self.create_osv_memory_record(record, fields) + else: + self.validate_xml_id(record.id) + if self.isnoupdate(record) and self.mode != 'init': + id = self.pool.get('ir.model.data')._update_dummy(self.cr, self.uid, record.model, self.module, record.id) + # check if the resource already existed at the last update + if id: + self.id_map[record] = int(id) + return None + else: + if not self._coerce_bool(record.forcecreate): + return None + + model = self.get_model(record.model) + record_dict = self._create_record(model, fields) + self.logger.debug("RECORD_DICT %s" % record_dict) + if not osv.osv.osv_memory in model_bases: + id = self.pool.get('ir.model.data')._update(self.cr, self.uid, record.model, \ + self.module, record_dict, record.id, noupdate=self.isnoupdate(record), mode=self.mode) + self.id_map[record.id] = int(id) + if config.get('import_partial', False): + self.cr.commit() def _create_record(self, model, fields): record_dict = {} @@ -390,6 +403,10 @@ class YamlInterpreter(object): uid = workflow.uid else: uid = self.uid + self.cr.execute('select distinct signal from wkf_transition') + signals=[x['signal'] for x in self.cr.dictfetchall()] + if workflow.action not in signals: + raise YamlImportException('Incorrect action %s. No such action defined' % workflow.action) wf_service = netsvc.LocalService("workflow") wf_service.trg_validate(uid, workflow.model, id, workflow.action, self.cr) @@ -528,15 +545,19 @@ class YamlInterpreter(object): 'tree_but_open', 'Menuitem', [('ir.ui.menu', int(parent_id))], action, True, True, xml_id=node.id) def process_act_window(self, node): + assert getattr(node, 'id'), "Attribute %s of act_window is empty !" % ('id',) + assert getattr(node, 'name'), "Attribute %s of act_window is empty !" % ('name',) + assert getattr(node, 'res_model'), "Attribute %s of act_window is empty !" % ('res_model',) self.validate_xml_id(node.id) view_id = False if node.view: view_id = self.get_id(node.view) - context = eval(node.context, self.eval_context) - + if not node.context: + node.context={} + context = eval(str(node.context), self.eval_context) values = { 'name': node.name, - 'type': type or 'ir.actions.act_window', + 'type': node.type or 'ir.actions.act_window', 'view_id': view_id, 'domain': node.domain, 'context': context, @@ -566,13 +587,17 @@ class YamlInterpreter(object): # TODO add remove ir.model.data def process_delete(self, node): - if len(node.search): - ids = self.pool.get(node.model).search(self.cr, self.uid, eval(node.search, self.eval_context)) + assert getattr(node, 'model'), "Attribute %s of delete tag is empty !" % ('model',) + if self.pool.get(node.model): + if len(node.search): + ids = self.pool.get(node.model).search(self.cr, self.uid, eval(node.search, self.eval_context)) + else: + ids = [self.get_id(node.id)] + if len(ids): + self.pool.get(node.model).unlink(self.cr, self.uid, ids) + self.pool.get('ir.model.data')._unlink(self.cr, self.uid, node.model, ids) else: - ids = [self.get_id(node.id)] - if len(ids): - self.pool.get(node.model).unlink(self.cr, self.uid, ids) - self.pool.get('ir.model.data')._unlink(self.cr, self.uid, node.model, ids) + self.logger.log(logging.TEST, "Record not deleted.") def process_url(self, node): self.validate_xml_id(node.id) @@ -649,6 +674,8 @@ class YamlInterpreter(object): """ Processes a Yaml string. Custom tags are interpreted by 'process_' instance methods. """ + yaml_tag.add_constructors() + is_preceded_by_comment = False for node in yaml.load(yaml_string): is_preceded_by_comment = self._log(node, is_preceded_by_comment) diff --git a/bin/tools/yaml_tag.py b/bin/tools/yaml_tag.py index cdc892d9b80..817f7d55a3c 100644 --- a/bin/tools/yaml_tag.py +++ b/bin/tools/yaml_tag.py @@ -48,9 +48,7 @@ class Workflow(YamlTag): super(Workflow, self).__init__(**kwargs) class ActWindow(YamlTag): - def __init__(self, model, action, **kwargs): - self.model = model - self.action = action + def __init__(self, **kwargs): super(ActWindow, self).__init__(**kwargs) class Function(YamlTag): @@ -67,10 +65,7 @@ class Report(YamlTag): super(Report, self).__init__(**kwargs) class Delete(YamlTag): - def __init__(self, model, id, search, **kwargs): - self.model = model - self.id = id - self.search = search + def __init__(self, **kwargs): super(Delete, self).__init__(**kwargs) class Context(YamlTag): @@ -156,17 +151,19 @@ def ir_set_constructor(loader, node): # Registers constructors for custom tags. # Constructors are actually defined globally: do not redefined them in another # class/file/package. This means that module recorder need import this file. -yaml.add_constructor(u"!assert", assert_constructor) -yaml.add_constructor(u"!record", record_constructor) -yaml.add_constructor(u"!python", python_constructor) -yaml.add_constructor(u"!menuitem", menuitem_constructor) -yaml.add_constructor(u"!workflow", workflow_constructor) -yaml.add_constructor(u"!act_window", act_window_constructor) -yaml.add_constructor(u"!function", function_constructor) -yaml.add_constructor(u"!report", report_constructor) -yaml.add_constructor(u"!context", context_constructor) -yaml.add_constructor(u"!delete", delete_constructor) -yaml.add_constructor(u"!url", url_constructor) -yaml.add_constructor(u"!eval", eval_constructor) -yaml.add_multi_constructor(u"!ref", ref_constructor) -yaml.add_constructor(u"!ir_set", ir_set_constructor) +def add_constructors(): + yaml.add_constructor(u"!assert", assert_constructor) + yaml.add_constructor(u"!record", record_constructor) + yaml.add_constructor(u"!python", python_constructor) + yaml.add_constructor(u"!menuitem", menuitem_constructor) + yaml.add_constructor(u"!workflow", workflow_constructor) + yaml.add_constructor(u"!act_window", act_window_constructor) + yaml.add_constructor(u"!function", function_constructor) + yaml.add_constructor(u"!report", report_constructor) + yaml.add_constructor(u"!context", context_constructor) + yaml.add_constructor(u"!delete", delete_constructor) + yaml.add_constructor(u"!url", url_constructor) + yaml.add_constructor(u"!eval", eval_constructor) + yaml.add_multi_constructor(u"!ref", ref_constructor) + yaml.add_constructor(u"!ir_set", ir_set_constructor) +add_constructors() \ No newline at end of file From 9e36298cf02a2a0fba043cdb81888b03b83f155e Mon Sep 17 00:00:00 2001 From: "PAP(OpenERP)" <> Date: Fri, 30 Apr 2010 19:52:50 +0530 Subject: [PATCH 34/42] Added commmand line arguments to make yml test easier bzr revid: hda@tinyerp.com-20100430142250-ieb6mzx59wyvl3u9 --- bin/addons/__init__.py | 18 ++++++++++++++---- bin/tools/config.py | 18 +++++++++++++++++- 2 files changed, 31 insertions(+), 5 deletions(-) diff --git a/bin/addons/__init__.py b/bin/addons/__init__.py index b1b140159c1..02803de0d75 100644 --- a/bin/addons/__init__.py +++ b/bin/addons/__init__.py @@ -640,10 +640,20 @@ def load_module_graph(cr, graph, status=None, perform_checks=True, **kwargs): def load_test(cr, module_name, id_map, mode): cr.commit() - try: - _load_data(cr, module_name, id_map, mode, 'test') - finally: - cr.rollback() + if not tools.config.options['test-disable']: + try: + _load_data(cr, module_name, id_map, mode, 'test') + except Exception, e: + if tools.config.options['test-continue']: + logger.notifyChannel('ERROR', netsvc.LOG_TEST, str(e)) + pass + else: + raise Exception + finally: + if tools.config.options['test-rollback']: + cr.rollback() + else: + cr.commit() def _load_data(cr, module_name, id_map, mode, kind): noupdate = (kind == 'demo') diff --git a/bin/tools/config.py b/bin/tools/config.py index 8f1f1ca55ea..a92948b8af0 100644 --- a/bin/tools/config.py +++ b/bin/tools/config.py @@ -82,6 +82,9 @@ class configmanager(object): 'login_message': False, 'list_db' : True, 'timezone' : False, # to override the default TZ + 'test-disable' : False, + 'test-rollback' : True, + 'test-continue' : False } self.misc = {} @@ -134,7 +137,17 @@ class configmanager(object): default="server.pkey", help="specify the private key file for the SSL connection") parser.add_option_group(group) - + + # Testing Group + group = optparse.OptionGroup(parser, "Testing Configuration") + group.add_option("--test-disable", action="store_true", dest="test_disable", + default=False, help="Disable loading test files.") + group.add_option("--test-no-rollback", action="store_false", dest="test_rollback", + default=True, help="Don't rollback after running test.") + group.add_option("--test-continue", action="store_true", dest="test_continue", + default=False, help="Display exception but then test should continue.") + parser.add_option_group(group) + # Logging Group group = optparse.OptionGroup(parser, "Logging Configuration") group.add_option("--logfile", dest="logfile", help="file where the server log will be stored") @@ -274,6 +287,9 @@ class configmanager(object): self.options['init'] = opt.init and dict.fromkeys(opt.init.split(','), 1) or {} self.options["demo"] = not opt.without_demo and self.options['init'] or {} + self.options["test-disable"] = opt.test_disable + self.options["test-rollback"] = opt.test_rollback + self.options["test-continue"] = opt.test_continue self.options['update'] = opt.update and dict.fromkeys(opt.update.split(','), 1) or {} self.options['translate_modules'] = opt.translate_modules and map(lambda m: m.strip(), opt.translate_modules.split(',')) or ['all'] From da17e9c16111f90886f68e1db761e6673b89fa21 Mon Sep 17 00:00:00 2001 From: Olivier Dony Date: Fri, 30 Apr 2010 16:57:54 +0200 Subject: [PATCH 35/42] [FIX] reviewed and improved some naming and formatting, plus removed attrs from field if groups disallows showing it bzr revid: odo@openerp.com-20100430145754-og8gm3dlma5qwm89 --- bin/osv/orm.py | 28 +++++++++++++++++----------- 1 file changed, 17 insertions(+), 11 deletions(-) diff --git a/bin/osv/orm.py b/bin/osv/orm.py index af140909664..b0ac064e199 100644 --- a/bin/osv/orm.py +++ b/bin/osv/orm.py @@ -1138,17 +1138,24 @@ class orm_template(object): if isinstance(s, unicode): return s.encode('utf8') return s + + # return True if node can be displayed to current user def check_group(node): if node.get('groups'): groups = node.get('groups').split(',') - readonly = False + can_see = False access_pool = self.pool.get('ir.model.access') for group in groups: - readonly = readonly or access_pool.check_groups(cr, user, group) - if not readonly: + can_see = can_see or access_pool.check_groups(cr, user, group) + if can_see: + break + if not can_see: node.set('invisible', '1') + if 'attrs' in node.attrib: + del(node.attrib['attrs']) #avoid making field visible later del(node.attrib['groups']) - + return can_see + if node.tag in ('field', 'node', 'arrow'): if node.get('object'): attrs = {} @@ -1195,9 +1202,7 @@ class orm_template(object): } attrs = {'views': views} if node.get('widget') and node.get('widget') == 'selection': - if 'groups' in node.attrib: - check_group(node) - if node.get('invisible'): + if not check_group(node) attrs['selection'] = [] # We can not use the 'string' domain has it is defined according to the record ! else: @@ -1206,7 +1211,7 @@ class orm_template(object): dom = column._domain dom += eval(node.get('domain','[]'), {'uid':user, 'time':time}) context.update(eval(node.get('context','{}'))) - attrs['selection'] = self.pool.get(relation)._name_search(cr, user, '', dom, context=context,limit=None,name_get_uid=1) + attrs['selection'] = self.pool.get(relation)._name_search(cr, user, '', dom, context=context, limit=None, name_get_uid=1) if (node.get('required') and not int(node.get('required'))) or not column.required: attrs['selection'].append((False,'')) fields[node.get('name')] = attrs @@ -3656,6 +3661,8 @@ class orm(orm_template): return [(r['id'], tools.ustr(r[self._rec_name])) for r in self.read(cr, user, ids, [self._rec_name], context, load='_classic_write')] + # private implementation of name_search, allows passing a dedicated user for the name_get part to + # solve some access rights issues def _name_search(self, cr, user, name='', args=None, operator='ilike', context=None, limit=100, name_get_uid=None): if not args: args = [] @@ -3665,7 +3672,7 @@ class orm(orm_template): if name: args += [(self._rec_name, operator, name)] ids = self.search(cr, user, args, limit=limit, context=context) - res = self.name_get(cr, name_get_uid, ids, context) + res = self.name_get(cr, name_get_uid or user, ids, context) return res def name_search(self, cr, user, name='', args=None, operator='ilike', context=None, limit=100): @@ -3683,9 +3690,8 @@ class orm(orm_template): This method is equivalent of search() on name + name_get() """ + return self._name_search(cr, user, name, args, operator, context, limit) - return self._name_search(cr, user, name, args, operator, context, limit, user) - def copy_data(self, cr, uid, id, default=None, context=None): """ Copy given record's data with all its fields values From a42aaf14cbbafa6433784fae730252732e467d1d Mon Sep 17 00:00:00 2001 From: Launchpad Code Hosting Date: Mon, 3 May 2010 05:03:32 +0100 Subject: [PATCH 36/42] Launchpad automatic translations update. bzr revid: codehost@crowberry-20100501035453-hziicka4anasmcx3 bzr revid: codehost@crowberry-20100502035702-ng8eqf5j0pzfunju bzr revid: codehost@crowberry-20100503040332-ejq7bph3qyvydxzn --- bin/addons/base/i18n/ca.po | 34 +++++++++++++++++----------------- bin/addons/base/i18n/es.po | 19 ++++++++++--------- bin/addons/base/i18n/hr.po | 4 ++-- bin/addons/base/i18n/ja.po | 4 ++-- bin/addons/base/i18n/sv.po | 4 ++-- bin/addons/base/i18n/uk.po | 4 ++-- bin/addons/base/i18n/zh_CN.po | 4 ++-- 7 files changed, 37 insertions(+), 36 deletions(-) diff --git a/bin/addons/base/i18n/ca.po b/bin/addons/base/i18n/ca.po index e64daf5a6e9..79d255c529b 100644 --- a/bin/addons/base/i18n/ca.po +++ b/bin/addons/base/i18n/ca.po @@ -7,14 +7,14 @@ msgstr "" "Project-Id-Version: OpenERP Server 5.0.4\n" "Report-Msgid-Bugs-To: support@openerp.com\n" "POT-Creation-Date: 2009-12-18 08:39+0000\n" -"PO-Revision-Date: 2010-02-07 05:09+0000\n" +"PO-Revision-Date: 2010-05-02 05:54+0000\n" "Last-Translator: Jordi Esteve - http://www.zikzakmedia.com " "\n" "Language-Team: \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"X-Launchpad-Export-Date: 2010-04-17 03:49+0000\n" +"X-Launchpad-Export-Date: 2010-05-03 04:02+0000\n" "X-Generator: Launchpad (build Unknown)\n" #. module: base @@ -109,7 +109,7 @@ msgid "" msgstr "" "Escolliu entre la \"Interfície simplificada\" o \"Interfície estesa\".\n" "Si esteu examinant o utilitzant OpenERP per la primera vegada,\n" -"us suggerim per utilitzar la interfície simplificada, que té menys\n" +"us suggerim que utilitzeu la interfície simplificada, que té menys\n" "opcions i camps però és més fàcil d'entendre. Més tard podreu\n" "canviar a la vista estesa.\n" " " @@ -388,8 +388,8 @@ msgid "" "If you check this, then the second time the user prints with same attachment " "name, it returns the previous report." msgstr "" -"Si marca aquesta opció, quan l'usuari imprimeixi el mateix nom d'adjunt per " -"segona vegada, tornarà l'informe anterior." +"Si marqueu aquesta opció, quan l'usuari imprimeixi el mateix nom d'adjunt " +"per segona vegada, obtindrá l'informe anterior." #. module: base #: help:res.lang,iso_code:0 @@ -433,7 +433,7 @@ msgid "" "The ISO country code in two chars.\n" "You can use this field for quick search." msgstr "" -"EL codi ISO del país en dos caràcters.\n" +"EL codi ISO del país de dos caràcters.\n" "Podeu utilitzar aquest camp per la cerca ràpida." #. module: base @@ -474,7 +474,7 @@ msgstr "Interfície estesa" #: code:addons/base/ir/ir_model.py:0 #, python-format msgid "Custom fields must have a name that starts with 'x_' !" -msgstr "Els camps personalitzats han de tenir un nom que comença con 'x_'!" +msgstr "Els camps personalitzats han de tenir un nom que comenci amb 'x_'!" #. module: base #: help:ir.actions.server,action_id:0 @@ -913,7 +913,7 @@ msgstr "STOCK_MISSING_IMAGE" #. module: base #: view:res.users:0 msgid "Define New Users" -msgstr "Defineix nous usuaris" +msgstr "Definiu nous usuaris" #. module: base #: selection:ir.ui.menu,icon:0 @@ -1489,7 +1489,7 @@ msgstr "Menú" #. module: base #: field:res.currency,rate:0 msgid "Current Rate" -msgstr "Tasa" +msgstr "Taxa" #. module: base #: selection:module.lang.install,init,lang:0 @@ -3124,7 +3124,7 @@ msgid "" "any." msgstr "" "L'usuari intern que s'encarrega de comunicar-se amb aquesta empresa, si " -"n'hi ha." +"n'hi hagués." #. module: base #: field:res.partner,parent_id:0 @@ -5073,8 +5073,8 @@ msgstr "Islàndia" #: view:res.users:0 msgid "Roles are used to defined available actions, provided by workflows." msgstr "" -"Els rols s'utilitzen per definir les accions disponibles, de les que " -"proveeixen els fluxos." +"Els rols s'utilitzen per definir les accions disponibles dins d'un flux de " +"treball." #. module: base #: model:res.country,name:base.de @@ -5437,7 +5437,7 @@ msgstr "Dia de l'any: %(doy)s" #. module: base #: model:res.country,name:base.nt msgid "Neutral Zone" -msgstr "Zona Neutral" +msgstr "Zona neutral" #. module: base #: view:ir.model:0 @@ -5828,7 +5828,7 @@ msgstr "Companyia per defecte per objecte" #. module: base #: view:ir.actions.configuration.wizard:0 msgid "Next Configuration Step" -msgstr "Següent pas configuració" +msgstr "Següent pas de la configuració" #. module: base #: field:res.groups,comment:0 @@ -6645,8 +6645,8 @@ msgid "" "Access all the fields related to the current object using expression in " "double brackets, i.e. [[ object.partner_id.name ]]" msgstr "" -"Accedeix a tots els camps relacionats amb l'objecte actual mitjançant una " -"expressió en claudàtors dobles, per exemple [[ object.partner_id.name ]]" +"Podeu accedir a tots els camps relacionats amb l'objecte actual mitjançant " +"una expressió en claudàtors dobles, per exemple [[ object.partner_id.name ]]" #. module: base #: field:res.request.history,body:0 @@ -8088,7 +8088,7 @@ msgstr "" #. module: base #: wizard_view:module.lang.install,init:0 msgid "Choose a language to install:" -msgstr "Selecciona un idioma per instal·lar:" +msgstr "Seleccioneu un idioma a instal·lar:" #. module: base #: model:res.country,name:base.lk diff --git a/bin/addons/base/i18n/es.po b/bin/addons/base/i18n/es.po index 2303ddf769a..5524104bb92 100644 --- a/bin/addons/base/i18n/es.po +++ b/bin/addons/base/i18n/es.po @@ -7,14 +7,14 @@ msgstr "" "Project-Id-Version: OpenERP Server 5.0.4\n" "Report-Msgid-Bugs-To: support@openerp.com\n" "POT-Creation-Date: 2009-12-18 08:39+0000\n" -"PO-Revision-Date: 2010-02-07 05:11+0000\n" +"PO-Revision-Date: 2010-05-02 05:52+0000\n" "Last-Translator: Jordi Esteve - http://www.zikzakmedia.com " "\n" "Language-Team: \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"X-Launchpad-Export-Date: 2010-04-17 03:52+0000\n" +"X-Launchpad-Export-Date: 2010-05-03 04:03+0000\n" "X-Generator: Launchpad (build Unknown)\n" #. module: base @@ -389,7 +389,7 @@ msgid "" "name, it returns the previous report." msgstr "" "Si marca esta opción, cuando el usuario imprima el mismo nombre de adjunto " -"por segunda vez, devolverá el informe anterior." +"por segunda vez, obtendrá el informe anterior." #. module: base #: help:res.lang,iso_code:0 @@ -434,8 +434,8 @@ msgid "" "The ISO country code in two chars.\n" "You can use this field for quick search." msgstr "" -"EL código ISO del país en dos caracteres.\n" -"Puede usar este campo para la búsqueda rápida." +"EL código ISO del país de dos caracteres.\n" +"Puede utilizar este campo para la búsqueda rápida." #. module: base #: selection:workflow.activity,join_mode:0 @@ -3127,7 +3127,8 @@ msgid "" "The internal user that is in charge of communicating with this partner if " "any." msgstr "" -"El usuario interno que se encarga de comunicarse con esta empresa si hay." +"El usuario interno que se encarga de comunicarse con esta empresa, si los " +"hubiera." #. module: base #: field:res.partner,parent_id:0 @@ -5076,8 +5077,8 @@ msgstr "Islandia" #: view:res.users:0 msgid "Roles are used to defined available actions, provided by workflows." msgstr "" -"Los roles se utilizan para definir las acciones disponibles, que son " -"proporcionadas por los flujos." +"Los roles se utilizan para definir las acciones disponibles dentro de un " +"flujo de trabajo." #. module: base #: model:res.country,name:base.de @@ -5830,7 +5831,7 @@ msgstr "Compañía por defecto por objeto" #. module: base #: view:ir.actions.configuration.wizard:0 msgid "Next Configuration Step" -msgstr "Siguiente paso configuración" +msgstr "Siguiente paso de la configuración" #. module: base #: field:res.groups,comment:0 diff --git a/bin/addons/base/i18n/hr.po b/bin/addons/base/i18n/hr.po index f66421b44ce..4fb8e0f8249 100644 --- a/bin/addons/base/i18n/hr.po +++ b/bin/addons/base/i18n/hr.po @@ -7,13 +7,13 @@ msgstr "" "Project-Id-Version: OpenERP Server 5.0.4\n" "Report-Msgid-Bugs-To: support@openerp.com\n" "POT-Creation-Date: 2009-12-18 08:39+0000\n" -"PO-Revision-Date: 2010-04-29 04:38+0000\n" +"PO-Revision-Date: 2010-05-02 05:19+0000\n" "Last-Translator: goranc \n" "Language-Team: openerp-translators\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"X-Launchpad-Export-Date: 2010-04-30 03:50+0000\n" +"X-Launchpad-Export-Date: 2010-05-03 04:03+0000\n" "X-Generator: Launchpad (build Unknown)\n" "Language: hr\n" diff --git a/bin/addons/base/i18n/ja.po b/bin/addons/base/i18n/ja.po index b53a444998d..be4a2828ed8 100644 --- a/bin/addons/base/i18n/ja.po +++ b/bin/addons/base/i18n/ja.po @@ -8,13 +8,13 @@ msgstr "" "Project-Id-Version: openobject-server\n" "Report-Msgid-Bugs-To: FULL NAME \n" "POT-Creation-Date: 2009-12-18 08:39+0000\n" -"PO-Revision-Date: 2010-04-29 04:36+0000\n" +"PO-Revision-Date: 2010-05-02 05:13+0000\n" "Last-Translator: Harry (Open ERP) \n" "Language-Team: Japanese \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"X-Launchpad-Export-Date: 2010-04-30 03:50+0000\n" +"X-Launchpad-Export-Date: 2010-05-03 04:02+0000\n" "X-Generator: Launchpad (build Unknown)\n" #. module: base diff --git a/bin/addons/base/i18n/sv.po b/bin/addons/base/i18n/sv.po index 29ddcfda776..0e2ae3adae0 100644 --- a/bin/addons/base/i18n/sv.po +++ b/bin/addons/base/i18n/sv.po @@ -7,13 +7,13 @@ msgstr "" "Project-Id-Version: OpenERP Server 5.0.0\n" "Report-Msgid-Bugs-To: support@openerp.com\n" "POT-Creation-Date: 2009-12-18 08:39+0000\n" -"PO-Revision-Date: 2010-04-29 04:41+0000\n" +"PO-Revision-Date: 2010-05-02 05:47+0000\n" "Last-Translator: Anders Wallenquist \n" "Language-Team: <>\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"X-Launchpad-Export-Date: 2010-04-30 03:50+0000\n" +"X-Launchpad-Export-Date: 2010-05-03 04:03+0000\n" "X-Generator: Launchpad (build Unknown)\n" #. module: base diff --git a/bin/addons/base/i18n/uk.po b/bin/addons/base/i18n/uk.po index 65f065c9942..d6d7e110aff 100644 --- a/bin/addons/base/i18n/uk.po +++ b/bin/addons/base/i18n/uk.po @@ -7,13 +7,13 @@ msgstr "" "Project-Id-Version: OpenERP Server 5.0.0\n" "Report-Msgid-Bugs-To: support@openerp.com\n" "POT-Creation-Date: 2009-12-18 08:39+0000\n" -"PO-Revision-Date: 2010-04-29 04:39+0000\n" +"PO-Revision-Date: 2010-05-02 05:32+0000\n" "Last-Translator: Fabien (Open ERP) \n" "Language-Team: \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"X-Launchpad-Export-Date: 2010-04-30 03:50+0000\n" +"X-Launchpad-Export-Date: 2010-05-03 04:03+0000\n" "X-Generator: Launchpad (build Unknown)\n" #. module: base diff --git a/bin/addons/base/i18n/zh_CN.po b/bin/addons/base/i18n/zh_CN.po index 729acf9e52b..a6f9bd69315 100644 --- a/bin/addons/base/i18n/zh_CN.po +++ b/bin/addons/base/i18n/zh_CN.po @@ -7,13 +7,13 @@ msgstr "" "Project-Id-Version: OpenERP Server 5.0.4\n" "Report-Msgid-Bugs-To: support@openerp.com\n" "POT-Creation-Date: 2009-12-18 08:39+0000\n" -"PO-Revision-Date: 2010-04-29 04:40+0000\n" +"PO-Revision-Date: 2010-05-02 05:37+0000\n" "Last-Translator: OpenERP Administrators \n" "Language-Team: \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"X-Launchpad-Export-Date: 2010-04-30 03:50+0000\n" +"X-Launchpad-Export-Date: 2010-05-03 04:03+0000\n" "X-Generator: Launchpad (build Unknown)\n" #. module: base From 56936a1b0a4a85342c8c122a064d62b46ed93dc8 Mon Sep 17 00:00:00 2001 From: "nch@tinyerp.com" <> Date: Mon, 3 May 2010 15:58:01 +0530 Subject: [PATCH 37/42] [IMP]:account installer bzr revid: nch@tinyerp.com-20100503102801-p7fxk407o5s1ymyj --- addons/account/account_installer.xml | 15 ++++++++------- addons/account/installer.py | 19 ++++++++----------- 2 files changed, 16 insertions(+), 18 deletions(-) diff --git a/addons/account/account_installer.xml b/addons/account/account_installer.xml index 3cd0495904e..5eec07067ef 100644 --- a/addons/account/account_installer.xml +++ b/addons/account/account_installer.xml @@ -29,10 +29,13 @@ - - - - + + + + + + + @@ -40,9 +43,7 @@ - - - + diff --git a/addons/account/installer.py b/addons/account/installer.py index 31618122af8..ca62f758788 100644 --- a/addons/account/installer.py +++ b/addons/account/installer.py @@ -60,21 +60,15 @@ class account_installer(osv.osv_memory): 'account_asset':fields.boolean('Assets Management', help="Enables asset management in the accounting application, " "including asset categories and usage periods."), - 'name':fields.char('Name', required=True, size=64, - help="Name of the fiscal year as displayed on screens."), - 'code':fields.char('Code', required=True, size=64, - help="Name of the fiscal year as displayed in reports."), 'date_start': fields.date('Start Date', required=True), 'date_stop': fields.date('End Date', required=True), - 'period':fields.selection([('month','Month'), ('3months','3 Months')], + 'period':fields.selection([('month','Monthly'), ('3months','3 Monthly')], 'Periods', required=True), 'account_name':fields.char('Name', size=128), 'account_type':fields.selection([('cash','Cash'),('check','Check'),('bank','Bank')], 'Type', size=32), 'account_currency':fields.many2one('res.currency', 'Currency') } _defaults = { - 'code': lambda *a: time.strftime('%Y'), - 'name': lambda *a: time.strftime('%Y'), 'date_start': lambda *a: time.strftime('%Y-01-01'), 'date_stop': lambda *a: time.strftime('%Y-12-31'), 'period':lambda *a:'month', @@ -91,11 +85,14 @@ class account_installer(osv.osv_memory): def execute(self, cr, uid, ids, context=None): super(account_installer, self).execute(cr, uid, ids, context=context) for res in self.read(cr,uid,ids): - if 'date1' in res and 'date2' in res: + if 'date_start' in res and 'date_stop' in res: + name = res['date_start'][:4] + if int(name) != int(res['date_stop'][:4]): + name = res['date_start'][:4] +'-'+ res['date_stop'][:4] + code = res['date_start'][2:4] +'-'+ res['date_stop'][2:4] res_obj = self.pool.get('account.fiscalyear') - name = res['name'] - vals = {'name':res['name'], - 'code':res['code'], + vals = {'name':name, + 'code':code, 'date_start':res['date_start'], 'date_stop':res['date_stop'], } From e2f40f8300033045ec915030b08da086a626e18d Mon Sep 17 00:00:00 2001 From: "Rvo (Open ERP)" Date: Mon, 3 May 2010 19:14:14 +0530 Subject: [PATCH 38/42] [Add]: warning starting server with '-u XXX' or '-i XXX' where XXX is not a valid module name or 'all' bzr revid: rvo@tinyerp.co.in-20100503134414-ma87k4htpifi00tz --- bin/addons/__init__.py | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/bin/addons/__init__.py b/bin/addons/__init__.py index 02803de0d75..53fe7068aa5 100644 --- a/bin/addons/__init__.py +++ b/bin/addons/__init__.py @@ -767,6 +767,15 @@ def load_module_graph(cr, graph, status=None, perform_checks=True, **kwargs): return has_updates def load_modules(db, force_demo=False, status=None, update_module=False): + + def check_module_name(cr, mods, state): + for mod in mods: + id = modobj.search(cr, 1, ['&', ('state', '=', state), ('name', '=', mod)]) + if id: + getattr(modobj, states[state])(cr, 1, id) + elif mod != 'all': + logger.notifyChannel('init', netsvc.LOG_WARNING, 'module %s: invalid module name!' % (mod)) + if not status: status = {} cr = db.cursor() @@ -797,21 +806,16 @@ def load_modules(db, force_demo=False, status=None, update_module=False): return if update_module: modobj = pool.get('ir.module.module') + states = {'installed': 'button_upgrade', 'uninstalled': 'button_install'} logger.notifyChannel('init', netsvc.LOG_INFO, 'updating modules list') if ('base' in tools.config['init']) or ('base' in tools.config['update']): modobj.update_list(cr, 1) mods = [k for k in tools.config['init'] if tools.config['init'][k]] - if mods: - ids = modobj.search(cr, 1, ['&', ('state', '=', 'uninstalled'), ('name', 'in', mods)]) - if ids: - modobj.button_install(cr, 1, ids) + check_module_name(cr, mods, 'uninstalled') mods = [k for k in tools.config['update'] if tools.config['update'][k]] - if mods: - ids = modobj.search(cr, 1, ['&', ('state', '=', 'installed'), ('name', 'in', mods)]) - if ids: - modobj.button_upgrade(cr, 1, ids) + check_module_name(cr, mods, 'installed') cr.execute("update ir_module_module set state=%s where name=%s", ('installed', 'base')) From 0fb50cd625e30eee277d16b4c4a4413c7a79049a Mon Sep 17 00:00:00 2001 From: Olivier Dony Date: Tue, 4 May 2010 00:05:19 +0100 Subject: [PATCH 39/42] [FIX] restore proper exception context and logging for test-continue bzr revid: odo@openerp.com-20100503230519-vc4bxt8y2j87p5qf --- bin/addons/__init__.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/bin/addons/__init__.py b/bin/addons/__init__.py index 53fe7068aa5..82761d647bd 100644 --- a/bin/addons/__init__.py +++ b/bin/addons/__init__.py @@ -645,10 +645,10 @@ def load_module_graph(cr, graph, status=None, perform_checks=True, **kwargs): _load_data(cr, module_name, id_map, mode, 'test') except Exception, e: if tools.config.options['test-continue']: - logger.notifyChannel('ERROR', netsvc.LOG_TEST, str(e)) + logger.notifyChannel('ERROR', netsvc.LOG_TEST, e) pass else: - raise Exception + raise finally: if tools.config.options['test-rollback']: cr.rollback() From e05850f9e1a2a186155d8016b54b4394e5897dad Mon Sep 17 00:00:00 2001 From: Olivier Dony Date: Tue, 4 May 2010 00:35:16 +0100 Subject: [PATCH 40/42] [FIX] removed use of magic methods/attributes, plus some useless code duplication bzr revid: odo@openerp.com-20100503233516-85tk5wr61ip2agw5 --- bin/tools/yaml_import.py | 33 +++++++++++++++------------------ 1 file changed, 15 insertions(+), 18 deletions(-) diff --git a/bin/tools/yaml_import.py b/bin/tools/yaml_import.py index ed481b2d0b3..108a5ff0d32 100644 --- a/bin/tools/yaml_import.py +++ b/bin/tools/yaml_import.py @@ -254,21 +254,20 @@ class YamlInterpreter(object): b = bool(value) else: b = default - return b - + return b + def create_osv_memory_record(self, record, fields): model = self.get_model(record.model) record_dict = self._create_record(model, fields) id_new=model.create(self.cr, self.uid, record_dict, context=self.context) self.id_map[record.id] = int(id_new) return record_dict - + def process_record(self, node): import osv record, fields = node.items()[0] model = self.get_model(record.model) - model_bases = model.__class__.__bases__ - if osv.osv.osv_memory in model_bases: + if isinstance(model, osv.osv.osv_memory): record_dict=self.create_osv_memory_record(record, fields) else: self.validate_xml_id(record.id) @@ -281,24 +280,22 @@ class YamlInterpreter(object): else: if not self._coerce_bool(record.forcecreate): return None - - model = self.get_model(record.model) + record_dict = self._create_record(model, fields) self.logger.debug("RECORD_DICT %s" % record_dict) - if not osv.osv.osv_memory in model_bases: - id = self.pool.get('ir.model.data')._update(self.cr, self.uid, record.model, \ - self.module, record_dict, record.id, noupdate=self.isnoupdate(record), mode=self.mode) - self.id_map[record.id] = int(id) - if config.get('import_partial', False): - self.cr.commit() - + id = self.pool.get('ir.model.data')._update(self.cr, self.uid, record.model, \ + self.module, record_dict, record.id, noupdate=self.isnoupdate(record), mode=self.mode) + self.id_map[record.id] = int(id) + if config.get('import_partial'): + self.cr.commit() + def _create_record(self, model, fields): record_dict = {} for field_name, expression in fields.items(): field_value = self._eval_field(model, field_name, expression) record_dict[field_name] = field_value - return record_dict - + return record_dict + def process_ref(self, node, column=None): if node.search: if node.model: @@ -320,10 +317,10 @@ class YamlInterpreter(object): else: value = None return value - + def process_eval(self, node): return eval(node.expression, self.eval_context) - + def _eval_field(self, model, field_name, expression): # TODO this should be refactored as something like model.get_field() in bin/osv if field_name in model._columns: From 900c2ef4409df0f739e0dc610e49c746ed508e86 Mon Sep 17 00:00:00 2001 From: Olivier Dony Date: Tue, 4 May 2010 00:42:46 +0100 Subject: [PATCH 41/42] [FIX] orm/selection widget: fixed leftover typos bzr revid: odo@openerp.com-20100503234246-9otvvfnedcfqp453 --- bin/osv/orm.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/bin/osv/orm.py b/bin/osv/orm.py index 4afd731dd4e..c5019c729ed 100644 --- a/bin/osv/orm.py +++ b/bin/osv/orm.py @@ -1153,8 +1153,10 @@ class orm_template(object): node.set('invisible', '1') if 'attrs' in node.attrib: del(node.attrib['attrs']) #avoid making field visible later - del(node.attrib['groups']) - return can_see + del(node.attrib['groups']) + return can_see + else: + return True if node.tag in ('field', 'node', 'arrow'): if node.get('object'): @@ -1202,7 +1204,7 @@ class orm_template(object): } attrs = {'views': views} if node.get('widget') and node.get('widget') == 'selection': - if not check_group(node) + if not check_group(node): attrs['selection'] = [] # We can not use the 'string' domain has it is defined according to the record ! else: From af7a13580592d77d636868833b31ccbf6764da39 Mon Sep 17 00:00:00 2001 From: Launchpad Code Hosting Date: Wed, 5 May 2010 04:47:40 +0100 Subject: [PATCH 42/42] Launchpad automatic translations update. bzr revid: codehost@crowberry-20100505034740-gryudstp2nvot7d2 --- bin/addons/base/i18n/hr.po | 4 ++-- bin/addons/base/i18n/ja.po | 4 ++-- bin/addons/base/i18n/sv.po | 4 ++-- bin/addons/base/i18n/uk.po | 4 ++-- bin/addons/base/i18n/zh_CN.po | 4 ++-- 5 files changed, 10 insertions(+), 10 deletions(-) diff --git a/bin/addons/base/i18n/hr.po b/bin/addons/base/i18n/hr.po index 4fb8e0f8249..5d0cf33b263 100644 --- a/bin/addons/base/i18n/hr.po +++ b/bin/addons/base/i18n/hr.po @@ -7,13 +7,13 @@ msgstr "" "Project-Id-Version: OpenERP Server 5.0.4\n" "Report-Msgid-Bugs-To: support@openerp.com\n" "POT-Creation-Date: 2009-12-18 08:39+0000\n" -"PO-Revision-Date: 2010-05-02 05:19+0000\n" +"PO-Revision-Date: 2010-05-03 14:18+0000\n" "Last-Translator: goranc \n" "Language-Team: openerp-translators\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"X-Launchpad-Export-Date: 2010-05-03 04:03+0000\n" +"X-Launchpad-Export-Date: 2010-05-05 03:47+0000\n" "X-Generator: Launchpad (build Unknown)\n" "Language: hr\n" diff --git a/bin/addons/base/i18n/ja.po b/bin/addons/base/i18n/ja.po index be4a2828ed8..915a0dbb692 100644 --- a/bin/addons/base/i18n/ja.po +++ b/bin/addons/base/i18n/ja.po @@ -8,13 +8,13 @@ msgstr "" "Project-Id-Version: openobject-server\n" "Report-Msgid-Bugs-To: FULL NAME \n" "POT-Creation-Date: 2009-12-18 08:39+0000\n" -"PO-Revision-Date: 2010-05-02 05:13+0000\n" +"PO-Revision-Date: 2010-05-03 14:46+0000\n" "Last-Translator: Harry (Open ERP) \n" "Language-Team: Japanese \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"X-Launchpad-Export-Date: 2010-05-03 04:02+0000\n" +"X-Launchpad-Export-Date: 2010-05-05 03:47+0000\n" "X-Generator: Launchpad (build Unknown)\n" #. module: base diff --git a/bin/addons/base/i18n/sv.po b/bin/addons/base/i18n/sv.po index 0e2ae3adae0..471b33dab46 100644 --- a/bin/addons/base/i18n/sv.po +++ b/bin/addons/base/i18n/sv.po @@ -7,13 +7,13 @@ msgstr "" "Project-Id-Version: OpenERP Server 5.0.0\n" "Report-Msgid-Bugs-To: support@openerp.com\n" "POT-Creation-Date: 2009-12-18 08:39+0000\n" -"PO-Revision-Date: 2010-05-02 05:47+0000\n" +"PO-Revision-Date: 2010-05-03 14:48+0000\n" "Last-Translator: Anders Wallenquist \n" "Language-Team: <>\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"X-Launchpad-Export-Date: 2010-05-03 04:03+0000\n" +"X-Launchpad-Export-Date: 2010-05-05 03:47+0000\n" "X-Generator: Launchpad (build Unknown)\n" #. module: base diff --git a/bin/addons/base/i18n/uk.po b/bin/addons/base/i18n/uk.po index d6d7e110aff..6badbbdeaac 100644 --- a/bin/addons/base/i18n/uk.po +++ b/bin/addons/base/i18n/uk.po @@ -7,13 +7,13 @@ msgstr "" "Project-Id-Version: OpenERP Server 5.0.0\n" "Report-Msgid-Bugs-To: support@openerp.com\n" "POT-Creation-Date: 2009-12-18 08:39+0000\n" -"PO-Revision-Date: 2010-05-02 05:32+0000\n" +"PO-Revision-Date: 2010-05-03 14:29+0000\n" "Last-Translator: Fabien (Open ERP) \n" "Language-Team: \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"X-Launchpad-Export-Date: 2010-05-03 04:03+0000\n" +"X-Launchpad-Export-Date: 2010-05-05 03:47+0000\n" "X-Generator: Launchpad (build Unknown)\n" #. module: base diff --git a/bin/addons/base/i18n/zh_CN.po b/bin/addons/base/i18n/zh_CN.po index a6f9bd69315..106f1cfe8d3 100644 --- a/bin/addons/base/i18n/zh_CN.po +++ b/bin/addons/base/i18n/zh_CN.po @@ -7,13 +7,13 @@ msgstr "" "Project-Id-Version: OpenERP Server 5.0.4\n" "Report-Msgid-Bugs-To: support@openerp.com\n" "POT-Creation-Date: 2009-12-18 08:39+0000\n" -"PO-Revision-Date: 2010-05-02 05:37+0000\n" +"PO-Revision-Date: 2010-05-03 14:47+0000\n" "Last-Translator: OpenERP Administrators \n" "Language-Team: \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"X-Launchpad-Export-Date: 2010-05-03 04:03+0000\n" +"X-Launchpad-Export-Date: 2010-05-05 03:47+0000\n" "X-Generator: Launchpad (build Unknown)\n" #. module: base