1
# -*- encoding: utf-8 -*-
2
##############################################################################
4
# OpenERP, Open Source Management Solution
5
# Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>). All Rights Reserved
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.
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.
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/>.
21
##############################################################################
23
from osv import osv, fields
28
class account_bank_statement(osv.osv):
29
_inherit = 'account.bank.statement'
31
'company_id':fields.many2one('res.company', 'Company', required=True),
34
'company_id': lambda self,cr,uid,c: self.pool.get('res.users').browse(cr, uid, uid, c).company_id.id,
36
account_bank_statement()
38
class account_bank_statement_line(osv.osv):
39
def _default_company(self, cr, uid, context={}):
40
user = self.pool.get('res.users').browse(cr, uid, uid, context=context)
42
return user.company_id.id
43
return self.pool.get('res.company').search(cr, uid, [('parent_id', '=', False)])[0]
44
_inherit = 'account.bank.statement.line'
46
'company_id':fields.many2one('res.company', 'Company', required=True),
49
'company_id': lambda self,cr,uid,c: self.pool.get('res.users').browse(cr, uid, uid, c).company_id.id,
51
account_bank_statement_line()
53
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: