Update dunning patch

This commit is contained in:
Bernat Brunet Torruella 2018-03-10 16:05:11 +01:00
parent 69794b5b97
commit 9fd76288ba
1 changed files with 11 additions and 2 deletions

View File

@ -1,7 +1,16 @@
diff -r cc0a18b95c7c dunning.py
--- a/trytond/trytond/modules/account_dunning/dunning.py Wed Nov 08 23:52:14 2017 +0100
+++ b/trytond/trytond/modules/account_dunning/dunning.py Sat Mar 10 15:08:02 2018 +0100
@@ -181,7 +181,10 @@
@@ -49,6 +49,8 @@
def test(self, line, date):
if self.days is not None:
+ if not line.maturity_date:
+ return True
return (date - line.maturity_date).days >= self.days
_STATES = {
@@ -181,7 +183,10 @@
return [
('account.kind', '=', 'receivable'),
('dunnings', '=', None),
@ -9,7 +18,7 @@ diff -r cc0a18b95c7c dunning.py
+ ['OR',
+ ('maturity_date', '<=', date),
+ ('maturity_date', '=', None),
+ ]
+ ],
['OR',
('debit', '>', 0),
('credit', '<', 0),