Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 10 additions & 10 deletions addons/account/account.py
Original file line number Diff line number Diff line change
Expand Up @@ -1181,16 +1181,16 @@ class account_move(osv.osv):
_order = 'id desc'

def account_assert_balanced(self, cr, uid, context=None):
cr.execute("""\
SELECT move_id
FROM account_move_line
WHERE state = 'valid'
GROUP BY move_id
HAVING abs(sum(debit) - sum(credit)) > 0.00001
""")
assert len(cr.fetchall()) == 0, \
"For all Journal Items, the state is valid implies that the sum " \
"of credits equals the sum of debits"
#cr.execute("""\
# SELECT move_id
# FROM account_move_line
# WHERE state = 'valid'
# GROUP BY move_id
# HAVING abs(sum(debit) - sum(credit)) > 0.00001
# """)
#assert len(cr.fetchall()) == 0, \
# "For all Journal Items, the state is valid implies that the sum " \
# "of credits equals the sum of debits"
return True

def account_move_prepare(self, cr, uid, journal_id, date=False, ref='', company_id=False, context=None):
Expand Down
6 changes: 3 additions & 3 deletions addons/account/account_invoice.py
Original file line number Diff line number Diff line change
Expand Up @@ -354,9 +354,9 @@ def _get_invoice_from_reconcile(self, cr, uid, ids, context=None):
'user_id': lambda s, cr, u, c: u,
'sent': False,
}
_sql_constraints = [
('number_uniq', 'unique(number, company_id, journal_id, type)', 'Invoice Number must be unique per Company!'),
]
#_sql_constraints = [
# ('number_uniq', 'unique(number, company_id, journal_id, type)', 'Invoice Number must be unique per Company!'),
#]



Expand Down