Skip to content
Snippets Groups Projects
Commit 07763068 authored by Nicolas Martinelli's avatar Nicolas Martinelli Committed by Nicolas Martinelli
Browse files

[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
parent 988cadaf
Branches
Tags
No related merge requests found
......@@ -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):
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment