2009-10-13 05:58:37 +00:00
# -*- coding: utf-8 -*-
2006-12-07 13:41:40 +00:00
##############################################################################
2010-06-18 08:38:59 +00:00
#
2009-10-14 11:15:34 +00:00
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>).
2008-11-03 19:18:56 +00:00
#
# This program is free software: you can redistribute it and/or modify
2009-10-14 11:15:34 +00:00
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the
# License, or (at your option) any later version.
2008-11-03 19:18:56 +00:00
#
# 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
2009-10-14 11:15:34 +00:00
# GNU Affero General Public License for more details.
2008-11-03 19:18:56 +00:00
#
2009-10-14 11:15:34 +00:00
# You should have received a copy of the GNU Affero General Public License
2010-06-18 08:38:59 +00:00
# along with this program. If not, see <http://www.gnu.org/licenses/>.
2006-12-07 13:41:40 +00:00
#
##############################################################################
2012-12-06 14:56:32 +00:00
from openerp . osv import fields , osv
2006-12-07 13:41:40 +00:00
class account_analytic_journal ( osv . osv ) :
2008-07-22 15:11:28 +00:00
_name = ' account.analytic.journal '
2010-12-28 08:29:54 +00:00
_description = ' Analytic Journal '
2008-07-22 15:11:28 +00:00
_columns = {
2014-05-21 09:52:05 +00:00
' name ' : fields . char ( ' Journal Name ' , required = True ) ,
2010-10-13 09:45:27 +00:00
' code ' : fields . char ( ' Journal Code ' , size = 8 ) ,
2010-11-15 13:15:55 +00:00
' active ' : fields . boolean ( ' Active ' , help = " If the active field is set to False, it will allow you to hide the analytic journal without removing it. " ) ,
2014-05-21 09:52:05 +00:00
' type ' : fields . selection ( [ ( ' sale ' , ' Sale ' ) , ( ' purchase ' , ' Purchase ' ) , ( ' cash ' , ' Cash ' ) , ( ' general ' , ' General ' ) , ( ' situation ' , ' Situation ' ) ] , ' Type ' , required = True , help = " Gives the type of the analytic journal. When it needs for a document (eg: an invoice) to create analytic entries, OpenERP will look for a matching journal of the same type. " ) ,
2010-10-13 09:45:27 +00:00
' line_ids ' : fields . one2many ( ' account.analytic.line ' , ' journal_id ' , ' Lines ' ) ,
2009-11-10 12:49:20 +00:00
' company_id ' : fields . many2one ( ' res.company ' , ' Company ' , required = True ) ,
2008-07-22 15:11:28 +00:00
}
_defaults = {
2010-10-15 07:14:33 +00:00
' active ' : True ,
' type ' : ' general ' ,
2009-11-10 12:49:20 +00:00
' company_id ' : lambda self , cr , uid , c : self . pool . get ( ' res.users ' ) . browse ( cr , uid , uid , c ) . company_id . id ,
2008-07-22 15:11:28 +00:00
}
2010-10-15 07:14:33 +00:00
2006-12-07 13:41:40 +00:00
2008-08-19 13:31:12 +00:00
class account_journal ( osv . osv ) :
_inherit = " account.journal "
_columns = {
2010-10-20 04:44:12 +00:00
' analytic_journal_id ' : fields . many2one ( ' account.analytic.journal ' , ' Analytic Journal ' , help = " Journal for analytic entries " ) ,
2008-08-19 13:31:12 +00:00
}
2008-07-23 14:41:47 +00:00
2010-12-28 08:29:54 +00:00
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: