[ADD]GOLEM PCS : move to partner, add on partner forms

This commit is contained in:
Fabien BOURGEOIS 2018-09-24 16:07:47 +02:00
parent 518749b78f
commit d00462aa41
4 changed files with 54 additions and 5 deletions

View File

@ -27,5 +27,6 @@
'installable': True,
'depends': ['golem_member'],
'data': ['views/golem_member_views.xml',
'views/res_partner_views.xml',
'data/golem_pcs_data.xml']
}

View File

@ -16,4 +16,4 @@
# 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/>.
from . import golem_member, golem_pcs
from . import res_partner, golem_pcs

View File

@ -16,13 +16,13 @@
# 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 adaptations """
""" Partner adaptations """
from odoo import models, fields
class GolemMember(models.Model):
""" GOLEM Member extention """
_inherit = 'golem.member'
class ResPartner(models.Model):
""" Partner extention """
_inherit = 'res.partner'
pcs_id = fields.Many2one('golem.pcs', string='PCS', index=True,
help='Professions and Socioprofessional Categories')

View File

@ -0,0 +1,48 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
Copyright 2018 Youssef El Ouahby <youssef@yaltik.com>
Copyright 2018 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
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Affero General Public License for more details.
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/>.
-->
<odoo>
<data>
<!-- Forms -->
<record model="ir.ui.view" id="res_partner_form_inherit_golem_pcs">
<field name="name">Partner Form PCS adaptations</field>
<field name="model">res.partner</field>
<field name="inherit_id" ref="base.view_partner_form" />
<field name="arch" type="xml">
<field name='function' position='after'>
<field name='pcs_id' options="{'no_create':True}" />
</field>
</field>
</record>
<!-- Search -->
<record model="ir.ui.view" id="view_partner_search_inherit_golem_pcs">
<field name="name">Partner Search PCS adaptations</field>
<field name="model">res.partner</field>
<field name="inherit_id" ref="base.view_res_partner_filter" />
<field name="arch" type="xml">
<field name='category_id' position='after'>
<field name='pcs_id' />
</field>
</field>
</record>
</data>
</odoo>