2
# -*- encoding: utf-8 -*-
3
###########################################################################
4
# Module Writen to OpenERP, Open Source Management Solution
5
# Copyright (C) OpenERP Venezuela (<http://openerp.com.ve>).
7
# Credits######################################################
8
# Coded by: javier@vauxoo.com
9
# Audited by: Vauxoo C.A.
10
#############################################################################
11
# This program is free software: you can redistribute it and/or modify
12
# it under the terms of the GNU Affero General Public License as published by
13
# the Free Software Foundation, either version 3 of the License, or
14
# (at your option) any later version.
16
# This program is distributed in the hope that it will be useful,
17
# but WITHOUT ANY WARRANTY; without even the implied warranty of
18
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19
# GNU Affero General Public License for more details.
21
# You should have received a copy of the GNU Affero General Public License
22
# along with this program. If not, see <http://www.gnu.org/licenses/>.
23
##########################################################################
25
from openerp.osv import osv, fields
28
class account_move_line(osv.Model):
29
_inherit = 'account.move.line'
32
Check that the entry balance is greater than zero
34
def _update_check_nonzero(self, cr, uid, ids, context=None):
36
for line in self.browse(cr, uid, ids, context=context):
37
writeoff = abs(line.debit - line.credit)
43
(_update_check_nonzero,
44
'You can not create an entry with zero balance !\
45
Please set amount !', []),