1
# -*- encoding: utf-8 -*-
2
##############################################################################
4
# Account Journal Always Check Date module for OpenERP
5
# Copyright (C) 2013 Akretion (http://www.akretion.com)
6
# @author Alexis de Lattre <alexis.delattre@akretion.com>
8
# This program is free software: you can redistribute it and/or modify
9
# it under the terms of the GNU Affero General Public License as
10
# published by the Free Software Foundation, either version 3 of the
11
# License, or (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 Affero General Public License for more details.
18
# You should have received a copy of the GNU Affero General Public License
19
# along with this program. If not, see <http://www.gnu.org/licenses/>.
21
##############################################################################
23
from openerp.osv import orm
24
from openerp.tools.translate import _
27
class account_journal(orm.Model):
28
_inherit = 'account.journal'
31
'''Activate 'Check Date in Period' on all existing journals'''
33
"UPDATE account_journal SET allow_date=true "
34
"WHERE allow_date <> true")
41
def _allow_date_always_active(self, cr, uid, ids):
42
for journal in self.browse(cr, uid, ids):
43
if not journal.allow_date:
46
_("The option 'Check Date in Period' must be active "
52
(_allow_date_always_active, "Error msg in raise", ['allow_date']),