Skip to content

Commit

Permalink
[IMP] capital limit based on tax shelter type
Browse files Browse the repository at this point in the history
  • Loading branch information
victor-champonnois committed Feb 23, 2024
1 parent 23566ae commit 4a3097d
Showing 1 changed file with 17 additions and 1 deletion.
18 changes: 17 additions & 1 deletion l10n_be_cooperator/models/tax_shelter_declaration.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,13 @@ class TaxShelterDeclaration(models.Model):
readonly=True,
default=lambda self: self.env.company,
)
tax_shelter_capital_limit = fields.Float(required=True)
tax_shelter_capital_limit = fields.Float(
string="Tax shelter capital limit",
required=True,
compute="_compute_tax_shelter_capital_limit",
default=500000,
readonly=False,
)
previously_subscribed_capital = fields.Float(
string="Capital previously subscribed", readonly=True
)
Expand Down Expand Up @@ -140,6 +146,16 @@ def _compute_certificates(self, entries, partner_certificate):

return partner_certificate

@api.depends("tax_shelter_type")
def _compute_tax_shelter_capital_limit(self):
if (
self.tax_shelter_type == "start_up_small"
or self.tax_shelter_type == "start_up_micro"
):
self.tax_shelter_capital_limit = 500000
elif self.tax_shelter_type == "scale_up":
self.tax_shelter_capital_limit = 1000000

Check warning on line 157 in l10n_be_cooperator/models/tax_shelter_declaration.py

View check run for this annotation

Codecov / codecov/patch

l10n_be_cooperator/models/tax_shelter_declaration.py#L157

Added line #L157 was not covered by tests

def compute_declaration(self):
self.ensure_one()
entries = self.env["subscription.register"].search(
Expand Down

0 comments on commit 4a3097d

Please sign in to comment.