[ADD]GOLEM Member UTM module : allow origin for res.partner

This commit is contained in:
Fabien BOURGEOIS 2018-08-27 10:40:51 +02:00
parent 8318ac4fcf
commit 64c1fd4773
8 changed files with 284 additions and 0 deletions

View File

@ -0,0 +1,18 @@
# -*- coding: utf-8 -*-
# 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/>.
from . import models

View File

@ -0,0 +1,32 @@
# -*- coding: utf-8 -*-
# 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/>.
{
'name': 'GOLEM Member UTM',
'summary': 'GOLEM Member UTM',
'description': '''GOLEM Member UTM :
* add source for all partners (so for members / service users).''',
'version': '10.0.0.1.0',
'category': 'GOLEM',
'author': 'Fabien Bourgeois',
'license': 'AGPL-3',
'application': False,
'installable': True,
'depends': ['golem_member', 'utm'],
'data': ['views/golem_member_views.xml',
'views/res_partner_views.xml'],
}

View File

@ -0,0 +1,40 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * golem_member_utm
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 10.0\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2018-08-27 08:39+0000\n"
"PO-Revision-Date: 2018-08-27 10:40+0200\n"
"Last-Translator: <>\n"
"Language-Team: \n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: \n"
"Plural-Forms: \n"
#. module: golem_member_utm
#: model:ir.ui.view,arch_db:golem_member_utm.golem_member_search_inherit_skills
#: model:ir.ui.view,arch_db:golem_member_utm.res_partner_search_inherit_golem_member_utm
msgid "By source"
msgstr "Par origine"
#. module: golem_member_utm
#: model:ir.model,name:golem_member_utm.model_res_partner
msgid "Partner"
msgstr "Contact"
#. module: golem_member_utm
#: model:ir.ui.menu,name:golem_member_utm.golem_member_utm_source_menu
msgid "Service user sources"
msgstr "Origines des usagers"
#. module: golem_member_utm
#: model:ir.model.fields,field_description:golem_member_utm.field_golem_member_source_id
#: model:ir.model.fields,field_description:golem_member_utm.field_res_partner_source_id
#: model:ir.model.fields,field_description:golem_member_utm.field_res_users_source_id
msgid "Source"
msgstr "Origine"

View File

@ -0,0 +1,40 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * golem_member_utm
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 10.0\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2018-08-27 08:39+0000\n"
"PO-Revision-Date: 2018-08-27 08:39+0000\n"
"Last-Translator: <>\n"
"Language-Team: \n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: \n"
"Plural-Forms: \n"
#. module: golem_member_utm
#: model:ir.ui.view,arch_db:golem_member_utm.golem_member_search_inherit_skills
#: model:ir.ui.view,arch_db:golem_member_utm.res_partner_search_inherit_golem_member_utm
msgid "By source"
msgstr ""
#. module: golem_member_utm
#: model:ir.model,name:golem_member_utm.model_res_partner
msgid "Partner"
msgstr ""
#. module: golem_member_utm
#: model:ir.ui.menu,name:golem_member_utm.golem_member_utm_source_menu
msgid "Service user sources"
msgstr ""
#. module: golem_member_utm
#: model:ir.model.fields,field_description:golem_member_utm.field_golem_member_source_id
#: model:ir.model.fields,field_description:golem_member_utm.field_res_partner_source_id
#: model:ir.model.fields,field_description:golem_member_utm.field_res_users_source_id
msgid "Source"
msgstr ""

View File

@ -0,0 +1,18 @@
# -*- coding: utf-8 -*-
# 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/>.
from . import res_partner

View File

@ -0,0 +1,27 @@
# -*- coding: utf-8 -*-
# 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/>.
""" Partner adaptations """
from odoo import models, fields
class Partner(models.Model):
""" Partner adaptations """
_inherit = 'res.partner'
source_id = fields.Many2one('utm.source', 'Source',
index=True, auto_join=True)

View File

@ -0,0 +1,57 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
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>
<!-- Form -->
<record model="ir.ui.view" id="golem_member_form_inherit_skills">
<field name="name">Member Form adaptations</field>
<field name="model">golem.member</field>
<field name="inherit_id" ref="golem_member.golem_member_form" />
<field name="arch" type="xml">
<field name="comment" position="before">
<field name="source_id" />
</field>
</field>
</record>
<!-- Searches -->
<record model="ir.ui.view" id="golem_member_search_inherit_skills">
<field name="name">Member Search adaptations</field>
<field name="model">golem.member</field>
<field name="inherit_id" ref="golem_member.golem_member_search" />
<field name="arch" type="xml">
<field name="email" position="after">
<field name="source_id" />
</field>
<filter name="group_city" position="after">
<filter name="group_source" string="By source"
context="{'group_by': 'source_id'}" />
</filter>
</field>
</record>
<!-- Menus -->
<menuitem id="golem_member_utm_source_menu" name="Service user sources"
parent="golem_membership.menu_config_association" sequence="50"
action="utm.utm_source_action" />
</data>
</odoo>

View File

@ -0,0 +1,52 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
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>
<!-- Form -->
<record model="ir.ui.view" id="res_partner_form_inherit_golem_member_utm">
<field name="name">Partner Form adaptations</field>
<field name="model">res.partner</field>
<field name="inherit_id" ref="base.view_partner_form" />
<field name="arch" type="xml">
<field name="user_id" position="after">
<field name="source_id" />
</field>
</field>
</record>
<!-- Searches -->
<record model="ir.ui.view" id="res_partner_search_inherit_golem_member_utm">
<field name="name">Partner Search 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="user_id" position="after">
<field name="source_id" />
</field>
<filter name="group_country" position="after">
<filter name="group_source" string="By source"
context="{'group_by': 'source_id'}" />
</filter>
</field>
</record>
</data>
</odoo>