From 691496918fd143f213607a32b632db3d0ab2458e Mon Sep 17 00:00:00 2001 From: Vincent Van Rossem Date: Tue, 29 Jun 2021 18:31:32 +0200 Subject: [PATCH] [ADD] foodhub_munich_custom --- foodhub_munich_custom/README.rst | 57 +++ foodhub_munich_custom/__init__.py | 1 + foodhub_munich_custom/__manifest__.py | 19 + .../data/mail_template_data.xml | 66 +++ foodhub_munich_custom/models/__init__.py | 1 + .../models/subscription_request.py | 21 + foodhub_munich_custom/readme/CONTRIBUTORS.rst | 1 + foodhub_munich_custom/readme/DESCRIPTION.rst | 1 + .../cooperator_membership_declaration.xml | 237 ++++++++++ .../report/easy_my_coop_report.xml | 13 + .../static/description/index.html | 414 ++++++++++++++++++ 11 files changed, 831 insertions(+) create mode 100644 foodhub_munich_custom/README.rst create mode 100644 foodhub_munich_custom/__init__.py create mode 100644 foodhub_munich_custom/__manifest__.py create mode 100644 foodhub_munich_custom/data/mail_template_data.xml create mode 100644 foodhub_munich_custom/models/__init__.py create mode 100644 foodhub_munich_custom/models/subscription_request.py create mode 100644 foodhub_munich_custom/readme/CONTRIBUTORS.rst create mode 100644 foodhub_munich_custom/readme/DESCRIPTION.rst create mode 100644 foodhub_munich_custom/report/cooperator_membership_declaration.xml create mode 100644 foodhub_munich_custom/report/easy_my_coop_report.xml create mode 100644 foodhub_munich_custom/static/description/index.html diff --git a/foodhub_munich_custom/README.rst b/foodhub_munich_custom/README.rst new file mode 100644 index 00000000..ae7713ba --- /dev/null +++ b/foodhub_munich_custom/README.rst @@ -0,0 +1,57 @@ +===================== +Foodhub Munich Custom +===================== + +.. !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + !! This file is generated by oca-gen-addon-readme !! + !! changes will be overwritten. !! + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +.. |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-coopiteasy%2Fcie--custom-lightgray.png?logo=github + :target: https://github.com/coopiteasy/cie-custom/tree/12.0/foodhub_munich_custom + :alt: coopiteasy/cie-custom + +|badge1| |badge2| |badge3| + +Foodhub Munich customizations + +**Table of contents** + +.. contents:: + :local: + +Bug Tracker +=========== + +Bugs are tracked on `GitHub Issues `_. +In case of trouble, please check there if your issue has already been reported. +If you spotted it first, help us smashing it by providing a detailed and welcomed +`feedback `_. + +Do not contact contributors directly about support or help with technical issues. + +Credits +======= + +Authors +~~~~~~~ + +* Coop IT Easy SCRL fs + +Contributors +~~~~~~~~~~~~ + +* Vincent Van Rossem + +Maintainers +~~~~~~~~~~~ + +This module is part of the `coopiteasy/cie-custom `_ project on GitHub. + +You are welcome to contribute. diff --git a/foodhub_munich_custom/__init__.py b/foodhub_munich_custom/__init__.py new file mode 100644 index 00000000..0650744f --- /dev/null +++ b/foodhub_munich_custom/__init__.py @@ -0,0 +1 @@ +from . import models diff --git a/foodhub_munich_custom/__manifest__.py b/foodhub_munich_custom/__manifest__.py new file mode 100644 index 00000000..5ed193e9 --- /dev/null +++ b/foodhub_munich_custom/__manifest__.py @@ -0,0 +1,19 @@ +# Copyright 2021 Coop IT Easy SCRLfs +# Vincent Van Rossem +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). +{ + "name": "Foodhub Munich Custom", + "version": "12.0.1.0.0", + "summary": """ + Foodhub Munich customizations""", + "author": "Coop IT Easy SCRL fs", + "website": "https://coopiteasy.be", + "license": "AGPL-3", + "category": "Cooperative management", + "depends": ["easy_my_coop"], + "data": [ + "report/easy_my_coop_report.xml", + "report/cooperator_membership_declaration.xml", + "data/mail_template_data.xml", # must be loaded after reports + ], +} diff --git a/foodhub_munich_custom/data/mail_template_data.xml b/foodhub_munich_custom/data/mail_template_data.xml new file mode 100644 index 00000000..bde83199 --- /dev/null +++ b/foodhub_munich_custom/data/mail_template_data.xml @@ -0,0 +1,66 @@ + + + + + + Declaration of Membership - Send by Email + + + ${(object.company_id.coop_email_contact or object.user_id.email)|safe} + + ${object.company_id.name} Declaration of Membership + + ${object.partner_id.id} + + ${(object.company_id.coop_email_contact or object.user_id.email)|safe} + + + + + + ${(object.name or '').replace('/','_')}_${object.state == 'draft' and 'draft' or ''} + + ${object.partner_id.lang} + + + +

Hello ${object.partner_id.name},

+ +

You will find in attachment the Membership Declaration.

+ +

Sustainably your,

+

${object.company_id.name}.

+ + % if object.company_id.street: + ${object.company_id.street} + % endif + % if object.company_id.street2: + ${object.company_id.street2}
+ % endif + % if object.company_id.city or object.company_id.zip: + ${object.company_id.zip} ${object.company_id.city}
+ % endif + % if object.company_id.country_id: + ${object.company_id.state_id and ('%s, ' % object.company_id.state_id.name) or ''} + ${object.company_id.country_id.name or ''}
+ % endif + % if object.company_id.phone: + Phone:  ${object.company_id.phone} + % endif + + % if object.company_id.website: + + %endif + +
+ +
+ + ]]>
+
+ +
+
diff --git a/foodhub_munich_custom/models/__init__.py b/foodhub_munich_custom/models/__init__.py new file mode 100644 index 00000000..43a4d6d9 --- /dev/null +++ b/foodhub_munich_custom/models/__init__.py @@ -0,0 +1 @@ +from . import subscription_request diff --git a/foodhub_munich_custom/models/subscription_request.py b/foodhub_munich_custom/models/subscription_request.py new file mode 100644 index 00000000..88f464bb --- /dev/null +++ b/foodhub_munich_custom/models/subscription_request.py @@ -0,0 +1,21 @@ +from odoo import models + + +class SubscriptionRequest(models.Model): + _inherit = "subscription.request" + + def create_invoice(self, partner): + invoice = super().create_invoice(partner) + self.send_membership_declaration() + return invoice + + def send_membership_declaration(self): + if self.company_id.send_capital_release_email: + mail_template = self.get_membership_declaration_mail_template() + mail_template.sudo().send_mail(self.id, True) + + def get_membership_declaration_mail_template(self): + template = ( + "foodhub_munich_custom.email_template_membership_declaration" + ) + return self.env.ref(template, False) diff --git a/foodhub_munich_custom/readme/CONTRIBUTORS.rst b/foodhub_munich_custom/readme/CONTRIBUTORS.rst new file mode 100644 index 00000000..d9069100 --- /dev/null +++ b/foodhub_munich_custom/readme/CONTRIBUTORS.rst @@ -0,0 +1 @@ +* Vincent Van Rossem diff --git a/foodhub_munich_custom/readme/DESCRIPTION.rst b/foodhub_munich_custom/readme/DESCRIPTION.rst new file mode 100644 index 00000000..b6b220a3 --- /dev/null +++ b/foodhub_munich_custom/readme/DESCRIPTION.rst @@ -0,0 +1 @@ +Foodhub Munich customizations diff --git a/foodhub_munich_custom/report/cooperator_membership_declaration.xml b/foodhub_munich_custom/report/cooperator_membership_declaration.xml new file mode 100644 index 00000000..5db126fe --- /dev/null +++ b/foodhub_munich_custom/report/cooperator_membership_declaration.xml @@ -0,0 +1,237 @@ + + + + + + + + diff --git a/foodhub_munich_custom/report/easy_my_coop_report.xml b/foodhub_munich_custom/report/easy_my_coop_report.xml new file mode 100644 index 00000000..42df36aa --- /dev/null +++ b/foodhub_munich_custom/report/easy_my_coop_report.xml @@ -0,0 +1,13 @@ + + + + + + diff --git a/foodhub_munich_custom/static/description/index.html b/foodhub_munich_custom/static/description/index.html new file mode 100644 index 00000000..52dc74c5 --- /dev/null +++ b/foodhub_munich_custom/static/description/index.html @@ -0,0 +1,414 @@ + + + + + + +Foodhub Munich Custom + + + +
+

Foodhub Munich Custom

+ + +

Beta License: AGPL-3 coopiteasy/cie-custom

+

Foodhub Munich customizations

+

Table of contents

+ +
+

Bug Tracker

+

Bugs are tracked on GitHub Issues. +In case of trouble, please check there if your issue has already been reported. +If you spotted it first, help us smashing it by providing a detailed and welcomed +feedback.

+

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

+
+
+

Credits

+
+

Authors

+
    +
  • Coop IT Easy SCRL fs
  • +
+
+
+

Contributors

+ +
+
+

Maintainers

+

This module is part of the coopiteasy/cie-custom project on GitHub.

+

You are welcome to contribute.

+
+
+
+ +