[PYTHON] ~fix duplicate member: no member_ident 7.0
authorLudovic CHEVALIER <ludovic@beurresarrasin.net>
Sat, 30 Nov 2019 14:06:47 +0000 (15:06 +0100)
committerLudovic CHEVALIER <ludovic@beurresarrasin.net>
Sat, 30 Nov 2019 14:06:47 +0000 (15:06 +0100)
remembership.py

index e424e03..14b7f4e 100644 (file)
@@ -215,6 +215,13 @@ class Partner(osv.osv):
         ids = partner_obj.search(cr, uid, [('membership_state', '=', 'paid'), ('membership_stop', '<', today)], context=None)
         self.write(cr, uid, ids, {'membership_state': 'old'}, context=None)
 
+    def copy(self, cr, uid, id, default=None, context=None):
+        if default is None:
+            default = {}
+        default['member_ident'] = None
+        return super(Partner, self).copy(cr, uid, id, default, context)
+
+
 Partner()