Add issue7897.diff - [analytic_account] Remove positive constraint on debit/credit

This commit is contained in:
Raimon Esteve 2019-02-20 23:36:23 +01:00
parent e4e1f6d16e
commit 61fabb459c
2 changed files with 25 additions and 0 deletions

24
issue7897.diff Normal file
View File

@ -0,0 +1,24 @@
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')

1
series
View File

@ -131,6 +131,7 @@ stock_lot_check_moves_without_lot_before_lot_required.diff
issue3228.diff # [trytond] Fix result order of search_read
issue7856.diff # [stock] Can't move qty from a parent location to child location
issue8058.diff # [stock_supply_production] Can't create productions from request because exceeds digits limit
issue7897.diff # [analytic_account] Remove positive constraint on debit/credit
# electr
# issue6626_improve_performance_of_average_cost_price.diff