Only use the date if there is no invoice/order for a membership line.
authorSébastien Grignard <seb@amakaze.org>
Fri, 10 Jan 2014 22:13:04 +0000 (23:13 +0100)
committerSébastien Grignard <seb@amakaze.org>
Fri, 10 Jan 2014 22:13:04 +0000 (23:13 +0100)
pos_membership.py

index b53eac3..e61b697 100644 (file)
@@ -456,6 +456,10 @@ class Partner(osv.osv):
                                 s = 2
                             elif ostate == 'draft' and s != 0 and s != 1:
                                 s = 3
+                       else:
+                           # when we don't have an invoice line only use the date to get the state.
+                           s = 0
+                           break
                 if s == 4:
                     for mline in partner_data.member_lines:
                         if mline.date_from < today and \