-
-
Notifications
You must be signed in to change notification settings - Fork 199
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[IMP] sale_financial_risk: Send email when risk confirmed #394
base: 16.0
Are you sure you want to change the base?
[IMP] sale_financial_risk: Send email when risk confirmed #394
Conversation
There hasn't been any activity on this pull request in the past 4 months, so it has been marked as stale and it will be closed automatically if no further activity occurs in the next 30 days. |
0278282
to
5f8164c
Compare
Rebased on |
# Copyright 2024 Simone Rubino - Aion Tech | ||
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). | ||
|
||
from odoo import models | ||
|
||
|
||
class PartnerRiskExceededWiz(models.TransientModel): | ||
_inherit = "partner.risk.exceeded.wiz" | ||
|
||
def _post_sale_order_confirm_risk(self, origin_record): | ||
template = origin_record.company_id.sale_order_confirm_risk_template_id | ||
if template: | ||
template.send_mail(origin_record.id) | ||
|
||
def button_continue(self): | ||
continue_result = super().button_continue() | ||
origin_record = self.origin_reference | ||
if origin_record._name == "sale.order": | ||
self._post_sale_order_confirm_risk(origin_record) | ||
return continue_result |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unnecessary with the changes proposed here #393 (review)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for having a look!
As I wrote in #393 (comment), I think it's better to have the behavior for sale orders explicitly managed, so I have improved the documentation of this method to explain that.
5f8164c
to
6831e2d
Compare
Allow to send a configurable email template when risk for an invoice is explicitly exceeded in the wizard.
Similar to #393, but for sale orders.