Browse Source

[FIX] tax_shelter_declaration: enable exclusion to deal with overlapping declarations

pull/127/head
Manuel Claeys Bouuaert 4 years ago
parent
commit
08b74ed41b
  1. 6
      easy_my_coop_taxshelter_report/models/tax_shelter_declaration.py

6
easy_my_coop_taxshelter_report/models/tax_shelter_declaration.py

@ -62,11 +62,11 @@ class TaxShelterDeclaration(models.Model):
def _excluded_from_declaration(self, entry):
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