1
# -*- encoding: utf-8 -*-
2
###########################################################################
3
# Module Writen to OpenERP, Open Source Management Solution
5
# Copyright (c) 2010 Vauxoo - http://www.vauxoo.com/
7
# info Vauxoo (info@vauxoo.com)
8
############################################################################
9
# Coded by: Luis Torres (luis_t@vauxoo.com)
10
############################################################################
12
# This program is free software: you can redistribute it and/or modify
13
# it under the terms of the GNU Affero General Public License as
14
# published by the Free Software Foundation, either version 3 of the
15
# License, or (at your option) any later version.
17
# This program is distributed in the hope that it will be useful,
18
# but WITHOUT ANY WARRANTY; without even the implied warranty of
19
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20
# GNU Affero General Public License for more details.
22
# You should have received a copy of the GNU Affero General Public License
23
# along with this program. If not, see <http://www.gnu.org/licenses/>.
25
##############################################################################
27
from osv import fields
29
class cif_config(osv.osv_memory):
31
_inherit = 'res.config'
33
def _write_company(self, cr, uid, cif_file,company_id,context=None):
34
self.pool.get('res.company').write(cr, uid, company_id,{
38
def execute(self, cr, uid, ids, context=None):
39
company_id=self.pool.get('res.users').browse(cr,uid,[uid],context)[0].company_id.partner_id.id
40
wiz_data = self.read(cr, uid, ids[0])
41
if wiz_data['cif_file']:
42
self._write_company(cr, uid, wiz_data["cif_file"],company_id,context)
45
'cif_file': fields.binary('CIF',help="Fiscal Identification Card"),