[FIX] membership: recompute state
Commit https://github.com/odoo/odoo/commit/2b587d34ff30147c03baf16e998effe46ce5d9cf#diff-2d656902930900b836412f086c924643R164 incorrectly removed the content of the cron. Indeed, `membership_state` is a computed field which depends on time (which is usually a bad idea). Therefore, we must force its recomputation. opw-1878878
This commit is contained in:
committed by
Nicolas Martinelli
parent
988cadaf5d
commit
0776306813
@@ -161,8 +161,10 @@ class Partner(models.Model):
|
||||
|
||||
@api.model
|
||||
def _cron_update_membership(self):
|
||||
# used to recompute 'membership_state'; should no longer be necessary
|
||||
pass
|
||||
partners = self.search([('membership_state', 'in', ['invoiced', 'paid'])])
|
||||
# mark the field to be recomputed, and recompute it
|
||||
partners._recompute_todo(self._fields['membership_state'])
|
||||
self.recompute()
|
||||
|
||||
@api.multi
|
||||
def create_membership_invoice(self, product_id=None, datas=None):
|
||||
|
||||
Reference in New Issue
Block a user