From c8c8eb3d5652e9834d0ecd5aad907ee359edb657 Mon Sep 17 00:00:00 2001 From: sri-odoo Date: Thu, 29 Aug 2019 13:48:12 +0000 Subject: [IMP] website_forum, *: revamp design MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * web_editor, website_profile Part of https://github.com/odoo/odoo/pull/35749 task-2024197 Co-authored-by: Jérémy Kersten Co-authored-by: qsm-odoo Co-authored-by: fja-odoo --- addons/website_forum/models/website.py | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 addons/website_forum/models/website.py (limited to 'addons/website_forum/models/website.py') diff --git a/addons/website_forum/models/website.py b/addons/website_forum/models/website.py new file mode 100644 index 00000000000..29a42fd8850 --- /dev/null +++ b/addons/website_forum/models/website.py @@ -0,0 +1,15 @@ +# -*- coding: utf-8 -*- +# Part of Odoo. See LICENSE file for full copyright and licensing details. + +from odoo import models, fields + + +class Website(models.Model): + _inherit = 'website' + + def _compute_field_forums_count(self): + Forum = self.env['forum.forum'] + for website in self: + website.forums_count = Forum.search_count(website.website_domain()) + + forums_count = fields.Integer(compute=_compute_field_forums_count) -- cgit v1.2.3