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

Re-added needaction_partner_id field to bitcoin notification #169

Open
wants to merge 1 commit into
base: 15.0
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions payment_bitcoin/models/bitcoin.py
Original file line number Diff line number Diff line change
Expand Up @@ -389,13 +389,19 @@ def send_bitcoin_address_goes_low_notification(self):
if group:
groups += group

needaction_partner_ids = [
(4, user.partner_id.id) for user in groups.mapped("users")
]

self.env["mail.message"].create(
{
"message_type": "notification",
"subtype_id": self.env.ref("mail.mt_comment").id,
"date": datetime.now(),
"body": "<p>Only %s unused Bitcoin addresses are left. "
"Please add new addresses.</p>" % unused_address_count,
"partner_ids": needaction_partner_ids,
"needaction": True,
}
)
return
Expand Down
Loading