FIX issue7897.diff

From changeset-dd58e73ff208
This commit is contained in:
Raimon Esteve 2019-02-21 08:35:52 +01:00
parent 373560b5d1
commit 6cbab03fad
1 changed files with 3 additions and 4 deletions

View File

@ -1,20 +1,19 @@
diff -r b66fe349cd2a trytond/trytond/modules/analytic_account/line.py
--- a/trytond/trytond/modules/analytic_account/line.py Thu Feb 21 00:13:13 2019 +0100
+++ b/trytond/trytond/modules/analytic_account/line.py Thu Feb 21 00:14:32 2019 +0100
@@ -44,10 +44,8 @@
@@ -44,9 +44,8 @@
super(Line, cls).__setup__()
t = cls.__table__()
cls._sql_constraints += [
- ('credit_debit',
- Check(t,
- (t.credit * t.debit == 0) & (t.credit + t.debit >= 0)),
- 'Wrong credit/debit values.'),
+ ('credit_debit_',
+ Check(t, t.credit * t.debit == 0),
'Wrong credit/debit values.'),
]
cls._error_messages.update({
'line_on_view_account': (
@@ -71,6 +69,9 @@
@@ -71,6 +70,9 @@
for field_name in ['name', 'journal']:
table.not_null_action(field_name, action='remove')