From a77b38b74e3f6c0f953f07c12c173ef5e6758519 Mon Sep 17 00:00:00 2001 From: Fabien Bourgeois Date: Tue, 20 Jun 2017 16:38:24 +0200 Subject: [PATCH] [FIX]Member problem on onchange parent_id, because member_id is one2many, not many2one : replace member widget on contact form by button --- golem_member/i18n/fr.po | 25 ++++++++++++++---------- golem_member/i18n/golem_member.pot | 25 ++++++++++++++---------- golem_member/models/golem_member.py | 9 +++++++++ golem_member/views/res_partner_views.xml | 4 +++- 4 files changed, 42 insertions(+), 21 deletions(-) diff --git a/golem_member/i18n/fr.po b/golem_member/i18n/fr.po index f25b33c..5d3ff84 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: 2017-06-05 15:25+0000\n" -"PO-Revision-Date: 2017-06-05 15:25+0000\n" +"POT-Creation-Date: 2017-06-20 06:54+0000\n" +"PO-Revision-Date: 2017-06-20 06:54+0000\n" "Last-Translator: <>\n" "Language-Team: \n" "MIME-Version: 1.0\n" @@ -430,7 +430,7 @@ msgid "GOLEM Members Tags" msgstr "Catégories d'adhérents" #. module: golem_member -#: code:addons/golem_member/models/golem_member.py:296 +#: code:addons/golem_member/models/golem_member.py:309 #, python-format msgid "GOLEM Members merge has not been implemented yet. Please only merge partners, not members, or delete GOLEM Members manually before merging." msgstr "La fusion d'adhérents n'a pas encore été implémentée. Merci de ne fusionner que des contacts non adhérents, ou bien de supprimer les adhérents manuellement en premier lieu." @@ -440,6 +440,11 @@ msgstr "La fusion d'adhérents n'a pas encore été implémentée. Merci de ne f msgid "Gender" msgstr "Genre" +#. module: golem_member +#: model:ir.ui.view,arch_db:golem_member.res_partner_form_inherit_golem_member +msgid "Go to member form" +msgstr "Voir la fiche adhérent" + #. module: golem_member #: model:ir.ui.view,arch_db:golem_member.golem_member_search msgid "Group By" @@ -636,7 +641,7 @@ msgid "Member Tags" msgstr "Catégories de l'adhérent" #. module: golem_member -#: model:ir.model.fields,field_description:golem_member.field_golem_member_number_name_4212 +#: model:ir.model.fields,field_description:golem_member.field_golem_member_number_name msgid "Member computed name" msgstr "Numéro et nom du membre" @@ -695,7 +700,7 @@ 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 +#: model:ir.model.fields,field_description:golem_member.field_golem_member_number_name_4164 msgid "Name" msgstr "Nom" @@ -707,8 +712,8 @@ msgid "Nationality" msgstr "Nationalité" #. module: golem_member -#: code:addons/golem_member/models/golem_member.py:254 -#: code:addons/golem_member/models/golem_member.py:257 +#: code:addons/golem_member/models/golem_member.py:262 +#: code:addons/golem_member/models/golem_member.py:265 #: selection:golem.member.numberconfig,is_automatic:0 #: selection:golem.member.numberconfig,is_per_season:0 #, python-format @@ -1011,7 +1016,7 @@ msgid "This field holds the image used as avatar for this contact, limited to 10 msgstr "Ce champ contient l'image utilisée comme photo d'identité pour ce contact, limitée à 1024x1024px." #. module: golem_member -#: code:addons/golem_member/models/golem_member.py:69 +#: code:addons/golem_member/models/golem_member.py:78 #: sql_constraint:golem.member:0 #, python-format msgid "This member number has already been used." @@ -1103,8 +1108,8 @@ msgid "Website of Partner or Company" msgstr "Site Web pour les Partenaires ou les Sociétés" #. module: golem_member -#: code:addons/golem_member/models/golem_member.py:254 -#: code:addons/golem_member/models/golem_member.py:257 +#: code:addons/golem_member/models/golem_member.py:262 +#: code:addons/golem_member/models/golem_member.py:265 #: selection:golem.member.numberconfig,is_automatic:0 #: selection:golem.member.numberconfig,is_per_season:0 #, python-format diff --git a/golem_member/i18n/golem_member.pot b/golem_member/i18n/golem_member.pot index 9b0a086..22c1ca9 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: 2017-06-05 15:25+0000\n" -"PO-Revision-Date: 2017-06-05 15:25+0000\n" +"POT-Creation-Date: 2017-06-20 06:54+0000\n" +"PO-Revision-Date: 2017-06-20 06:54+0000\n" "Last-Translator: <>\n" "Language-Team: \n" "MIME-Version: 1.0\n" @@ -429,7 +429,7 @@ msgid "GOLEM Members Tags" msgstr "" #. module: golem_member -#: code:addons/golem_member/models/golem_member.py:296 +#: code:addons/golem_member/models/golem_member.py:309 #, python-format msgid "GOLEM Members merge has not been implemented yet. Please only merge partners, not members, or delete GOLEM Members manually before merging." msgstr "" @@ -439,6 +439,11 @@ msgstr "" msgid "Gender" msgstr "" +#. module: golem_member +#: model:ir.ui.view,arch_db:golem_member.res_partner_form_inherit_golem_member +msgid "Go to member form" +msgstr "" + #. module: golem_member #: model:ir.ui.view,arch_db:golem_member.golem_member_search msgid "Group By" @@ -629,7 +634,7 @@ msgid "Member Tags" msgstr "" #. module: golem_member -#: model:ir.model.fields,field_description:golem_member.field_golem_member_number_name_4212 +#: model:ir.model.fields,field_description:golem_member.field_golem_member_number_name msgid "Member computed name" msgstr "" @@ -688,7 +693,7 @@ 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 +#: model:ir.model.fields,field_description:golem_member.field_golem_member_number_name_4164 msgid "Name" msgstr "" @@ -700,8 +705,8 @@ msgid "Nationality" msgstr "" #. module: golem_member -#: code:addons/golem_member/models/golem_member.py:254 -#: code:addons/golem_member/models/golem_member.py:257 +#: code:addons/golem_member/models/golem_member.py:262 +#: code:addons/golem_member/models/golem_member.py:265 #: selection:golem.member.numberconfig,is_automatic:0 #: selection:golem.member.numberconfig,is_per_season:0 #, python-format @@ -1002,7 +1007,7 @@ msgid "This field holds the image used as avatar for this contact, limited to 10 msgstr "" #. module: golem_member -#: code:addons/golem_member/models/golem_member.py:69 +#: code:addons/golem_member/models/golem_member.py:78 #: sql_constraint:golem.member:0 #, python-format msgid "This member number has already been used." @@ -1094,8 +1099,8 @@ msgid "Website of Partner or Company" msgstr "" #. module: golem_member -#: code:addons/golem_member/models/golem_member.py:254 -#: code:addons/golem_member/models/golem_member.py:257 +#: code:addons/golem_member/models/golem_member.py:262 +#: code:addons/golem_member/models/golem_member.py:265 #: selection:golem.member.numberconfig,is_automatic:0 #: selection:golem.member.numberconfig,is_per_season:0 #, python-format diff --git a/golem_member/models/golem_member.py b/golem_member/models/golem_member.py index 281f76d..5c0ea9c 100644 --- a/golem_member/models/golem_member.py +++ b/golem_member/models/golem_member.py @@ -49,6 +49,15 @@ class ResPartner(models.Model): for partner in self: partner.is_member = len(partner.member_id) > 0 + @api.multi + def view_member(self): + """ Go to member form """ + self.ensure_one() + if self[0].member_id: + return {'type': 'ir.actions.act_window', + 'res_model': 'golem.member', + 'view_mode': 'form', + 'res_id': self[0].member_id.id} @api.multi def create_golem_member(self): diff --git a/golem_member/views/res_partner_views.xml b/golem_member/views/res_partner_views.xml index a12f3ac..9ac3f1d 100644 --- a/golem_member/views/res_partner_views.xml +++ b/golem_member/views/res_partner_views.xml @@ -34,7 +34,9 @@ along with this program. If not, see .