diff --git a/addons/community_benefits/static/description/banner.png b/addons/community_benefits/static/description/banner.png new file mode 100644 index 0000000..73fb7a1 Binary files /dev/null and b/addons/community_benefits/static/description/banner.png differ diff --git a/addons/community_benefits/static/description/icon.png b/addons/community_benefits/static/description/icon.png new file mode 100644 index 0000000..2357f2c Binary files /dev/null and b/addons/community_benefits/static/description/icon.png differ diff --git a/addons/community_classifieds/static/description/banner.png b/addons/community_classifieds/static/description/banner.png new file mode 100644 index 0000000..01bf820 Binary files /dev/null and b/addons/community_classifieds/static/description/banner.png differ diff --git a/addons/community_classifieds/static/description/icon.png b/addons/community_classifieds/static/description/icon.png new file mode 100644 index 0000000..11404c2 Binary files /dev/null and b/addons/community_classifieds/static/description/icon.png differ diff --git a/addons/community_interac/static/description/banner.png b/addons/community_interac/static/description/banner.png new file mode 100644 index 0000000..a3a1679 Binary files /dev/null and b/addons/community_interac/static/description/banner.png differ diff --git a/addons/community_interac/static/description/icon.png b/addons/community_interac/static/description/icon.png new file mode 100644 index 0000000..8c442c6 Binary files /dev/null and b/addons/community_interac/static/description/icon.png differ diff --git a/addons/community_membership/data/mail_templates.xml b/addons/community_membership/data/mail_templates.xml index 77f6f43..1eadbbf 100644 --- a/addons/community_membership/data/mail_templates.xml +++ b/addons/community_membership/data/mail_templates.xml @@ -65,5 +65,79 @@ + + Membership: Application Received + + Your {{ object.membership_org_name or 'organization' }} membership application has been received + {{ object.id }} + {{ object.lang }} + + +
+

Dear Applicant,

+

+ Thank you for applying for membership with ! +

+

+ Selected Plan: +

+

+ Your application is currently under review by the Board of Directors. You will be notified as soon as a decision is made. +

+

Thank you for your interest and support!

+
+
+
+ + + Membership: Application Approved + + Welcome! Your {{ object.membership_org_name or 'organization' }} membership has been approved + {{ object.id }} + {{ object.lang }} + + +
+

Dear Member,

+

+ We are pleased to inform you that your membership application for + + with has been approved by the Board of Directors! +

+ +

Your Member ID:

+
+

You can access your member portal and download your digital membership card by logging in at our website.

+

Welcome to our community!

+
+
+
+ + + Membership: Application Rejected + + Update on your {{ object.membership_org_name or 'organization' }} membership application + {{ object.id }} + {{ object.lang }} + + +
+

Dear Applicant,

+

+ Thank you for your interest in joining . +

+

+ After careful review, the Board of Directors was unable to approve your application at this time. +

+

+ If any fees were paid during application submission, a full refund will be processed promptly. +

+

+ If you have questions or believe this was in error, please contact our support team. +

+
+
+
+ diff --git a/addons/community_membership/models/membership_tier.py b/addons/community_membership/models/membership_tier.py index 8ed1e50..746839a 100644 --- a/addons/community_membership/models/membership_tier.py +++ b/addons/community_membership/models/membership_tier.py @@ -88,14 +88,16 @@ class CommunityMembershipTier(models.Model): def _membership_product_values(self): self.ensure_one() - return { + vals = { 'name': self.name, 'list_price': self.price, 'type': 'service', 'sale_ok': True, 'purchase_ok': False, - 'invoice_policy': 'order', } + if 'invoice_policy' in self.env['product.product']._fields: + vals['invoice_policy'] = 'order' + return vals def _create_membership_product(self): self.ensure_one() diff --git a/addons/community_membership/models/res_partner.py b/addons/community_membership/models/res_partner.py index 9ba2e66..09744cc 100644 --- a/addons/community_membership/models/res_partner.py +++ b/addons/community_membership/models/res_partner.py @@ -128,10 +128,31 @@ class ResPartner(models.Model): def action_approve_membership(self): self.write({'membership_approval_state': 'approved'}) + template = self.env.ref('community_membership.mail_template_membership_approved', raise_if_not_found=False) + for partner in self: + if partner.membership_state in ('none', 'invoiced') and partner.membership_tier_id: + partner.action_activate_membership() + if template and partner.email: + template.send_mail(partner.id, force_send=True) + if hasattr(partner, 'message_post'): + partner.message_post(body=_("Membership application approved by the Board of Directors.")) return True def action_reject_membership(self): self.write({'membership_approval_state': 'rejected'}) + template = self.env.ref('community_membership.mail_template_membership_rejected', raise_if_not_found=False) + for partner in self: + draft_invoices = self.env['account.move'].sudo().search([ + ('partner_id', '=', partner.id), + ('move_type', '=', 'out_invoice'), + ('state', '=', 'draft'), + ]) + if draft_invoices: + draft_invoices.button_cancel() + if template and partner.email: + template.send_mail(partner.id, force_send=True) + if hasattr(partner, 'message_post'): + partner.message_post(body=_("Membership application rejected by the Board of Directors.")) return True def _compute_membership_org_name(self): diff --git a/addons/community_membership/static/description/banner.png b/addons/community_membership/static/description/banner.png new file mode 100644 index 0000000..d7b29ca Binary files /dev/null and b/addons/community_membership/static/description/banner.png differ diff --git a/addons/community_membership/static/description/icon.png b/addons/community_membership/static/description/icon.png new file mode 100644 index 0000000..fe3d45c Binary files /dev/null and b/addons/community_membership/static/description/icon.png differ diff --git a/addons/community_portal/static/description/banner.png b/addons/community_portal/static/description/banner.png new file mode 100644 index 0000000..1e3e76b Binary files /dev/null and b/addons/community_portal/static/description/banner.png differ diff --git a/addons/community_portal/static/description/icon.png b/addons/community_portal/static/description/icon.png new file mode 100644 index 0000000..31688c1 Binary files /dev/null and b/addons/community_portal/static/description/icon.png differ diff --git a/addons/community_portal/tests/test_portal_dashboard.py b/addons/community_portal/tests/test_portal_dashboard.py index c9d4308..904fcb8 100644 --- a/addons/community_portal/tests/test_portal_dashboard.py +++ b/addons/community_portal/tests/test_portal_dashboard.py @@ -14,7 +14,7 @@ class TestPortalDashboard(HttpCase): def test_portal_home_renders_without_error(self): self.authenticate('admin', 'admin') - response = self.url_open('/my') + response = self.url_open('/my', timeout=30) self.assertEqual(response.status_code, 200) def test_dashboard_only_shows_cards_for_installed_modules(self): @@ -25,7 +25,7 @@ class TestPortalDashboard(HttpCase): ]).mapped('name')) self.authenticate('admin', 'admin') - response = self.url_open('/my') + response = self.url_open('/my', timeout=30) self.assertEqual(response.status_code, 200) content = response.content.decode() diff --git a/addons/community_school/models/school_class.py b/addons/community_school/models/school_class.py index 4e568df..9787b27 100644 --- a/addons/community_school/models/school_class.py +++ b/addons/community_school/models/school_class.py @@ -64,14 +64,16 @@ class CommunitySchoolClass(models.Model): self.ensure_one() if self.fee_product_id: return self.fee_product_id - product = self.env['product.product'].create({ + vals = { 'name': f"School Fee - {self.name}", 'list_price': self.fee, 'type': 'service', 'sale_ok': True, 'purchase_ok': False, - 'invoice_policy': 'order', - }) + } + if 'invoice_policy' in self.env['product.product']._fields: + vals['invoice_policy'] = 'order' + product = self.env['product.product'].create(vals) self.fee_product_id = product.id return product diff --git a/addons/community_school/static/description/banner.png b/addons/community_school/static/description/banner.png new file mode 100644 index 0000000..ab16619 Binary files /dev/null and b/addons/community_school/static/description/banner.png differ diff --git a/addons/community_school/static/description/icon.png b/addons/community_school/static/description/icon.png new file mode 100644 index 0000000..ac42317 Binary files /dev/null and b/addons/community_school/static/description/icon.png differ diff --git a/addons/community_school/views/registration_templates.xml b/addons/community_school/views/registration_templates.xml index 5f30586..ba6234d 100644 --- a/addons/community_school/views/registration_templates.xml +++ b/addons/community_school/views/registration_templates.xml @@ -1,100 +1,539 @@ + + + + + + + +