[FIX] Rename the oc_OC translation files to oc_FR
[odoo/odoo.git] / addons / crm_vertical / crm_vertical.py
1 # -*- encoding: utf-8 -*-
2 ##############################################################################
3 #
4 #    OpenERP, Open Source Management Solution   
5 #    Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>). All Rights Reserved
6 #    $Id$
7 #
8 #    This program is free software: you can redistribute it and/or modify
9 #    it under the terms of the GNU General Public License as published by
10 #    the Free Software Foundation, either version 3 of the License, or
11 #    (at your option) any later version.
12 #
13 #    This program is distributed in the hope that it will be useful,
14 #    but WITHOUT ANY WARRANTY; without even the implied warranty of
15 #    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
16 #    GNU General Public License for more details.
17 #
18 #    You should have received a copy of the GNU General Public License
19 #    along with this program.  If not, see <http://www.gnu.org/licenses/>.
20 #
21 ##############################################################################
22
23 import time
24 import tools
25 from osv import fields,osv,orm
26 import os
27 import mx.DateTime
28 import base64
29 from tools.translate import _
30
31 # here need to implement inheritance on osv_memory object. after that, it will work well.
32 class crm_menu_config_wizard(osv.osv_memory):
33     _inherit='crm.menu.config_wizard'
34     def action_create(self, cr, uid, ids, *args):
35         res=super(crm_menu_config_wizard, self).action_create(cr, uid, ids, *args)
36         for res in self.read(cr,uid,ids):
37             res.__delitem__('id')
38             for section in res :
39                 if res[section]:
40                     file_name = 'crm_'+section+'_vertical_view.xml'
41                     try:
42                         tools.convert_xml_import(cr, 'crm_configuration', tools.file_open(os.path.join('crm_vertical',file_name )),  {}, 'init', *args)
43                     except Exception, e:
44                         raise osv.except_osv(_('Error !'), str(e))
45         return res
46
47 crm_menu_config_wizard()
48 # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: