Skip to content

Commit c6bf519

Browse files
committed
[ADD] application_set: Add followers field
1 parent 3606c77 commit c6bf519

File tree

7 files changed

+34
-1
lines changed

7 files changed

+34
-1
lines changed

argocd_deployer/__manifest__.py

+1
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
"data/application_set_template.xml",
1212
"data/application_set.xml",
1313
"data/ir_cron_data.xml",
14+
"data/mail_data.xml",
1415
"views/application_domain_view.xml",
1516
"views/application_template_view.xml",
1617
"views/application_set_template_view.xml",

argocd_deployer/data/mail_data.xml

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
<?xml version="1.0" encoding="utf-8" ?>
2+
<odoo>
3+
<record id="subtype_application_deletion" model="mail.message.subtype">
4+
<field name="name">Application Deletion</field>
5+
<field name="res_model">argocd.application</field>
6+
<field name="default" eval="True" />
7+
<field name="internal" eval="True" />
8+
</record>
9+
</odoo>

argocd_deployer/models/application.py

+16
Original file line numberDiff line numberDiff line change
@@ -257,4 +257,20 @@ def destroy(self, eta=0):
257257
"argocd.application_destruction_delay", "0"
258258
)
259259
)
260+
self.message_post(
261+
subtype_xmlid="argocd_deployer.subtype_application_deletion",
262+
body=_("Destroying application '%(name)s' in %(eta)s seconds.")
263+
% {"name": self.name, "eta": eta or delay},
264+
)
260265
self.with_delay(eta=eta or delay).immediate_destroy()
266+
267+
def _message_auto_subscribe_followers(self, updated_values, default_subtype_ids):
268+
res = super()._message_auto_subscribe_followers(
269+
updated_values, default_subtype_ids
270+
)
271+
if updated_values.get("application_set_id"):
272+
res += [
273+
(p.id, default_subtype_ids, False)
274+
for p in self.application_set_id.partner_ids
275+
]
276+
return res

argocd_deployer/models/application_set.py

+5
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,11 @@ class ApplicationSet(models.Model):
3939
help="Folder inside the repository in which to store the application YAML files.",
4040
)
4141
namespace_prefix_id = fields.Many2one("argocd.application.namespace.prefix")
42+
partner_ids = fields.Many2many(
43+
comodel_name="res.partner",
44+
string="Followers",
45+
help="Partners that are automically added as followers to applications in the application set.",
46+
)
4247

4348
_sql_constraints = [
4449
("application_set_name_unique", "unique(name)", "Already exists"),

argocd_deployer/views/application_set_view.xml

+1
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,7 @@
6666
<field name="name" attrs="{'readonly': [('is_deployed', '=', True)]}"/>
6767
<field name="description"/>
6868
<field name="template_id"/>
69+
<field name="partner_ids" widget="many2many_tags_email" />
6970
</group>
7071
<group id="group_repository" string="Repository">
7172
<field name="repository_url" attrs="{'readonly': [('is_deployed', '=', True)]}"/>

helpdesk_mgmt_email/__manifest__.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
"license": "AGPL-3",
88
"category": "After-Sales",
99
"author": "Onestein BV",
10-
"website": "https://www.onestein.eu",
10+
"website": "https://www.onestein.nl",
1111
"depends": ["helpdesk_mgmt", "base_automation", "mail_layout_force"],
1212
"data": [
1313
"data/mail_template.xml",

helpdesk_ticket_custom_priority/__manifest__.py

+1
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
"summary": """
99
Adds more priorities to helpdesk tickets.
1010
""",
11+
"website": "https://www.onestein.nl",
1112
# Author
1213
"author": "Onestein",
1314
"depends": ["helpdesk_mgmt"],

0 commit comments

Comments
 (0)