Browse Source

[TASK 0044_b] Gestion des shifts : visualiser le créneau sur la fiche du membre régulier + [ADD] Tab worker information for all information linked with the work in the cooperative + [ADD] share type for beescoop + [ADD] Specific module that make the link between beesdoo and easy_my_coop : compute the share_type base on the share bought

pull/134/head
Thibault Francois 7 years ago
committed by Rémy Taymans
parent
commit
b40e25eccb
  1. 2
      beesdoo_easy_my_coop/__init__.py
  2. 30
      beesdoo_easy_my_coop/__openerp__.py
  3. 23
      beesdoo_easy_my_coop/data/product_share.xml
  4. 1
      beesdoo_easy_my_coop/models/__init__.py
  5. 14
      beesdoo_easy_my_coop/models/res_partner.py

2
beesdoo_easy_my_coop/__init__.py

@ -0,0 +1,2 @@
# -*- coding: utf-8 -*-
import models

30
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
}

23
beesdoo_easy_my_coop/data/product_share.xml

@ -0,0 +1,23 @@
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<data noupdate="1">
<record id="share_a" model="product.template" >
<field name="name">Acquisition de parts A de Beescoop scrl</field>
<field name="default_code">share_a</field>
<field name="customer" eval="True" />
<field name="is_share" eval="True" />
</record>
<record id="share_b" model="product.template" >
<field name="name">Acquisition de parts B de Beescoop scrl</field>
<field name="default_code">share_b</field>
<field name="customer" eval="True" />
<field name="is_share" eval="True" />
</record>
<record id="share_c" model="product.template" >
<field name="name">Acquisition de parts C de Beescoop scrl</field>
<field name="default_code">share_c</field>
<field name="customer" eval="False" />
<field name="is_share" eval="True" />
</record>
</data>
</odoo>

1
beesdoo_easy_my_coop/models/__init__.py

@ -0,0 +1 @@
import res_partner

14
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 ''
Loading…
Cancel
Save