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