Browse Source

Merge b7279658bb into 4951a4ce8f

pull/127/merge
Manuel Claeys Bouuaert 3 years ago
committed by GitHub
parent
commit
427e73e0f7
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 7
      easy_my_coop_taxshelter_report/models/tax_shelter_declaration.py

7
easy_my_coop_taxshelter_report/models/tax_shelter_declaration.py

@ -61,12 +61,13 @@ class TaxShelterDeclaration(models.Model):
"as non eligible")
def _excluded_from_declaration(self, entry):
# entry is a subscription.register object
if entry.date >= self.date_from and entry.date <= self.date_to:
declaration = self
declarations = self
else:
declaration = self.search([('date_from', '<=', entry.date),
declarations = self.search([('date_from', '<=', entry.date),
('date_to', '>=', entry.date)])
if entry.partner_id.id in declaration.excluded_cooperator.ids:
if entry.partner_id.id in declarations.mapped('excluded_cooperator').ids:
return True
return False

Loading…
Cancel
Save