Skip to content
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

Open
wants to merge 1 commit into
base: 16.0
Choose a base branch
from

Conversation

SirAionTech
Copy link

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.

@SirAionTech SirAionTech marked this pull request as ready for review August 1, 2024 10:58
Copy link

github-actions bot commented Dec 1, 2024

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.
If you want this PR to never become stale, please ask a PSC member to apply the "no stale" label.

@github-actions github-actions bot added the stale PR/Issue without recent activity, it'll be soon closed automatically. label Dec 1, 2024
@SirAionTech SirAionTech force-pushed the 16.0-imp-sale_financial_risk-risk_template branch from 0278282 to 5f8164c Compare December 2, 2024 08:20
@SirAionTech
Copy link
Author

Rebased on 16.0.

Comment on lines 1 to 25
# 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
Copy link
Contributor

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)

Copy link
Author

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.

@SirAionTech SirAionTech force-pushed the 16.0-imp-sale_financial_risk-risk_template branch from 5f8164c to 6831e2d Compare December 2, 2024 10:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
stale PR/Issue without recent activity, it'll be soon closed automatically.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants