Skip to content

Commit

Permalink
[ADD] partner_hide_technical_company_calendar: glue module to make th…
Browse files Browse the repository at this point in the history
…e module partner_hide_technical_company working when calendar is installed
  • Loading branch information
legalsylvain committed Feb 14, 2025
1 parent 675aaa1 commit 5148bbb
Show file tree
Hide file tree
Showing 12 changed files with 78 additions and 0 deletions.
Empty file.
1 change: 1 addition & 0 deletions partner_hide_technical_company_calendar/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
from . import models
17 changes: 17 additions & 0 deletions partner_hide_technical_company_calendar/__manifest__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# Copyright (C) 2024 - Today: GRAP (http://www.grap.coop)
# @author: Sylvain LE GAL (https://twitter.com/legalsylvain)
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).

{
"name": "Partner - Hide Companies Partners - Calendar",
"summary": "Glue module with calendar,"
" to Hide partners created when creating companies.",
"version": "16.0.1.0.0",
"category": "base",
"author": "GRAP",
"website": "https://github.com/grap/grap-odoo-business",
"license": "AGPL-3",
"depends": ["partner_hide_technical_company", "calendar"],
"installable": True,
"auto_install": True,
}
16 changes: 16 additions & 0 deletions partner_hide_technical_company_calendar/i18n/fr.po
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * partner_hide_technical_company_calendar
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 16.0\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2024-06-21 09:44+0000\n"
"PO-Revision-Date: 2024-06-21 09:44+0000\n"
"Last-Translator: \n"
"Language-Team: \n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: \n"
"Plural-Forms: \n"
1 change: 1 addition & 0 deletions partner_hide_technical_company_calendar/models/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
from . import res_partner
15 changes: 15 additions & 0 deletions partner_hide_technical_company_calendar/models/res_partner.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# Copyright (C) 2024 - Today: GRAP (http://www.grap.coop)
# @author: Sylvain LE GAL (https://twitter.com/legalsylvain)
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).


from odoo import models


class ResPartner(models.Model):
_inherit = "res.partner"

def _compute_meeting(self):
return super(
ResPartner, self.with_context(show_odoo_company=True)
)._compute_meeting()
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
* Sylvain LE GAL (https://www.twitter.com/legalsylvain)
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
This is a glue module to be installed when ``partner_hide_technical_company``
and ``calendar`` module are installed.

It avoid an hugly error in the ``_compute_meeting`` function, that are failing
due to an SQL request bad designed.
1 change: 1 addition & 0 deletions partner_hide_technical_company_calendar/tests/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
from . import test_module
14 changes: 14 additions & 0 deletions partner_hide_technical_company_calendar/tests/test_module.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# Copyright (C) 2024 - Today: GRAP (http://www.grap.coop)
# @author: Sylvain LE GAL (https://twitter.com/legalsylvain)
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).

from odoo.tests.common import TransactionCase


class TestModule(TransactionCase):
@classmethod
def setUpClass(cls):
super().setUpClass()

def test_no_error(self):
self.env.company.partner_id._compute_meeting()
6 changes: 6 additions & 0 deletions setup/partner_hide_technical_company_calendar/setup.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
import setuptools

setuptools.setup(
setup_requires=['setuptools-odoo'],
odoo_addon=True,
)

0 comments on commit 5148bbb

Please sign in to comment.