Skip to content

Commit

Permalink
add shopinvader_state
Browse files Browse the repository at this point in the history
  • Loading branch information
matthieu.saison committed Jan 18, 2024
1 parent 2fead05 commit 23cf892
Show file tree
Hide file tree
Showing 4 changed files with 36 additions and 2 deletions.
2 changes: 1 addition & 1 deletion sale_quotation/README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ Sale Quotation
!! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! source digest: sha256:0b385df82e12b7547593361d9083b791ef182af861cad60fa9425f2845de77ac
!! source digest: sha256:79ec393c9ca6d114b4479c21bc5b1ec617adbcd53a2e750a99977e56331ff908
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
.. |badge1| image:: https://img.shields.io/badge/maturity-Production%2FStable-green.png
Expand Down
2 changes: 1 addition & 1 deletion sale_quotation/static/description/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -367,7 +367,7 @@ <h1 class="title">Sale Quotation</h1>
!! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! source digest: sha256:0b385df82e12b7547593361d9083b791ef182af861cad60fa9425f2845de77ac
!! source digest: sha256:79ec393c9ca6d114b4479c21bc5b1ec617adbcd53a2e750a99977e56331ff908
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->
<p><a class="reference external image-reference" href="https://odoo-community.org/page/development-status"><img alt="Production/Stable" src="https://img.shields.io/badge/maturity-Production%2FStable-green.png" /></a> <a class="reference external image-reference" href="http://www.gnu.org/licenses/agpl-3.0-standalone.html"><img alt="License: AGPL-3" src="https://img.shields.io/badge/licence-AGPL--3-blue.png" /></a> <a class="reference external image-reference" href="https://github.com/shopinvader/odoo-shopinvader/tree/16.0/sale_quotation"><img alt="shopinvader/odoo-shopinvader" src="https://img.shields.io/badge/github-shopinvader%2Fodoo--shopinvader-lightgray.png?logo=github" /></a></p>
<p>This module handle the model and view for product and sale.order needs for shopinvader-api-quotation</p>
Expand Down
1 change: 1 addition & 0 deletions shopinvader_api_quotation/models/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
from . import sale_order
33 changes: 33 additions & 0 deletions shopinvader_api_quotation/models/sale_order.py
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()

0 comments on commit 23cf892

Please sign in to comment.