-
Notifications
You must be signed in to change notification settings - Fork 105
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
matthieu.saison
committed
Jan 18, 2024
1 parent
2fead05
commit 23cf892
Showing
4 changed files
with
36 additions
and
2 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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
from . import sale_order |
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,33 @@ | ||
# Copyright 2017-2018 Akretion (http://www.akretion.com). | ||
# Copyright 2021 Camptocamp (http://www.camptocamp.com) | ||
# @author Benoît GUILLOT <[email protected]> | ||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). | ||
|
||
|
||
from odoo import fields, models | ||
|
||
|
||
class SaleOrder(models.Model): | ||
_inherit = "sale.order" | ||
|
||
shopinvader_state = fields.Selection( | ||
selection_add=[ | ||
("estimating", "Estimating Quotation"), | ||
("estimated", "Estimated Quotation"), | ||
], | ||
ondelete={ | ||
"estimating": "cascade", | ||
"estimated": "cascade", | ||
}, | ||
) | ||
|
||
def _compute_shopinvader_state_depends(self): | ||
return super()._compute_shopinvader_state_depends() + ("typology",) | ||
|
||
def _get_shopinvader_state(self): | ||
self.ensure_one() | ||
if self.typology == "quotation" and self.state == "draft": | ||
return "estimating" | ||
if self.typology == "quotation" and self.state == "sent": | ||
return "estimated" | ||
return super()._get_shopinvader_state() |