Manuel Claeys Bouuaert
3 years ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with
4 additions and
3 deletions
-
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 |
|
|
|
|
|
|
|