~openerp-commiter/openobject-addons/trunk-extra-addons

« back to all changes in this revision

Viewing changes to point_of_sale/pos_account_bank_statement.py

  • Committer: nel at tinyerp
  • Date: 2009-11-30 08:28:49 UTC
  • mto: This revision was merged to the branch mainline in revision 4062.
  • Revision ID: nel@tinyerp.com-20091130082849-a7v30pjka68kf0oi
Add point of sale and pos_tax_include

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
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
from osv import osv, fields
 
24
import time
 
25
import netsvc
 
26
 
 
27
 
 
28
class account_bank_statement(osv.osv):
 
29
    _inherit = 'account.bank.statement'
 
30
    _columns = {
 
31
        'company_id':fields.many2one('res.company', 'Company', required=True),
 
32
    }
 
33
    _defaults = {
 
34
        'company_id': lambda self,cr,uid,c: self.pool.get('res.users').browse(cr, uid, uid, c).company_id.id,
 
35
    }
 
36
account_bank_statement()
 
37
 
 
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)
 
41
        if user.company_id:
 
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'
 
45
    _columns = {
 
46
        'company_id':fields.many2one('res.company', 'Company', required=True),
 
47
    }
 
48
    _defaults = {
 
49
        'company_id': lambda self,cr,uid,c: self.pool.get('res.users').browse(cr, uid, uid, c).company_id.id,
 
50
    }
 
51
account_bank_statement_line()
 
52
 
 
53
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
 
54