dépôts
/
burette
/
pos_membership.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
635bff1
)
[PYTHON]fix allowing for partners without invoice to be considered as valid, eg impor...
author
Antoine Gonzalez
<antoine.gonzalez@gmail.com>
Thu, 14 Jan 2016 13:26:33 +0000
(14:26 +0100)
committer
Antoine Gonzalez
<antoine.gonzalez@gmail.com>
Thu, 14 Jan 2016 13:26:33 +0000
(14:26 +0100)
pos_membership.py
patch
|
blob
|
history
diff --git
a/pos_membership.py
b/pos_membership.py
index
3513176
..
cce51b5
100644
(file)
--- a/
pos_membership.py
+++ b/
pos_membership.py
@@
-444,6
+444,25
@@
class Partner(osv.osv):
s = 5
else:
s = 6
s = 5
else:
s = 6
+
+ if s == 6:
+ # special case when the partner is imported from a file,
+ # in this case is has a valid membership lines but
+ # no payment information associated, consider it valid
+
+ no_payment_info_at_all = True
+ valid_line = False
+
+ for mline in partner_data.member_lines:
+ if mline.date_to >= today:
+ valid_line = True
+
+ if mline.account_invoice_line or mline.pos_order_line:
+ no_payment_info_at_all = False
+
+ if no_payment_info_at_all and valid_line:
+ s = 0
+
if s == 0:
res[id] = 'paid'
elif s == 1:
if s == 0:
res[id] = 'paid'
elif s == 1: