Skip to content

Commit

Permalink
[17.0] T1771 partner_communication: migration to 17.0
Browse files Browse the repository at this point in the history
  • Loading branch information
ecino committed Sep 19, 2024
1 parent b1065d8 commit 0f6369f
Show file tree
Hide file tree
Showing 30 changed files with 845 additions and 562 deletions.
2 changes: 1 addition & 1 deletion child_compassion/views/child_compassion_view.xml
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@
/>
</header>
<sheet>
<div class="oe_button_box" name="buttons">
<div class="oe_button_box" name="button_box">
<button
name="get_infos"
string="Get info"
Expand Down
2 changes: 1 addition & 1 deletion child_compassion/views/compassion_reservation_view.xml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
<field name="state" widget="statusbar" />
</header>
<sheet>
<div class="oe_button_box" name="buttons">
<div class="oe_button_box" name="button_box">
<button
name="show_reserved_children"
type="object"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
<field name="name" />
</h1>
</div>
<div class="oe_button_box" name="buttons">
<div class="oe_button_box" name="button_box">
<button
name="view_children"
type="object"
Expand Down
58 changes: 58 additions & 0 deletions partner_communication/README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
=====================
Partner Communication
=====================

..
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! source digest: sha256:4ab6ac3d709e050b5b05223900a63985bf3602dd9f6d83da92ff0df0feab456b
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
.. |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-CompassionCH%2Fcompassion--modules-lightgray.png?logo=github
:target: https://github.com/CompassionCH/compassion-modules/tree/17.0/partner_communication
:alt: CompassionCH/compassion-modules

|badge1| |badge2| |badge3|

The Partner Communication module is designed to facilitate the sending
of emails and printing communications within your Odoo system. This
module ensures that communication processes are streamlined and
efficient.

**Table of contents**

.. contents::
:local:

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

Bugs are tracked on `GitHub Issues <https://github.com/CompassionCH/compassion-modules/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/CompassionCH/compassion-modules/issues/new?body=module:%20partner_communication%0Aversion:%2017.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
-------

* Compassion Switzerland

Maintainers
-----------

This module is part of the `CompassionCH/compassion-modules <https://github.com/CompassionCH/compassion-modules/tree/17.0/partner_communication>`_ project on GitHub.

You are welcome to contribute.
6 changes: 3 additions & 3 deletions partner_communication/__manifest__.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
# pylint: disable=C8101
{
"name": "Partner Communication",
"version": "16.0.1.0.0",
"version": "17.0.1.0.0",
"category": "Other",
"author": "Compassion Switzerland",
"license": "AGPL-3",
Expand All @@ -39,9 +39,10 @@
"base_report_to_printer", # OCA/report-print-send
"contacts",
"queue_job", # OCA/queue
"mass_mailing_sms", # OCA/queue
"mass_mailing_sms",
"utm",
"mail",
"phone_validation",
],
"external_dependencies": {"python": ["wand"]},
"data": [
Expand All @@ -61,7 +62,6 @@
"views/communication_snippet_view.xml",
"data/default_communication.xml",
"data/queue_job.xml",
# "data/assets_backend.xml",
],
"qweb": [],
"demo": ["demo/demo_data.xml"],
Expand Down
12 changes: 3 additions & 9 deletions partner_communication/data/default_communication.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@
<record id="default_communication_template" model="mail.template">
<field name="name">Default communication</field>
<field name="model_id" ref="model_partner_communication_job" />
<field name="email_from">{{ object.user_id.email_formatted }}</field>
<field name="use_default_to" eval="True" />
<field name="reply_to">{{ object.user_id.email_formatted }}</field>
</record>

<record id="default_communication" model="partner.communication.config">
Expand All @@ -14,13 +17,4 @@
<field name="report_id" ref="report_a4_communication" />
<field name="email_template_id" ref="default_communication_template" />
</record>

<record id="phonecall_communication" model="partner.communication.config">
<field name="name">Phonecall</field>
<field name="model_id" ref="model_res_partner" />
<field name="send_mode">partner_preference</field>
<field
name="send_mode_pref_field"
>global_communication_delivery_preference</field>
</record>
</odoo>
2 changes: 0 additions & 2 deletions partner_communication/models/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,9 @@
communication_config,
communication_job,
communication_snippet,
email,
ir_actions,
ir_attachment,
mail_mail,
mail_template,
queue_job,
res_partner,
)
3 changes: 0 additions & 3 deletions partner_communication/models/communication_attachment.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,10 @@ class CommunicationAttachment(models.Model):
"Communication",
required=True,
ondelete="cascade",
readonly=False,
)
report_id = fields.Many2one(
"ir.actions.report",
string="ID of report used by the attachment",
readonly=False,
)
report_name = fields.Char(
required=True, help="Identifier of the report used to print"
Expand All @@ -42,7 +40,6 @@ class CommunicationAttachment(models.Model):
"ir.attachment",
string="Attachments",
required=True,
readonly=False,
ondelete="cascade",
)
data = fields.Binary(compute="_compute_data")
Expand Down
10 changes: 5 additions & 5 deletions partner_communication/models/communication_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@ class CommunicationDefaults(models.AbstractModel):
"ir.actions.report",
"Print report",
domain=[("model", "=", "partner.communication.job")],
readonly=False,
)
printer_input_tray_id = fields.Many2one("printing.tray.input", "Paper Source")
printer_output_tray_id = fields.Many2one("printing.tray.output", "Output Bin")
Expand Down Expand Up @@ -90,14 +89,16 @@ class CommunicationConfig(models.Model):
# FIELDS #
##########################################################################
source_id = fields.Many2one(
"utm.source", "UTM Source", required=True, ondelete="restrict", readonly=False
"utm.source",
"UTM Source",
required=True,
ondelete="restrict",
)
model_id = fields.Many2one(
"ir.model",
"Applies to",
required=True,
help="The kind of document with this communication can be used",
readonly=False,
ondelete="cascade",
)
model = fields.Char(related="model_id.model", store=True, readonly=True)
Expand All @@ -115,7 +116,6 @@ class CommunicationConfig(models.Model):
("model", "=", "partner.communication.job"),
("model", "=", "crm.claim"),
],
readonly=False,
)
attachments_function = fields.Char(
help="Define a function in the communication_job model that will "
Expand Down Expand Up @@ -259,7 +259,7 @@ def build_inform_mode(
"digital_only" in partner_mode or "digital_only" in comm_mode
)
else:
send_mode = getattr(partner, send_mode_pref_field, "none")
send_mode = getattr(partner, send_mode_pref_field, "none") or "none"
auto_mode = "auto" in send_mode or send_mode == "both"
digital_only = "digital_only" in send_mode

Expand Down
Loading

0 comments on commit 0f6369f

Please sign in to comment.