Browse Source

[MIG][IMP]GOLEM member skils migration to v10, and better guidelines

stable
Fabien BOURGEOIS 3 years ago
parent
commit
bccf22aa3f
7 changed files with 32 additions and 19 deletions
  1. +0
    -0
      golem_activity_registration/views/golem_activity_registration_views.xml
  2. +0
    -0
      golem_activity_registration/views/golem_activity_views.xml
  3. +0
    -0
      golem_activity_registration/views/golem_member_views.xml
  4. +2
    -2
      golem_member_skills/__manifest__.py
  5. +8
    -3
      golem_member_skills/models/golem_member.py
  6. +16
    -11
      golem_member_skills/views/golem_member_views.xml
  7. +6
    -3
      golem_member_skills/views/res_partner_views.xml

golem_activity_registration/views/golem_activity_registration_view.xml → golem_activity_registration/views/golem_activity_registration_views.xml View File


golem_activity_registration/views/golem_activity_view.xml → golem_activity_registration/views/golem_activity_views.xml View File


golem_activity_registration/views/golem_member_view.xml → golem_activity_registration/views/golem_member_views.xml View File


+ 2
- 2
golem_member_skills/__manifest__.py View File

@@ -23,8 +23,8 @@
'author': 'Fabien Bourgeois',
'license': 'AGPL-3',
'application': False,
'installable': False,
'installable': True,
'depends': ['golem_member'],
'data': ['views/golem_member_view.xml', 'views/res_partner_view.xml',
'data': ['views/golem_member_views.xml', 'views/res_partner_views.xml',
'security/ir.model.access.csv']
}

+ 8
- 3
golem_member_skills/models/golem_member.py View File

@@ -1,6 +1,6 @@
# -*- coding: utf-8 -*-

# Copyright 2016 Fabien Bourgeois <fabien@yaltik.com>
# Copyright 2017 Fabien Bourgeois <fabien@yaltik.com>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
@@ -15,21 +15,26 @@
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.

""" GOLEM Member Skills """

from odoo import models, fields


class ResPartner(models.Model):
""" Partner adaptations """
_inherit = 'res.partner'

is_volunteer = fields.Boolean('Volunteer?')
skill_ids = fields.Many2many('golem.member.skill', string='Skills')
skill_ids = fields.Many2many('golem.member.skill', string='Skills',
index=True)


class GolemMemberSkill(models.Model):
""" Member adaptations """
_name = 'golem.member.skill'
_description = 'GOLEM Member Skill'

_sql_constraints = [('golem_member_skill_name_uniq', 'UNIQUE (name)',
'Member skill must be unique.')]

name = fields.Char('Skill')
name = fields.Char('Skill', required=True, index=True)

+ 16
- 11
golem_member_skills/views/golem_member_views.xml View File

@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>

<!--
Copyright 2016 Fabien Bourgeois <fabien@yaltik.com>
Copyright 2017 Fabien Bourgeois <fabien@yaltik.com>

This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as published by
@@ -19,11 +19,12 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.

<odoo>
<data>

<!-- Form -->
<record model="ir.ui.view" id="golem_member_skills_form">
<record model="ir.ui.view" id="golem_member_form_inherit_skills">
<field name="name">Add skills to Others tab</field>
<field name="model">golem.member</field>
<field name="inherit_id" ref="golem_member.view_form" />
<field name="inherit_id" ref="golem_member.golem_member_form" />
<field name="arch" type="xml">
<field name="comment" position="before">
<field name="is_volunteer" />
@@ -32,11 +33,12 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
</field>
</field>
</record>

<!-- Searches -->
<record model="ir.ui.view" id="golem_member_skills_search">
<record model="ir.ui.view" id="golem_member_search_inherit_skills">
<field name="name">Add Skills Search and Filter</field>
<field name="model">golem.member</field>
<field name="inherit_id" ref="golem_member.view_filter" />
<field name="inherit_id" ref="golem_member.golem_member_search" />
<field name="arch" type="xml">
<field name="email" position="after">
<field name="skill_ids" widget="many2one" />
@@ -45,23 +47,26 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
</field>
</field>
</record>

<!-- Tree -->
<record id="skill_tree" model="ir.ui.view">
<record id="golem_member_skill_tree" model="ir.ui.view">
<field name="name">Member skills</field>
<field name="model">golem.member.skill</field>
<field name="arch" type="xml">
<tree editable="top"><field name="name"/></tree>
</field>
</record>

<!-- Actions -->
<act_window id="skills_action_list" name="GOLEM Member Skills"
<act_window id="golem_member_skill_action" name="GOLEM Member Skills"
res_model="golem.member.skill" />

<!-- Menus -->
<menuitem id="skill_menu_list"
<menuitem id="golem_member_skill_menu"
name="Member skills"
parent="base.menu_marketing_config_association"
action="skills_action_list"
sequence="5" groups="golem_base.group_golem_manager" />
parent="membership.menu_marketing_config_association"
action="golem_member_skill_action"
sequence="15" groups="golem_base.group_golem_manager" />

</data>
</odoo>

+ 6
- 3
golem_member_skills/views/res_partner_views.xml View File

@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>

<!--
Copyright 2016 Fabien Bourgeois <fabien@yaltik.com>
Copyright 2017 Fabien Bourgeois <fabien@yaltik.com>

This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as published by
@@ -19,8 +19,9 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.

<odoo>
<data>

<!-- Form -->
<record model="ir.ui.view" id="res_partner_skills_form">
<record model="ir.ui.view" id="res_partner_form_inherit_skills">
<field name="name">Add skills as new tab inside notebook</field>
<field name="model">res.partner</field>
<field name="inherit_id" ref="base.view_partner_form" />
@@ -36,8 +37,9 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
</notebook>
</field>
</record>

<!-- Search -->
<record model="ir.ui.view" id="res_partner_skills_search">
<record model="ir.ui.view" id="res_partner_search_inherit_skills">
<field name="name">Add Skills Search and Filter</field>
<field name="model">res.partner</field>
<field name="inherit_id" ref="base.view_res_partner_filter" />
@@ -49,5 +51,6 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
</field>
</field>
</record>

</data>
</odoo>

Loading…
Cancel
Save