Skip to content

Commit

Permalink
Merge pull request #228 from davidwul/14-allow-activate-SWP
Browse files Browse the repository at this point in the history
allow to validate/force active a Write&Pray and correspondance sponso…
  • Loading branch information
NoeBerdoz authored Jun 21, 2024
2 parents a23a99a + e809d98 commit 8d17c4c
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion recurring_contract/models/recurring_contract.py
Original file line number Diff line number Diff line change
Expand Up @@ -444,7 +444,10 @@ def contract_draft(self):
def contract_waiting(self):
if self.filtered(lambda c: c.state == "active"):
raise UserError(_("Active contract cannot be put to waiting"))
if self.filtered(lambda c: not c.total_amount):
if self.filtered(lambda c: not c.total_amount) and self.type not in (
"SWP",
"SC",
):
raise UserError(_("Please configure contract lines"))
self.write({"state": "waiting", "start_date": fields.Datetime.now()})
self.generate_invoices()
Expand Down

0 comments on commit 8d17c4c

Please sign in to comment.