[FIX] account: add invoice partner as follower

Feature was lost in the accounting-pocalypse merge.

Partner (customer) should be added as follower when the invoice is
posted, previously open.

See https://github.com/odoo/odoo/commit/beaa30a3d1843de43a45f419bfbc1bfa7613a920#diff-f3712147f4b25231caa371bd83265dbeL1447

We also add the commercial partner now.

Closes odoo/odoo#34766

Signed-off-by: Quentin De Paoli (qdp) <qdp@openerp.com>
This commit is contained in:
Johan Demaret Rivarola
2019-07-11 10:13:18 +00:00
parent c61de0cb84
commit 6f2efae1f1
+3
View File
@@ -1876,6 +1876,9 @@ class AccountMove(models.Model):
for move in self:
if move.auto_post and move.date > fields.Date.today():
raise UserError(_("This move is configured to be auto-posted on {}".format(move.date.strftime(self.env['res.lang']._lang_get(self.env.user.lang).date_format))))
move.message_subscribe([p.id for p in [move.partner_id, move.commercial_partner_id] if p not in move.message_partner_ids])
to_write = {'state': 'posted'}
if move.name == '/':