diff --git a/beesdoo_easy_my_coop/__init__.py b/beesdoo_easy_my_coop/__init__.py
new file mode 100644
index 0000000..4ba7940
--- /dev/null
+++ b/beesdoo_easy_my_coop/__init__.py
@@ -0,0 +1,3 @@
+from . import models
+from . import wizards
+from . import controllers
diff --git a/beesdoo_easy_my_coop/__manifest__.py b/beesdoo_easy_my_coop/__manifest__.py
new file mode 100644
index 0000000..8a1708a
--- /dev/null
+++ b/beesdoo_easy_my_coop/__manifest__.py
@@ -0,0 +1,34 @@
+{
+ 'name': "Beescoop link with easy my coop",
+
+ 'summary': """
+ Module that made the link between beesdoo customization
+ and easy_my_coop
+ """,
+
+ 'description': """
+ """,
+
+ 'author': "Beescoop - Cellule IT",
+ 'website': "https://github.com/beescoop/Obeesdoo",
+
+ 'category': 'Cooperative management',
+ 'version': '12.0.1.0.0',
+
+ 'depends': ['beesdoo_base',
+ 'beesdoo_shift',
+ 'easy_my_coop',
+ 'easy_my_coop_eater',
+ 'easy_my_coop_website',
+ ],
+
+ 'data': [
+ 'data/product_share.xml',
+ 'views/partner.xml',
+ 'views/res_company.xml',
+ 'views/subscription_request.xml',
+ 'views/subscription_templates.xml',
+ 'views/product.xml'
+ ],
+ 'auto_install': True,
+}
diff --git a/beesdoo_easy_my_coop/controllers/__init__.py b/beesdoo_easy_my_coop/controllers/__init__.py
new file mode 100644
index 0000000..12a7e52
--- /dev/null
+++ b/beesdoo_easy_my_coop/controllers/__init__.py
@@ -0,0 +1 @@
+from . import main
diff --git a/beesdoo_easy_my_coop/controllers/main.py b/beesdoo_easy_my_coop/controllers/main.py
new file mode 100644
index 0000000..5e1cff4
--- /dev/null
+++ b/beesdoo_easy_my_coop/controllers/main.py
@@ -0,0 +1,19 @@
+from odoo import http
+from odoo.http import request
+
+from odoo.addons.easy_my_coop_website.controllers.main import WebsiteSubscription as Base
+
+class WebsiteSubscription(Base):
+
+ def fill_values(self, values, is_company, logged, load_from_user=False):
+ values = super(WebsiteSubscription, self).fill_values(values,
+ is_company,
+ logged,
+ load_from_user)
+ cmp = request.env['res.company']._company_default_get()
+ values.update({
+ 'display_info_session': cmp.display_info_session_confirmation,
+ 'info_session_required': cmp.info_session_confirmation_required,
+ 'info_session_text': cmp.info_session_confirmation_text,
+ })
+ return values
diff --git a/beesdoo_easy_my_coop/data/product_share.xml b/beesdoo_easy_my_coop/data/product_share.xml
new file mode 100644
index 0000000..50db413
--- /dev/null
+++ b/beesdoo_easy_my_coop/data/product_share.xml
@@ -0,0 +1,23 @@
+
+
+
+
+ Acquisition de parts A de Beescoop scrl
+ share_a
+
+
+
+
+ Acquisition de parts B de Beescoop scrl
+ share_b
+
+
+
+
+ Acquisition de parts C de Beescoop scrl
+ share_c
+
+
+
+
+
\ No newline at end of file
diff --git a/beesdoo_easy_my_coop/models/__init__.py b/beesdoo_easy_my_coop/models/__init__.py
new file mode 100644
index 0000000..e856cc7
--- /dev/null
+++ b/beesdoo_easy_my_coop/models/__init__.py
@@ -0,0 +1,4 @@
+from . import res_partner
+from . import subscription_request
+from . import res_company
+from . import product
diff --git a/beesdoo_easy_my_coop/models/product.py b/beesdoo_easy_my_coop/models/product.py
new file mode 100644
index 0000000..35fc68f
--- /dev/null
+++ b/beesdoo_easy_my_coop/models/product.py
@@ -0,0 +1,8 @@
+from odoo import models, fields
+
+
+class ProductTemplate(models.Model):
+
+ _inherit = 'product.template'
+
+ can_shop = fields.Boolean(string="Is share?")
diff --git a/beesdoo_easy_my_coop/models/res_company.py b/beesdoo_easy_my_coop/models/res_company.py
new file mode 100644
index 0000000..7be05ce
--- /dev/null
+++ b/beesdoo_easy_my_coop/models/res_company.py
@@ -0,0 +1,35 @@
+# Copyright 2019 Coop IT Easy SCRLfs
+# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
+
+from odoo import api, fields, models, _
+
+
+class ResCompany(models.Model):
+
+ _inherit = 'res.company'
+ display_info_session_confirmation = fields.Boolean(
+ help="Choose to display a info session checkbox on the cooperator"
+ " website form."
+ )
+ info_session_confirmation_required = fields.Boolean(
+ string="Is info session confirmation required?"
+ )
+ info_session_confirmation_text = fields.Html(
+ translate=True,
+ help="Text to display aside the checkbox to confirm"
+ " participation to an info session."
+ )
+
+ @api.onchange('info_session_confirmation_required')
+ def onchange_info_session_confirmatio_required(self):
+ if self.info_session_confirmation_required:
+ self.display_info_session_confirmation = True
+
+ _sql_constraints = [(
+ 'info_session_approval_constraint',
+ """CHECK ((info_session_confirmation_required=FALSE
+ AND display_info_session_confirmation=FALSE)
+ OR display_info_session_confirmation=TRUE)
+ """,
+ "Approval can't be mandatory and not displayed."
+ )]
diff --git a/beesdoo_easy_my_coop/models/res_partner.py b/beesdoo_easy_my_coop/models/res_partner.py
new file mode 100644
index 0000000..6960c5a
--- /dev/null
+++ b/beesdoo_easy_my_coop/models/res_partner.py
@@ -0,0 +1,28 @@
+from odoo import models, fields, api
+
+
+class Partner(models.Model):
+ _inherit = 'res.partner'
+
+ can_shop = fields.Boolean(compute='_can_shop', store=True)
+ info_session_confirmed = fields.Boolean(
+ string="Confirmed presence to info session",
+ default=False,
+ )
+
+ @api.depends('cooperator_type',
+ 'cooperative_status_ids',
+ 'cooperative_status_ids.can_shop')
+ def _can_shop(self):
+ product_obj = self.env['product.template']
+ can_shop_shares = product_obj.search([('is_share', '=', True),
+ ('can_shop', '=', True)
+ ]).mapped('default_code')
+ for rec in self:
+ if rec.cooperator_type in can_shop_shares:
+ rec.can_shop = True
+ elif (rec.cooperative_status_ids
+ and rec.cooperative_status_ids[0].can_shop):
+ rec.can_shop = True
+ else:
+ rec.can_shop = False
diff --git a/beesdoo_easy_my_coop/models/subscription_request.py b/beesdoo_easy_my_coop/models/subscription_request.py
new file mode 100644
index 0000000..8c4b734
--- /dev/null
+++ b/beesdoo_easy_my_coop/models/subscription_request.py
@@ -0,0 +1,26 @@
+# Copyright 2019 Coop IT Easy SCRLfs
+# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
+
+from odoo import api, fields, models, _
+
+
+class SubscriptionRequest(models.Model):
+
+ _inherit = 'subscription.request'
+
+ info_session_confirmed = fields.Boolean(
+ string="Confirmed Info Session",
+ default=False,
+ )
+
+ def get_partner_vals(self):
+ partner_vals = super(SubscriptionRequest, self).get_partner_vals()
+ partner_vals['info_session_confirmed'] = self.info_session_confirmed
+ return partner_vals
+
+ def get_required_field(self):
+ required_fields = super(SubscriptionRequest, self).get_required_field()
+ company = self.env['res.company']._company_default_get()
+ if company.info_session_confirmation_required:
+ required_fields.append('info_session_confirmed')
+ return required_fields
diff --git a/beesdoo_easy_my_coop/views/partner.xml b/beesdoo_easy_my_coop/views/partner.xml
new file mode 100644
index 0000000..b523166
--- /dev/null
+++ b/beesdoo_easy_my_coop/views/partner.xml
@@ -0,0 +1,30 @@
+
+
+
+ beesdoo.partner.form.view.remove_duplicate_cooperator_type
+ res.partner
+
+
+
+
+
+
+
+
diff --git a/beesdoo_easy_my_coop/views/product.xml b/beesdoo_easy_my_coop/views/product.xml
new file mode 100644
index 0000000..6316bae
--- /dev/null
+++ b/beesdoo_easy_my_coop/views/product.xml
@@ -0,0 +1,13 @@
+
+
+
+ product.template.share.form
+ product.template
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/beesdoo_easy_my_coop/views/res_company.xml b/beesdoo_easy_my_coop/views/res_company.xml
new file mode 100644
index 0000000..daa8557
--- /dev/null
+++ b/beesdoo_easy_my_coop/views/res_company.xml
@@ -0,0 +1,20 @@
+
+
+
+
+
+
+ res.company.form (in beesdoo_easy_my_coop)
+ res.company
+
+
+
+
+
+
+
+
+
+
+
diff --git a/beesdoo_easy_my_coop/views/subscription_request.xml b/beesdoo_easy_my_coop/views/subscription_request.xml
new file mode 100644
index 0000000..1b75719
--- /dev/null
+++ b/beesdoo_easy_my_coop/views/subscription_request.xml
@@ -0,0 +1,18 @@
+
+
+
+
+
+
+ subscription.request.form (in beesdoo_easy_my_coop)
+ subscription.request
+
+
+
+
+
+
+
+
+
diff --git a/beesdoo_easy_my_coop/views/subscription_templates.xml b/beesdoo_easy_my_coop/views/subscription_templates.xml
new file mode 100644
index 0000000..44fd0e8
--- /dev/null
+++ b/beesdoo_easy_my_coop/views/subscription_templates.xml
@@ -0,0 +1,28 @@
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/beesdoo_easy_my_coop/wizards/__init__.py b/beesdoo_easy_my_coop/wizards/__init__.py
new file mode 100644
index 0000000..eb54c76
--- /dev/null
+++ b/beesdoo_easy_my_coop/wizards/__init__.py
@@ -0,0 +1 @@
+from . import beesdoo_shift_subscribe
diff --git a/beesdoo_easy_my_coop/wizards/beesdoo_shift_subscribe.py b/beesdoo_easy_my_coop/wizards/beesdoo_shift_subscribe.py
new file mode 100644
index 0000000..7cc79f5
--- /dev/null
+++ b/beesdoo_easy_my_coop/wizards/beesdoo_shift_subscribe.py
@@ -0,0 +1,24 @@
+# Copyright 2019 Coop IT Easy SCRLfs
+# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
+
+from odoo import api, fields, models, _
+
+
+class Subscribe(models.TransientModel):
+
+ _inherit = 'beesdoo.shift.subscribe'
+
+ def _get_info_session_followed(self):
+ """
+ Check if the user has checked the info_session_confirmed in the
+ form to become new cooperator.
+ """
+ followed = super(Subscribe, self)._get_info_session_followed()
+ if not followed:
+ return (self.env['res.partner']
+ .browse(self._context.get('active_id'))
+ .info_session_confirmed)
+ return followed
+
+ info_session = fields.Boolean(default=_get_info_session_followed)
+