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

[DO NOT MERGE][FIX] - no auto message subscribe for purchase documents #57

Open
wants to merge 1 commit into
base: 14.0
Choose a base branch
from
Open
Show file tree
Hide file tree
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
4 changes: 0 additions & 4 deletions addons/account/models/account_move.py
Original file line number Diff line number Diff line change
Expand Up @@ -2761,10 +2761,6 @@ def _post(self, soft=True):
'posted_before': True,
})

for move in to_post:
move.message_subscribe([p.id for p in [move.partner_id] if p not in move.sudo().message_partner_ids])


for move in to_post:
if move.is_sale_document() \
and move.journal_id.sale_activity_type_id \
Expand Down
5 changes: 1 addition & 4 deletions addons/mail/models/mail_thread.py
Original file line number Diff line number Diff line change
Expand Up @@ -1865,17 +1865,14 @@ def message_post(self, *,
if not subtype_id:
subtype_id = self.env['ir.model.data'].xmlid_to_res_id('mail.mt_note')

# automatically subscribe recipients if asked to
if self._context.get('mail_post_autofollow') and partner_ids:
self.message_subscribe(list(partner_ids))

# parent management, depending on ``_mail_flat_thread``
# ``_mail_flat_thread`` True: no free message. If no parent, find the first
# posted message and attach new message to it. If parent, get back to the first
# ancestor and attach it. We don't keep hierarchy (one level of threading).
# ``_mail_flat_thread`` False: free message = new thread (think of mailing lists).
# If parent get up one level to try to flatten threads without completely
# removing hierarchy.

MailMessage_sudo = self.env['mail.message'].sudo()
if self._mail_flat_thread and not parent_id:
parent_message = MailMessage_sudo.search([('res_id', '=', self.id), ('model', '=', self._name), ('message_type', '!=', 'user_notification')], order="id ASC", limit=1)
Expand Down
2 changes: 0 additions & 2 deletions addons/purchase/models/purchase.py
Original file line number Diff line number Diff line change
Expand Up @@ -411,8 +411,6 @@ def button_confirm(self):
order.button_approve()
else:
order.write({'state': 'to approve'})
if order.partner_id not in order.message_partner_ids:
order.message_subscribe([order.partner_id.id])
return True

def button_cancel(self):
Expand Down