[REVIEW]: review point of sale, clean cash-book
bzr revid: mga@tinyerp.com-20100628180149-m7yemtxfbfo1471x
This commit is contained in:
parent
5e17f915dd
commit
88af110a66
|
@ -22,7 +22,6 @@
|
|||
|
||||
import pos
|
||||
import account_bank_statement
|
||||
#import pos_account_bank_statement
|
||||
import wizard
|
||||
import report
|
||||
|
||||
|
|
|
@ -68,3 +68,31 @@ class account_cash_statement(osv.osv):
|
|||
return res
|
||||
|
||||
account_cash_statement()
|
||||
|
||||
class account_bank_statement_line(osv.osv):
|
||||
|
||||
def _default_company(self, cr, uid, context={}):
|
||||
""" To get default company for the object"
|
||||
@param self: The object pointer
|
||||
@param cr: the current row, from the database cursor,
|
||||
@param uid: the current user’s ID for security checks,
|
||||
@param ids: List of bank statement ids
|
||||
@param context: A standard dictionary for contextual values
|
||||
@return: company
|
||||
"""
|
||||
|
||||
user = self.pool.get('res.users').browse(cr, uid, uid, context=context)
|
||||
if user.company_id:
|
||||
return user.company_id.id
|
||||
return self.pool.get('res.company').search(cr, uid, [('parent_id', '=', False)])[0]
|
||||
|
||||
_inherit = 'account.bank.statement.line'
|
||||
_columns = {
|
||||
'company_id':fields.many2one('res.company', 'Company', required=True),
|
||||
}
|
||||
_defaults = {
|
||||
'company_id': lambda self,cr,uid,c: self.pool.get('res.users').browse(cr, uid, uid, c).company_id.id,
|
||||
}
|
||||
account_bank_statement_line()
|
||||
|
||||
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
|
||||
|
|
|
@ -1,56 +0,0 @@
|
|||
# -*- encoding: utf-8 -*-
|
||||
##############################################################################
|
||||
#
|
||||
# OpenERP, Open Source Management Solution
|
||||
# Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>). All Rights Reserved
|
||||
# $Id$
|
||||
#
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation, either version 3 of the License, or
|
||||
# (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
#
|
||||
##############################################################################
|
||||
|
||||
import time
|
||||
import netsvc
|
||||
from osv import osv
|
||||
from osv import fields
|
||||
|
||||
class account_bank_statement_line(osv.osv):
|
||||
|
||||
def _default_company(self, cr, uid, context={}):
|
||||
|
||||
""" To get default company for the object"
|
||||
|
||||
@param self: The object pointer
|
||||
@param cr: the current row, from the database cursor,
|
||||
@param uid: the current user’s ID for security checks,
|
||||
@param ids: List of bank statement ids
|
||||
@param context: A standard dictionary for contextual values
|
||||
@return: company
|
||||
"""
|
||||
|
||||
user = self.pool.get('res.users').browse(cr, uid, uid, context=context)
|
||||
if user.company_id:
|
||||
return user.company_id.id
|
||||
return self.pool.get('res.company').search(cr, uid, [('parent_id', '=', False)])[0]
|
||||
|
||||
_inherit = 'account.bank.statement.line'
|
||||
_columns = {
|
||||
'company_id':fields.many2one('res.company', 'Company', required=True),
|
||||
}
|
||||
_defaults = {
|
||||
'company_id': lambda self,cr,uid,c: self.pool.get('res.users').browse(cr, uid, uid, c).company_id.id,
|
||||
}
|
||||
account_bank_statement_line()
|
||||
|
||||
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
|
Loading…
Reference in New Issue