[FIX] knowledge: unarchive multiple articles

Currently, when we unarchive a single article, it works properly by
making it active again and redirecting user to that article. But
when we try to unarchive multiple articles, it throws traceback.

This commit fixes the issue by properly handling the action for
unarchiving, which now will simply reload the same action in
case of multiple articles. Note that behavior for unarchiving
single article is still the same.

taskID-2869659

closes odoo/odoo#92851

Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
This commit is contained in:
Umesh Gupta
2022-06-03 14:36:46 +02:00
committed by Dharmraj Jhala
parent d83ce882b8
commit e58f864fd7
+4 -2
View File
@@ -716,8 +716,10 @@ class Article(models.Model):
return self.with_context(res_id=False).action_home_page()
def action_unarchive(self):
super(Article, self).action_unarchive()
return self.with_context(res_id=self.id).action_home_page()
res = super(Article, self).action_unarchive()
if len(self) == 1:
return self.with_context(res_id=self.id).action_home_page()
return res
# ------------------------------------------------------------
# SEQUENCE / ORDERING