diff --git a/golem_member/__manifest__.py b/golem_member/__manifest__.py index 5aaa783..86db047 100644 --- a/golem_member/__manifest__.py +++ b/golem_member/__manifest__.py @@ -19,7 +19,7 @@ { 'name': 'GOLEM non-profit members', 'summary': 'Extends Odoo contacts for MJC', - 'version': '10.0.1.1.4', + 'version': '10.0.1.1.5', 'category': 'GOLEM', 'author': 'Fabien Bourgeois, Michel Dessenne', 'license': 'AGPL-3', diff --git a/golem_member/i18n/fr.po b/golem_member/i18n/fr.po index 49e505d..04258d9 100644 --- a/golem_member/i18n/fr.po +++ b/golem_member/i18n/fr.po @@ -6,8 +6,8 @@ msgid "" msgstr "" "Project-Id-Version: Odoo Server 10.0\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2018-03-08 15:11+0000\n" -"PO-Revision-Date: 2018-03-08 15:11+0000\n" +"POT-Creation-Date: 2018-03-27 13:58+0000\n" +"PO-Revision-Date: 2018-03-27 13:58+0000\n" "Last-Translator: <>\n" "Language-Team: \n" "MIME-Version: 1.0\n" @@ -46,11 +46,6 @@ msgstr "Compte client" msgid "Active" msgstr "Actif" -#. module: golem_member -#: model:ir.ui.view,arch_db:golem_member.golem_member_card_template -msgid "Activities" -msgstr "Activités" - #. module: golem_member #: model:ir.ui.view,arch_db:golem_member.golem_member_form msgid "Address" @@ -61,11 +56,6 @@ msgstr "Adresse" msgid "Address Type" msgstr "Type d'adresse" -#. module: golem_member -#: model:ir.ui.view,arch_db:golem_member.golem_member_card_template -msgid "Animator" -msgstr "Intervenant" - #. module: golem_member #: model:ir.ui.view,arch_db:golem_member.golem_member_numberconfig_form msgid "Apply and recompute all member numbers" @@ -319,26 +309,11 @@ msgstr "Date à partir de laquelle l'adhésion devient active." msgid "Date on which membership has been cancelled" msgstr "Date à laquelle l'adhésion a été annulée" -#. module: golem_member -#: model:ir.ui.view,arch_db:golem_member.golem_member_card_template -msgid "Date start" -msgstr "Début" - -#. module: golem_member -#: model:ir.ui.view,arch_db:golem_member.golem_member_card_template -msgid "Date stop" -msgstr "Fin" - #. module: golem_member #: model:ir.model.fields,help:golem_member.field_golem_member_membership_stop msgid "Date until which membership remains active." msgstr "Date jusqu'à laquelle l'adhésion reste active." -#. module: golem_member -#: model:ir.ui.view,arch_db:golem_member.golem_member_card_template -msgid "Day" -msgstr "Jour" - #. module: golem_member #: model:ir.ui.view,arch_db:golem_member.golem_member_search msgid "Default season" @@ -494,16 +469,6 @@ msgstr "Grouper par" msgid "Has unreconciled entries" msgstr "A des écritures non lettrées" -#. module: golem_member -#: model:ir.ui.view,arch_db:golem_member.golem_member_card_template -msgid "Hour start" -msgstr "Début" - -#. module: golem_member -#: model:ir.ui.view,arch_db:golem_member.golem_member_card_template -msgid "Hour stop" -msgstr "Fin" - #. module: golem_member #: model:ir.model.fields,field_description:golem_member.field_golem_member_id #: model:ir.model.fields,field_description:golem_member.field_golem_member_number_id @@ -750,7 +715,6 @@ msgstr "NIC" #. module: golem_member #: model:ir.model.fields,field_description:golem_member.field_golem_member_name #: model:ir.model.fields,field_description:golem_member.field_golem_member_number_name_4186 -#: model:ir.ui.view,arch_db:golem_member.golem_member_card_template msgid "Name" msgstr "Nom" @@ -1112,6 +1076,11 @@ msgstr "Décalage horaire" msgid "Title" msgstr "Civilité" +#. module: golem_member +#: model:ir.ui.menu,name:golem_member.golem_member_tool_menu +msgid "Tools" +msgstr "Outils" + #. module: golem_member #: model:ir.model.fields,field_description:golem_member.field_golem_member_total_invoiced msgid "Total Invoiced" @@ -1137,11 +1106,6 @@ msgstr "Montant total que ce client vous doit." msgid "Total amount you have to pay to this vendor." msgstr "Montant total à payer au fournisseur." -#. module: golem_member -#: model:ir.ui.view,arch_db:golem_member.golem_member_card_template -msgid "Type" -msgstr "Type" - #. module: golem_member #: model:ir.model.fields,help:golem_member.field_golem_member_type msgid "Used to select automatically the right address according to the context in sales and purchases documents." diff --git a/golem_member/i18n/golem_member.pot b/golem_member/i18n/golem_member.pot index edff175..b35ee5a 100644 --- a/golem_member/i18n/golem_member.pot +++ b/golem_member/i18n/golem_member.pot @@ -6,8 +6,8 @@ msgid "" msgstr "" "Project-Id-Version: Odoo Server 10.0\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2018-03-08 15:10+0000\n" -"PO-Revision-Date: 2018-03-08 15:10+0000\n" +"POT-Creation-Date: 2018-03-27 13:57+0000\n" +"PO-Revision-Date: 2018-03-27 13:57+0000\n" "Last-Translator: <>\n" "Language-Team: \n" "MIME-Version: 1.0\n" @@ -45,11 +45,6 @@ msgstr "" msgid "Active" msgstr "" -#. module: golem_member -#: model:ir.ui.view,arch_db:golem_member.golem_member_card_template -msgid "Activities" -msgstr "" - #. module: golem_member #: model:ir.ui.view,arch_db:golem_member.golem_member_form msgid "Address" @@ -60,11 +55,6 @@ msgstr "" msgid "Address Type" msgstr "" -#. module: golem_member -#: model:ir.ui.view,arch_db:golem_member.golem_member_card_template -msgid "Animator" -msgstr "" - #. module: golem_member #: model:ir.ui.view,arch_db:golem_member.golem_member_numberconfig_form msgid "Apply and recompute all member numbers" @@ -318,26 +308,11 @@ msgstr "" msgid "Date on which membership has been cancelled" msgstr "" -#. module: golem_member -#: model:ir.ui.view,arch_db:golem_member.golem_member_card_template -msgid "Date start" -msgstr "" - -#. module: golem_member -#: model:ir.ui.view,arch_db:golem_member.golem_member_card_template -msgid "Date stop" -msgstr "" - #. module: golem_member #: model:ir.model.fields,help:golem_member.field_golem_member_membership_stop msgid "Date until which membership remains active." msgstr "" -#. module: golem_member -#: model:ir.ui.view,arch_db:golem_member.golem_member_card_template -msgid "Day" -msgstr "" - #. module: golem_member #: model:ir.ui.view,arch_db:golem_member.golem_member_search msgid "Default season" @@ -493,16 +468,6 @@ msgstr "" msgid "Has unreconciled entries" msgstr "" -#. module: golem_member -#: model:ir.ui.view,arch_db:golem_member.golem_member_card_template -msgid "Hour start" -msgstr "" - -#. module: golem_member -#: model:ir.ui.view,arch_db:golem_member.golem_member_card_template -msgid "Hour stop" -msgstr "" - #. module: golem_member #: model:ir.model.fields,field_description:golem_member.field_golem_member_id #: model:ir.model.fields,field_description:golem_member.field_golem_member_number_id @@ -743,7 +708,6 @@ msgstr "" #. module: golem_member #: model:ir.model.fields,field_description:golem_member.field_golem_member_name #: model:ir.model.fields,field_description:golem_member.field_golem_member_number_name_4186 -#: model:ir.ui.view,arch_db:golem_member.golem_member_card_template msgid "Name" msgstr "" @@ -1103,6 +1067,11 @@ msgstr "" msgid "Title" msgstr "" +#. module: golem_member +#: model:ir.ui.menu,name:golem_member.golem_member_tool_menu +msgid "Tools" +msgstr "" + #. module: golem_member #: model:ir.model.fields,field_description:golem_member.field_golem_member_total_invoiced msgid "Total Invoiced" @@ -1128,11 +1097,6 @@ msgstr "" msgid "Total amount you have to pay to this vendor." msgstr "" -#. module: golem_member -#: model:ir.ui.view,arch_db:golem_member.golem_member_card_template -msgid "Type" -msgstr "" - #. module: golem_member #: model:ir.model.fields,help:golem_member.field_golem_member_type msgid "Used to select automatically the right address according to the context in sales and purchases documents." diff --git a/golem_member/views/golem_member_views.xml b/golem_member/views/golem_member_views.xml index a1a4b77..cce9e1a 100644 --- a/golem_member/views/golem_member_views.xml +++ b/golem_member/views/golem_member_views.xml @@ -259,6 +259,9 @@ along with this program. If not, see . + +# Copyright 2018 Fabien Bourgeois +# +# 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 . + +from . import models, wizard diff --git a/golem_member_precreation_search/__manifest__.py b/golem_member_precreation_search/__manifest__.py new file mode 100644 index 0000000..492e66d --- /dev/null +++ b/golem_member_precreation_search/__manifest__.py @@ -0,0 +1,31 @@ +# -*- coding: utf-8 -*- + +# Copyright 2018 Youssef El Ouahby +# Copyright 2018 Fabien Bourgeois +# +# 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 . + +{ + 'name': 'GOLEM Pre-creation search member', + 'summary': 'Pre-creation search member', + 'version': '10.0.0.2.0', + 'category': 'GOLEM', + 'author': 'Fabien Bourgeois, Youssef El ouahby', + 'license': 'AGPL-3', + 'application': False, + 'installable': True, + 'depends': ['golem_member'], + 'data': ['views/golem_member_precreation_search_menu.xml', + 'wizard/golem_member_precreation_search_views.xml'] +} diff --git a/golem_member_precreation_search/i18n/fr.po b/golem_member_precreation_search/i18n/fr.po new file mode 100644 index 0000000..79133f8 --- /dev/null +++ b/golem_member_precreation_search/i18n/fr.po @@ -0,0 +1,148 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * golem_member_precreation_search +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 10.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2018-03-27 15:09+0000\n" +"PO-Revision-Date: 2018-03-27 15:09+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_precreation_search +#: model:ir.ui.view,arch_db:golem_member_precreation_search.golem_member_precreation_search_view_form +msgid "Close" +msgstr "Fermer" + +#. module: golem_member_precreation_search +#: model:ir.model.fields,field_description:golem_member_precreation_search.field_golem_member_precreation_search_contact_ids +msgid "Contacts" +msgstr "Contacts" + +#. module: golem_member_precreation_search +#: model:ir.model.fields,field_description:golem_member_precreation_search.field_golem_member_precreation_search_create_uid +msgid "Created by" +msgstr "Créé par" + +#. module: golem_member_precreation_search +#: model:ir.model.fields,field_description:golem_member_precreation_search.field_golem_member_precreation_search_create_date +msgid "Created on" +msgstr "Créé le" + +#. module: golem_member_precreation_search +#: model:ir.model.fields,field_description:golem_member_precreation_search.field_golem_member_precreation_search_display_name +msgid "Display Name" +msgstr "Nom affiché" + +#. module: golem_member_precreation_search +#: selection:golem.member.precreation.search,state:0 +msgid "Final" +msgstr "Final" + +#. module: golem_member_precreation_search +#: model:ir.model,name:golem_member_precreation_search.model_golem_member +msgid "GOLEM Member" +msgstr "Adhérent" + +#. module: golem_member_precreation_search +#: model:ir.model.fields,field_description:golem_member_precreation_search.field_golem_member_precreation_search_id +msgid "ID" +msgstr "ID" + +#. module: golem_member_precreation_search +#: selection:golem.member.precreation.search,state:0 +msgid "Init" +msgstr "Init" + +#. module: golem_member_precreation_search +#: model:ir.model.fields,field_description:golem_member_precreation_search.field_golem_member_precreation_search_keyword +msgid "Keyword" +msgstr "Mot-clé" + +#. module: golem_member_precreation_search +#: model:ir.model.fields,field_description:golem_member_precreation_search.field_golem_member_precreation_search___last_update +msgid "Last Modified on" +msgstr "Dernière Modification le" + +#. module: golem_member_precreation_search +#: model:ir.model.fields,field_description:golem_member_precreation_search.field_golem_member_precreation_search_write_uid +msgid "Last Updated by" +msgstr "Dernière mise à jour par" + +#. module: golem_member_precreation_search +#: model:ir.model.fields,field_description:golem_member_precreation_search.field_golem_member_precreation_search_write_date +msgid "Last Updated on" +msgstr "Dernière mise à jour le" + +#. module: golem_member_precreation_search +#: model:ir.model.fields,field_description:golem_member_precreation_search.field_golem_member_precreation_search_member_ids +msgid "Members" +msgstr "Adhérents" + +#. module: golem_member_precreation_search +#: model:ir.ui.view,arch_db:golem_member_precreation_search.golem_member_precreation_search_view_form +msgid "New search" +msgstr "Nouvelle recherche" + +#. module: golem_member_precreation_search +#: model:ir.ui.view,arch_db:golem_member_precreation_search.golem_member_precreation_search_view_form +msgid "No contact found for the current search." +msgstr "Pas de contact trouvé pour cette recherche." + +#. module: golem_member_precreation_search +#: model:ir.ui.view,arch_db:golem_member_precreation_search.golem_member_precreation_search_view_form +msgid "No member found for the current search." +msgstr "Pas de membre trouvé pour cette recherche." + +#. module: golem_member_precreation_search +#: model:ir.model,name:golem_member_precreation_search.model_res_partner +msgid "Partner" +msgstr "Partenaire" + +#. module: golem_member_precreation_search +#: model:ir.ui.view,arch_db:golem_member_precreation_search.golem_member_precreation_search_view_form +msgid "Please enter a keyword. It will be searched, as case-insensitive, into firstname, lastname and emails." +msgstr "Merci de saisir un mot-clé. Il sera recherché sur les nom, prénom et mail." + +#. module: golem_member_precreation_search +#: code:addons/golem_member_precreation_search/models/res_partner.py:32 +#, python-format +msgid "Please enter contact searched" +msgstr "Merci de saisir la recherche" + +#. module: golem_member_precreation_search +#: model:ir.actions.act_window,name:golem_member_precreation_search.golem_member_precreation_search_action +msgid "Pre-creation contact search" +msgstr "Recherche de contact avant création" + +#. module: golem_member_precreation_search +#: model:ir.ui.view,arch_db:golem_member_precreation_search.golem_member_precreation_search_view_form +msgid "Search Members and Contacts" +msgstr "Rechercher des membres et contacts" + +#. module: golem_member_precreation_search +#: model:ir.ui.menu,name:golem_member_precreation_search.golem_member_precreation_search_menu +msgid "Search for contact before create" +msgstr "Rechercher un contact avant création" + +#. module: golem_member_precreation_search +#: code:addons/golem_member_precreation_search/wizard/golem_member_precreation_search.py:40 +#, python-format +msgid "Search results" +msgstr "Résultats de la recherche" + +#. module: golem_member_precreation_search +#: model:ir.model.fields,field_description:golem_member_precreation_search.field_golem_member_precreation_search_state +msgid "State" +msgstr "État" + +#. module: golem_member_precreation_search +#: model:ir.model,name:golem_member_precreation_search.model_golem_member_precreation_search +msgid "golem.member.precreation.search" +msgstr "golem.member.precreation.search" diff --git a/golem_member_precreation_search/i18n/golem_member_precreation_search.pot b/golem_member_precreation_search/i18n/golem_member_precreation_search.pot new file mode 100644 index 0000000..d5019b2 --- /dev/null +++ b/golem_member_precreation_search/i18n/golem_member_precreation_search.pot @@ -0,0 +1,149 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * golem_member_precreation_search +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 10.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2018-03-27 15:09+0000\n" +"PO-Revision-Date: 2018-03-27 15:09+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_precreation_search +#: model:ir.ui.view,arch_db:golem_member_precreation_search.golem_member_precreation_search_view_form +msgid "Close" +msgstr "" + +#. module: golem_member_precreation_search +#: model:ir.model.fields,field_description:golem_member_precreation_search.field_golem_member_precreation_search_contact_ids +msgid "Contacts" +msgstr "" + +#. module: golem_member_precreation_search +#: model:ir.model.fields,field_description:golem_member_precreation_search.field_golem_member_precreation_search_create_uid +msgid "Created by" +msgstr "" + +#. module: golem_member_precreation_search +#: model:ir.model.fields,field_description:golem_member_precreation_search.field_golem_member_precreation_search_create_date +msgid "Created on" +msgstr "" + +#. module: golem_member_precreation_search +#: model:ir.model.fields,field_description:golem_member_precreation_search.field_golem_member_precreation_search_display_name +msgid "Display Name" +msgstr "" + +#. module: golem_member_precreation_search +#: selection:golem.member.precreation.search,state:0 +msgid "Final" +msgstr "" + +#. module: golem_member_precreation_search +#: model:ir.model,name:golem_member_precreation_search.model_golem_member +msgid "GOLEM Member" +msgstr "" + +#. module: golem_member_precreation_search +#: model:ir.model.fields,field_description:golem_member_precreation_search.field_golem_member_precreation_search_id +msgid "ID" +msgstr "" + +#. module: golem_member_precreation_search +#: selection:golem.member.precreation.search,state:0 +msgid "Init" +msgstr "" + +#. module: golem_member_precreation_search +#: model:ir.model.fields,field_description:golem_member_precreation_search.field_golem_member_precreation_search_keyword +msgid "Keyword" +msgstr "" + +#. module: golem_member_precreation_search +#: model:ir.model.fields,field_description:golem_member_precreation_search.field_golem_member_precreation_search___last_update +msgid "Last Modified on" +msgstr "" + +#. module: golem_member_precreation_search +#: model:ir.model.fields,field_description:golem_member_precreation_search.field_golem_member_precreation_search_write_uid +msgid "Last Updated by" +msgstr "" + +#. module: golem_member_precreation_search +#: model:ir.model.fields,field_description:golem_member_precreation_search.field_golem_member_precreation_search_write_date +msgid "Last Updated on" +msgstr "" + +#. module: golem_member_precreation_search +#: model:ir.model.fields,field_description:golem_member_precreation_search.field_golem_member_precreation_search_member_ids +msgid "Members" +msgstr "" + +#. module: golem_member_precreation_search +#: model:ir.ui.view,arch_db:golem_member_precreation_search.golem_member_precreation_search_view_form +msgid "New search" +msgstr "" + +#. module: golem_member_precreation_search +#: model:ir.ui.view,arch_db:golem_member_precreation_search.golem_member_precreation_search_view_form +msgid "No contact found for the current search." +msgstr "" + +#. module: golem_member_precreation_search +#: model:ir.ui.view,arch_db:golem_member_precreation_search.golem_member_precreation_search_view_form +msgid "No member found for the current search." +msgstr "" + +#. module: golem_member_precreation_search +#: model:ir.model,name:golem_member_precreation_search.model_res_partner +msgid "Partner" +msgstr "" + +#. module: golem_member_precreation_search +#: model:ir.ui.view,arch_db:golem_member_precreation_search.golem_member_precreation_search_view_form +msgid "Please enter a keyword. It will be searched, as case-insensitive, into firstname, lastname and emails." +msgstr "" + +#. module: golem_member_precreation_search +#: code:addons/golem_member_precreation_search/models/res_partner.py:32 +#, python-format +msgid "Please enter contact searched" +msgstr "" + +#. module: golem_member_precreation_search +#: model:ir.actions.act_window,name:golem_member_precreation_search.golem_member_precreation_search_action +msgid "Pre-creation contact search" +msgstr "" + +#. module: golem_member_precreation_search +#: model:ir.ui.view,arch_db:golem_member_precreation_search.golem_member_precreation_search_view_form +msgid "Search Members and Contacts" +msgstr "" + +#. module: golem_member_precreation_search +#: model:ir.ui.menu,name:golem_member_precreation_search.golem_member_precreation_search_menu +msgid "Search for contact before create" +msgstr "" + +#. module: golem_member_precreation_search +#: code:addons/golem_member_precreation_search/wizard/golem_member_precreation_search.py:40 +#, python-format +msgid "Search results" +msgstr "" + +#. module: golem_member_precreation_search +#: model:ir.model.fields,field_description:golem_member_precreation_search.field_golem_member_precreation_search_state +msgid "State" +msgstr "" + +#. module: golem_member_precreation_search +#: model:ir.model,name:golem_member_precreation_search.model_golem_member_precreation_search +msgid "golem.member.precreation.search" +msgstr "" + diff --git a/golem_member_precreation_search/models/__init__.py b/golem_member_precreation_search/models/__init__.py new file mode 100644 index 0000000..368a20b --- /dev/null +++ b/golem_member_precreation_search/models/__init__.py @@ -0,0 +1,19 @@ +# -*- coding: utf-8 -*- + +# Copyright 2018 Youssef El Ouahby +# Copyright 2018 Fabien Bourgeois +# +# 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 . + +from . import res_partner, golem_member diff --git a/golem_member_precreation_search/models/golem_member.py b/golem_member_precreation_search/models/golem_member.py new file mode 100644 index 0000000..760dfcf --- /dev/null +++ b/golem_member_precreation_search/models/golem_member.py @@ -0,0 +1,40 @@ +# -*- coding: utf-8 -*- + +# Copyright 2018 Youssef El Ouahby +# Copyright 2018 Fabien Bourgeois +# +# 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 . + +""" GOLEM Member adaptations """ + +from odoo import models, api, _ + +class GolemMember(models.Model): + """ GOLEM Member extention """ + _inherit = 'golem.member' + + @api.multi + def navigate_to_contact(self): + """ Navigates to member form, in edit mode """ + self.ensure_one() + return { + 'type': 'ir.actions.act_window', + 'name': 'Member', + 'view_type': 'form', + 'view_mode': 'form', + 'res_model': self._name, + 'res_id': self[0].id, + 'flags': {'initial_mode': 'edit'}, + 'target': 'current' + } diff --git a/golem_member_precreation_search/models/res_partner.py b/golem_member_precreation_search/models/res_partner.py new file mode 100644 index 0000000..161f70e --- /dev/null +++ b/golem_member_precreation_search/models/res_partner.py @@ -0,0 +1,52 @@ +# -*- coding: utf-8 -*- + +# Copyright 2018 Youssef El Ouahby +# Copyright 2018 Fabien Bourgeois +# +# 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 . + +""" Partner adaptations """ + +from odoo import models, api, _ + +class ResPartner(models.Model): + """ Res Partner extention """ + _inherit = 'res.partner' + + @api.multi + def precreation_search(self): + """ Precreation contact search """ + self.ensure_one() + return { + 'name' : _('Please enter contact searched'), + 'type' : 'ir.actions.act_window', + 'res_model' : 'golem.precreation.member.request.wizard', + 'view_mode': 'form', + 'target': 'new' + } + + @api.multi + def navigate_to_contact(self): + """ Navigates to contact form, in edit mode """ + self.ensure_one() + return { + 'type': 'ir.actions.act_window', + 'name': 'Member', + 'view_type': 'form', + 'view_mode': 'form', + 'res_model': self._name, + 'res_id': self[0].id, + 'flags': {'initial_mode': 'edit'}, + 'target': 'current' + } diff --git a/golem_member_precreation_search/views/golem_member_precreation_search_menu.xml b/golem_member_precreation_search/views/golem_member_precreation_search_menu.xml new file mode 100644 index 0000000..25e3403 --- /dev/null +++ b/golem_member_precreation_search/views/golem_member_precreation_search_menu.xml @@ -0,0 +1,37 @@ + + + + + + + + + + + + + + diff --git a/golem_member_precreation_search/wizard/__init__.py b/golem_member_precreation_search/wizard/__init__.py new file mode 100644 index 0000000..5dd0480 --- /dev/null +++ b/golem_member_precreation_search/wizard/__init__.py @@ -0,0 +1,19 @@ +# -*- coding: utf-8 -*- + +# Copyright 2018 Youssef El Ouahby +# Copyright 2018 Fabien Bourgeois +# +# 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 . + +from . import golem_member_precreation_search diff --git a/golem_member_precreation_search/wizard/golem_member_precreation_search.py b/golem_member_precreation_search/wizard/golem_member_precreation_search.py new file mode 100644 index 0000000..d9d0f8f --- /dev/null +++ b/golem_member_precreation_search/wizard/golem_member_precreation_search.py @@ -0,0 +1,66 @@ +# -*- coding: utf-8 -*- + +# Copyright 2018 Youssef El Ouahby +# Copyright 2018 Fabien Bourgeois +# +# 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 . +""" GOLEM Precreation Member Request wizard""" + +import logging +from odoo import models, fields, api, _ +_LOGGER = logging.getLogger(__name__) + +class GolemPrecreationMemberRequestWizard(models.TransientModel): + """GOLEM Precreation Request Member Wizard """ + _name = 'golem.member.precreation.search' + + state = fields.Selection([('init', 'Init'), ('final', 'Final')], + default='init') + keyword = fields.Char(required=True) + member_ids = fields.Many2many('golem.member', string='Members') + contact_ids = fields.Many2many('res.partner', string='Contacts') + + @api.multi + def action(self): + """ Return same wizard window """ + self.ensure_one() + _LOGGER.warning(self[0].contact_ids) + _LOGGER.warning(self[0].member_ids) + return {'name' : _('Search results'), + 'type' : 'ir.actions.act_window', + 'res_model' : self._name, + 'res_id': self[0].id, + 'view_mode': 'form', + 'target': 'new'} + + @api.multi + def new_search(self): + """ New search """ + self[0].write({'member_ids': [(6, False, [])], + 'contact_ids': [(6, False, [])], + 'state': 'init'}) + return self[0].action() + + @api.multi + def search_partners(self): + """ Search partners """ + self.ensure_one() + domain = ['|', + ('name', 'ilike', self[0].keyword), + ('email', 'ilike', self[0].keyword)] + partner_ids = self.env['res.partner'].search(domain) + self[0].write({'contact_ids': [(6, False, partner_ids.ids)], + 'member_ids': [(6, False, partner_ids.mapped('member_id').ids)], + 'state': 'final'}) + return self[0].action() diff --git a/golem_member_precreation_search/wizard/golem_member_precreation_search_views.xml b/golem_member_precreation_search/wizard/golem_member_precreation_search_views.xml new file mode 100644 index 0000000..2de8318 --- /dev/null +++ b/golem_member_precreation_search/wizard/golem_member_precreation_search_views.xml @@ -0,0 +1,74 @@ + + + + + + + GOLEM Member Precreation Search Form + golem.member.precreation.search + +
+ + +

+ Please enter a keyword. It will be searched, as case-insensitive, into firstname, lastname and emails. +

+ +
+ +

+ No member found for the current search. +

+ + + + + + +