diff --git a/beesdoo_base/models/partner.py b/beesdoo_base/models/partner.py index 3d1a2cb..967ac33 100644 --- a/beesdoo_base/models/partner.py +++ b/beesdoo_base/models/partner.py @@ -20,6 +20,7 @@ class Partner(models.Model): member_card_to_be_printed = fields.Boolean('Print BEES card?') last_printed = fields.Datetime('Last printed on') + share_type = fields.Selection([('share_a', 'Share A'), ('share_b', 'Share B'), ('share_c', 'Share C')]) @api.onchange('first_name', 'last_name') diff --git a/beesdoo_base/views/partner.xml b/beesdoo_base/views/partner.xml index 2aa5510..a14b74f 100644 --- a/beesdoo_base/views/partner.xml +++ b/beesdoo_base/views/partner.xml @@ -27,14 +27,17 @@ default_focus="1" /> + + + + - @@ -63,6 +66,7 @@ type="action" /> + {'invisible' : [('eater', '!=', diff --git a/beesdoo_easy_my_coop/__init__.py b/beesdoo_easy_my_coop/__init__.py new file mode 100644 index 0000000..0f7cb6b --- /dev/null +++ b/beesdoo_easy_my_coop/__init__.py @@ -0,0 +1,2 @@ +# -*- coding: utf-8 -*- +import models \ No newline at end of file diff --git a/beesdoo_easy_my_coop/__openerp__.py b/beesdoo_easy_my_coop/__openerp__.py new file mode 100644 index 0000000..9e17648 --- /dev/null +++ b/beesdoo_easy_my_coop/__openerp__.py @@ -0,0 +1,30 @@ +# -*- coding: utf-8 -*- +{ + '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", + + # Categories can be used to filter modules in modules listing + # Check https://github.com/odoo/odoo/blob/master/openerp/addons/base/module/module_data.xml + # for the full list + 'category': 'Cooperative management', + 'version': '1.0', + + # any module necessary for this one to work correctly + 'depends': ['beesdoo_base', 'beesdoo_shift', 'easy_my_coop'], + + # always loaded + 'data': [ + 'data/product_share.xml', + ], + # only loaded in demonstration mode +} + 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..f6dfb12 --- /dev/null +++ b/beesdoo_easy_my_coop/models/__init__.py @@ -0,0 +1 @@ +import res_partner \ No newline at end of file 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..c007247 --- /dev/null +++ b/beesdoo_easy_my_coop/models/res_partner.py @@ -0,0 +1,14 @@ +# -*- coding: utf-8 -*- +from openerp import models, fields, api, _ + +class Partner(models.Model): + _inherit = 'res.partner' + + share_type = fields.Selection(compute='_get_share_product_type') + + @api.multi + @api.depends('share_ids', 'share_ids.share_product_id', 'share_ids.share_product_id.default_code') + def _get_share_product_type(self): + for rec in self: + codes = rec.share_ids.mapped('share_product_id.default_code') + rec.share_type = codes[0] if codes else '' \ No newline at end of file diff --git a/beesdoo_shift/models/cooperative_status.py b/beesdoo_shift/models/cooperative_status.py index 2524e51..69ebd85 100644 --- a/beesdoo_shift/models/cooperative_status.py +++ b/beesdoo_shift/models/cooperative_status.py @@ -44,7 +44,7 @@ class ResPartner(models.Model): info_session = fields.Boolean(related='cooperative_status_ids.info_session', string='Information Session ?', readonly=True, store=True) info_session_date = fields.Datetime(related='cooperative_status_ids.info_session_date', string='Information Session Date', readonly=True, store=True) working_mode = fields.Selection(related='cooperative_status_ids.working_mode', readonly=True, store=True) - + subscribed_shift_ids = fields.Many2many('beesdoo.shift.template') @api.multi def coop_subscribe(self): return { diff --git a/beesdoo_shift/views/cooperative_status.xml b/beesdoo_shift/views/cooperative_status.xml index 1ed1bdc..a9314a0 100644 --- a/beesdoo_shift/views/cooperative_status.xml +++ b/beesdoo_shift/views/cooperative_status.xml @@ -8,18 +8,24 @@
- - - - - - - - + + + + + + + + + + + + + +