From 6f2efae1f138bfeb011bf336e21c131418b8fc3c Mon Sep 17 00:00:00 2001 From: Johan Demaret Rivarola Date: Wed, 10 Jul 2019 16:24:49 +0000 Subject: [PATCH] [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) --- addons/account/models/account_move.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/addons/account/models/account_move.py b/addons/account/models/account_move.py index 3a98eaecd8c..87acda2151f 100644 --- a/addons/account/models/account_move.py +++ b/addons/account/models/account_move.py @@ -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 == '/':