trytond-patches/issue7897.diff

25 lines
1010 B
Diff

diff -r 15ac73b893d2 trytond/trytond/modules/analytic_account/line.py
--- a/trytond/trytond/modules/analytic_account/line.py Wed Feb 20 23:32:36 2019 +0100
+++ b/trytond/trytond/modules/analytic_account/line.py Wed Feb 20 23:33:13 2019 +0100
@@ -48,8 +48,8 @@
def __setup__(cls):
super(Line, cls).__setup__()
cls._sql_constraints += [
- ('credit_debit',
- 'CHECK((credit * debit = 0.0) AND (credit + debit >= 0.0))',
+ ('credit_debit_',
+ 'CHECK(credit * debit = 0.0)',
'Wrong credit/debit values.'),
]
cls._error_messages.update({
@@ -71,6 +71,9 @@
# Migration from 1.2 currency has been changed in function field
table.not_null_action('currency', action='remove')
+ # Migration from 5.0: replace credit_debit constraint by credit_debit_
+ table.drop_constraint('credit_debit')
+
@staticmethod
def default_date():
Date = Pool().get('ir.date')