-
Notifications
You must be signed in to change notification settings - Fork 242
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fieldservice_recurring: refactore stages
Stages are now: draft: not started yet progress: orders are and will continue to be generated suspend: it can continue to generate orders but it has been put on pause for some reason close: no new orders will / can be generated ```dot digraph { draft -> progress -> suspend -> close suspend -> progress } ``` Why this change ? - it was impossible to go back to progress after cancel - pending / renew is too opinated to be in a base module, - renew duration was hardcoded (btw renew can be implemented by a renew_date instead of a stage in a dedicated module)
- Loading branch information
1 parent
57742c5
commit 4aa5093
Showing
5 changed files
with
27 additions
and
58 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
7 changes: 7 additions & 0 deletions
7
fieldservice_recurring/migrations/16.0.2.0.0/pre-migration.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
# Copyright (C) 2022 Raphaël Reverdy <raphael.reverdy@akretion.com> | ||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). | ||
|
||
|
||
def migrate(env, version): | ||
env.execute("UPDATE fsm_recurring SET state = 'close' WHERE state = 'cancel';") | ||
env.execute("UPDATE fsm_recurring SET state = 'progress' WHERE state = 'pending';") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters