Skip to content

Commit

Permalink
[ADD] mail_contact_type:
Browse files Browse the repository at this point in the history
Provides a method to use on mail templates to select contacts by their categories.
  • Loading branch information
Matthias BARKAT committed Dec 6, 2023
1 parent ef5f876 commit e4307f2
Show file tree
Hide file tree
Showing 19 changed files with 1,100 additions and 0 deletions.
100 changes: 100 additions & 0 deletions mail_contact_type/README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,100 @@
=================
Mail Contact Type
=================

..
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! source digest: sha256:3806166f869c62618c8b1436e7b69ba890ccb894bcda11bc958dd5ab1d308542
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
.. |badge1| image:: https://img.shields.io/badge/maturity-Alpha-red.png
:target: https://odoo-community.org/page/development-status
:alt: Alpha
.. |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-OCA%2Fsocial-lightgray.png?logo=github
:target: https://github.com/OCA/social/tree/14.0/mail_contact_type
:alt: OCA/social
.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png
:target: https://translation.odoo-community.org/projects/social-14-0/social-14-0-mail_contact_type
:alt: Translate me on Weblate
.. |badge5| image:: https://img.shields.io/badge/runboat-Try%20me-875A7B.png
:target: https://runboat.odoo-community.org/builds?repo=OCA/social&target_branch=14.0
:alt: Try me on Runboat

|badge1| |badge2| |badge3| |badge4| |badge5|

Provides a method to use on mail templates to select contacts by their categories.

.. IMPORTANT::
This is an alpha version, the data model and design can change at any time without warning.
Only for development or testing purpose, do not use in production.
`More details on development status <https://odoo-community.org/page/development-status>`_

**Table of contents**

.. contents::
:local:

Usage
=====

In the **Contacts > Configuration > Mailing > Contact type** you can create mail contact type.

A mail contact type is defined by a name that will be displayed in the backoffice
and a code that will be used to find contacts related to this type.

Then, you will need to define the mailing types for contacts. To achieve this
there is a field called **Mail Contact Types** into the contact form view.

Last, to select proper contacts from email template configuration,
you will set the **To (partner)** field using jinja template
like this (assuming `object` as a field `partner_id`):
`${object.partner_id.contact_by_types('your_code1','your_code2')}`

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

Bugs are tracked on `GitHub Issues <https://github.com/OCA/social/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/OCA/social/issues/new?body=module:%20mail_contact_type%0Aversion:%2014.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
~~~~~~~

* Foodles

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

This module is maintained by the OCA.

.. image:: https://odoo-community.org/logo.png
:alt: Odoo Community Association
:target: https://odoo-community.org

OCA, or the Odoo Community Association, is a nonprofit organization whose
mission is to support the collaborative development of Odoo features and
promote its widespread use.

.. |maintainer-petrus-v| image:: https://github.com/petrus-v.png?size=40px
:target: https://github.com/petrus-v
:alt: petrus-v

Current `maintainer <https://odoo-community.org/page/maintainer-role>`__:

|maintainer-petrus-v|

This module is part of the `OCA/social <https://github.com/OCA/social/tree/14.0/mail_contact_type>`_ project on GitHub.

You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.
1 change: 1 addition & 0 deletions mail_contact_type/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
from . import models
26 changes: 26 additions & 0 deletions mail_contact_type/__manifest__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# Copyright 2023 Foodles (https://www.foodles.com/)
# @author Pierre Verkest <[email protected]>
# @author Matthias Barkat <[email protected]>
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
{
"name": "Mail Contact Type",
"summary": "Mail Contact Type",
"version": "14.0.1.0.0",
"development_status": "Alpha",
"category": "Productivity/Discuss",
"website": "https://github.com/OCA/social",
"author": "Foodles, Odoo Community Association (OCA)",
"maintainers": ["petrus-v"],
"license": "AGPL-3",
"depends": [
"contacts",
"mail",
],
"data": [
"security/ir.model.access.csv",
"views/mail_contact_type.xml",
"views/res_partner.xml",
"views/menu.xml",
],
"installable": True,
}
115 changes: 115 additions & 0 deletions mail_contact_type/i18n/fr.po
Original file line number Diff line number Diff line change
@@ -0,0 +1,115 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * mail_contact_type
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 14.0+e\n"
"Report-Msgid-Bugs-To: \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"

#. module: mail_contact_type
#: model:ir.model.fields,field_description:mail_contact_type.field_mail_contact_type__code
msgid "Code"
msgstr ""

#. module: mail_contact_type
#: model:ir.model,name:mail_contact_type.model_res_partner
msgid "Contact"
msgstr ""

#. module: mail_contact_type
#: model_terms:ir.ui.view,arch_db:mail_contact_type.view_mail_contact_type_form
msgid "Contact Type"
msgstr "Type de contact"

#. module: mail_contact_type
#: model:ir.actions.act_window,name:mail_contact_type.action_mail_contact_type
#: model_terms:ir.ui.view,arch_db:mail_contact_type.view_mail_contact_type_tree
msgid "Contact Types"
msgstr "Types de contact"

#. module: mail_contact_type
#: model:ir.ui.menu,name:mail_contact_type.menu_contact_type_list
msgid "Contact types"
msgstr "Types de contact"

#. module: mail_contact_type
#: model:ir.model.fields,field_description:mail_contact_type.field_mail_contact_type__create_uid
msgid "Created by"
msgstr "Créé par"

#. module: mail_contact_type
#: model:ir.model.fields,field_description:mail_contact_type.field_mail_contact_type__create_date
msgid "Created on"
msgstr "Créé le"

#. module: mail_contact_type
#: model:ir.model.fields,field_description:mail_contact_type.field_mail_contact_type__display_name
#: model:ir.model.fields,field_description:mail_contact_type.field_res_partner__display_name
msgid "Display Name"
msgstr "Nom affiché"

#. module: mail_contact_type
#: model:ir.model.fields,field_description:mail_contact_type.field_mail_contact_type__id
#: model:ir.model.fields,field_description:mail_contact_type.field_res_partner__id
msgid "ID"
msgstr ""

#. module: mail_contact_type
#: model:ir.model.fields,field_description:mail_contact_type.field_mail_contact_type____last_update
#: model:ir.model.fields,field_description:mail_contact_type.field_res_partner____last_update
msgid "Last Modified on"
msgstr "Dernière modification le"

#. module: mail_contact_type
#: model:ir.model.fields,field_description:mail_contact_type.field_mail_contact_type__write_uid
msgid "Last Updated by"
msgstr "Dernière mise à jour par"

#. module: mail_contact_type
#: model:ir.model.fields,field_description:mail_contact_type.field_mail_contact_type__write_date
msgid "Last Updated on"
msgstr "Derière mise à jour le"

#. module: mail_contact_type
#: model:ir.model,name:mail_contact_type.model_mail_contact_type
msgid "Mail Contact Type"
msgstr "Type de contact par mail"

#. module: mail_contact_type
#: model:ir.model.fields,field_description:mail_contact_type.field_fsm_location__mail_contact_type_ids
#: model:ir.model.fields,field_description:mail_contact_type.field_fsm_person__mail_contact_type_ids
#: model:ir.model.fields,field_description:mail_contact_type.field_res_partner__mail_contact_type_ids
#: model:ir.model.fields,field_description:mail_contact_type.field_res_users__mail_contact_type_ids
msgid "Mail Contact Types"
msgstr "Types de contact par mail"

#. module: mail_contact_type
#: model:ir.model.fields,help:mail_contact_type.field_fsm_location__mail_contact_type_ids
#: model:ir.model.fields,help:mail_contact_type.field_fsm_person__mail_contact_type_ids
#: model:ir.model.fields,help:mail_contact_type.field_res_partner__mail_contact_type_ids
#: model:ir.model.fields,help:mail_contact_type.field_res_users__mail_contact_type_ids
msgid "Used by email template to select contacts by mail contact type"
msgstr "Utilisé par le modèle de courriel pour sélectionner les contacts par type de contact par courriel"


#. module: mail_contact_type
#: model:ir.ui.menu,name:mail_contact_type.menu_contact_type
msgid "Mailing"
msgstr "Email"

#. module: mail_contact_type
#: model:ir.model.fields,field_description:mail_contact_type.field_mail_contact_type__name
msgid "Name"
msgstr "Nom"

#. module: mail_contact_type
#: model:ir.model.constraint,message:mail_contact_type.constraint_mail_contact_type_code_uniq
msgid "The code must be unique"
msgstr "Le code doit être unique"
114 changes: 114 additions & 0 deletions mail_contact_type/i18n/mail_contact_type.pot
Original file line number Diff line number Diff line change
@@ -0,0 +1,114 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * mail_contact_type
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 14.0+e\n"
"Report-Msgid-Bugs-To: \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"

#. module: mail_contact_type
#: model:ir.model.fields,field_description:mail_contact_type.field_mail_contact_type__code
msgid "Code"
msgstr ""

#. module: mail_contact_type
#: model:ir.model,name:mail_contact_type.model_res_partner
msgid "Contact"
msgstr ""

#. module: mail_contact_type
#: model_terms:ir.ui.view,arch_db:mail_contact_type.view_mail_contact_type_form
msgid "Contact Type"
msgstr ""

#. module: mail_contact_type
#: model:ir.actions.act_window,name:mail_contact_type.action_mail_contact_type
#: model_terms:ir.ui.view,arch_db:mail_contact_type.view_mail_contact_type_tree
msgid "Contact Types"
msgstr ""

#. module: mail_contact_type
#: model:ir.ui.menu,name:mail_contact_type.menu_contact_type_list
msgid "Contact types"
msgstr ""

#. module: mail_contact_type
#: model:ir.model.fields,field_description:mail_contact_type.field_mail_contact_type__create_uid
msgid "Created by"
msgstr ""

#. module: mail_contact_type
#: model:ir.model.fields,field_description:mail_contact_type.field_mail_contact_type__create_date
msgid "Created on"
msgstr ""

#. module: mail_contact_type
#: model:ir.model.fields,field_description:mail_contact_type.field_mail_contact_type__display_name
#: model:ir.model.fields,field_description:mail_contact_type.field_res_partner__display_name
msgid "Display Name"
msgstr ""

#. module: mail_contact_type
#: model:ir.model.fields,field_description:mail_contact_type.field_mail_contact_type__id
#: model:ir.model.fields,field_description:mail_contact_type.field_res_partner__id
msgid "ID"
msgstr ""

#. module: mail_contact_type
#: model:ir.model.fields,field_description:mail_contact_type.field_mail_contact_type____last_update
#: model:ir.model.fields,field_description:mail_contact_type.field_res_partner____last_update
msgid "Last Modified on"
msgstr ""

#. module: mail_contact_type
#: model:ir.model.fields,field_description:mail_contact_type.field_mail_contact_type__write_uid
msgid "Last Updated by"
msgstr ""

#. module: mail_contact_type
#: model:ir.model.fields,field_description:mail_contact_type.field_mail_contact_type__write_date
msgid "Last Updated on"
msgstr ""

#. module: mail_contact_type
#: model:ir.model,name:mail_contact_type.model_mail_contact_type
msgid "Mail Contact Type"
msgstr ""

#. module: mail_contact_type
#: model:ir.model.fields,field_description:mail_contact_type.field_fsm_location__mail_contact_type_ids
#: model:ir.model.fields,field_description:mail_contact_type.field_fsm_person__mail_contact_type_ids
#: model:ir.model.fields,field_description:mail_contact_type.field_res_partner__mail_contact_type_ids
#: model:ir.model.fields,field_description:mail_contact_type.field_res_users__mail_contact_type_ids
msgid "Mail Contact Types"
msgstr ""

#. module: mail_contact_type
#: model:ir.model.fields,help:mail_contact_type.field_fsm_location__mail_contact_type_ids
#: model:ir.model.fields,help:mail_contact_type.field_fsm_person__mail_contact_type_ids
#: model:ir.model.fields,help:mail_contact_type.field_res_partner__mail_contact_type_ids
#: model:ir.model.fields,help:mail_contact_type.field_res_users__mail_contact_type_ids
msgid "Used by email template to select contacts by mail contact type"
msgstr ""

#. module: mail_contact_type
#: model:ir.ui.menu,name:mail_contact_type.menu_contact_type
msgid "Mailing"
msgstr ""

#. module: mail_contact_type
#: model:ir.model.fields,field_description:mail_contact_type.field_mail_contact_type__name
msgid "Name"
msgstr ""

#. module: mail_contact_type
#: model:ir.model.constraint,message:mail_contact_type.constraint_mail_contact_type_code_uniq
msgid "The code must be unique"
msgstr ""
1 change: 1 addition & 0 deletions mail_contact_type/models/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
from . import mail_contact_type, res_partner
17 changes: 17 additions & 0 deletions mail_contact_type/models/mail_contact_type.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# Copyright 2023 Foodles (https://www.foodles.com/)
# @author Pierre Verkest <[email protected]>
# @author Matthias Barkat <[email protected]>
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
from odoo import fields, models


class MailContactType(models.Model):
_name = "mail.contact.type"
_description = "Mail Contact Type"

_sql_constraints = [
("code_uniq", "unique (code)", "The code must be unique"),
]

name = fields.Char(required=True, translate=True)
code = fields.Char(required=True)
Loading

0 comments on commit e4307f2

Please sign in to comment.