Update dev_membership.py
This commit is contained in:
parent
e5b6921405
commit
3b0aff466a
|
|
@ -359,13 +359,9 @@ class DevMembership(models.Model):
|
|||
for record in self:
|
||||
total_fees = record.membership_fees
|
||||
total_duration = record.duration
|
||||
# Skip the calculation if the record is not saved in the database yet
|
||||
if not record.id:
|
||||
continue
|
||||
|
||||
|
||||
# Search for memberships to sum fees and duration
|
||||
memberships = self.env['dev.membership'].search([
|
||||
('id', '!=', record.id),
|
||||
('partner_id', '=', record.partner_id.id),
|
||||
('to_date', '<', record.from_date),
|
||||
('state', 'in', ['expire', 'active', 'cancel'])
|
||||
|
|
|
|||
Loading…
Reference in New Issue