[FIX]pms: fixed sending email to the creator user of the folio

This commit is contained in:
braisab
2022-02-16 19:33:53 +01:00
committed by Darío Lodeiros
parent 9fb39fa7e9
commit 537674aab2

View File

@@ -1401,7 +1401,7 @@ class PmsFolio(models.Model):
)
ctx = dict(
model="pms.folio",
default_res_model="pms.folio",
default_model="pms.folio",
default_res_id=self.id,
template_id=template and template.id or False,
composition_mode="comment",
@@ -1421,6 +1421,13 @@ class PmsFolio(models.Model):
"context": ctx,
}
def _message_post_after_hook(self, message, msg_vals):
res = super(PmsFolio, self)._message_post_after_hook(message, msg_vals)
for folio in self:
for follower in folio.message_follower_ids:
follower.unlink()
return res
def action_view_invoice(self):
invoices = self.mapped("move_ids")
action = self.env["ir.actions.actions"]._for_xml_id(