Skip to content

Commit

Permalink
[ADD] similar glue module partner_hide_technical_employee_calendar
Browse files Browse the repository at this point in the history
  • Loading branch information
legalsylvain committed Feb 14, 2025
1 parent 041ae4a commit e8a6873
Show file tree
Hide file tree
Showing 12 changed files with 143 additions and 0 deletions.
64 changes: 64 additions & 0 deletions partner_hide_technical_employee_calendar/README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
========================================
Partner - Hide Users Partners - Calendar
========================================

..
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! source digest: sha256:4a1fe4062779467d7c4d402805c00521a23c3f1b017d02cc989475579dfdd4bb
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
.. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png
:target: https://odoo-community.org/page/development-status
:alt: Beta
.. |badge2| image:: https://img.shields.io/badge/licence-AGPL--3-blue.png
:target: http://www.gnu.org/licenses/agpl-3.0-standalone.html
:alt: License: AGPL-3
.. |badge3| image:: https://img.shields.io/badge/github-grap%2Fgrap--odoo--business-lightgray.png?logo=github
:target: https://github.com/grap/grap-odoo-business/tree/16.0/partner_hide_technical_user_calendar
:alt: grap/grap-odoo-business

|badge1| |badge2| |badge3|

This is a glue module to be installed when ``partner_hide_technical_user_calendar``
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.

**Table of contents**

.. contents::
:local:

Bug Tracker
===========

Bugs are tracked on `GitHub Issues <https://github.com/grap/grap-odoo-business/issues>`_.
In case of trouble, please check there if your issue has already been reported.
If you spotted it first, help us to smash it by providing a detailed and welcomed
`feedback <https://github.com/grap/grap-odoo-business/issues/new?body=module:%20partner_hide_technical_user_calendar%0Aversion:%2016.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_.

Do not contact contributors directly about support or help with technical issues.

Credits
=======

Authors
~~~~~~~

* GRAP

Contributors
~~~~~~~~~~~~

* Sylvain LE GAL (https://www.twitter.com/legalsylvain)

Maintainers
~~~~~~~~~~~

This module is part of the `grap/grap-odoo-business <https://github.com/grap/grap-odoo-business/tree/16.0/partner_hide_technical_user_calendar>`_ project on GitHub.

You are welcome to contribute.
1 change: 1 addition & 0 deletions partner_hide_technical_employee_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_employee_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 Employee Partners - Calendar",
"summary": "Glue module with calendar,"
" to Hide partners created when creating employees.",
"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_employee", "calendar"],
"installable": True,
"auto_install": True,
}
16 changes: 16 additions & 0 deletions partner_hide_technical_employee_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_employee_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"
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_employee_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_employee=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_employee_calendar``
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_employee_calendar/tests/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
from . import test_module
15 changes: 15 additions & 0 deletions partner_hide_technical_employee_calendar/tests/test_module.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.tests.common import TransactionCase


class TestModule(TransactionCase):
@classmethod
def setUpClass(cls):
super().setUpClass()
cls.employee = cls.env.ref("hr.employee_hne")

def test_no_error(self):
self.employee.work_contact_id._compute_meeting()
6 changes: 6 additions & 0 deletions setup/partner_hide_technical_employee_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 e8a6873

Please sign in to comment.