[FIX]Member problem on onchange parent_id, because member_id is one2many, not many2one : replace member widget on contact form by button

This commit is contained in:
Fabien Bourgeois 2017-06-20 16:38:24 +02:00
parent 444bc1fbf6
commit a77b38b74e
4 changed files with 42 additions and 21 deletions

View File

@ -6,8 +6,8 @@ msgid ""
msgstr "" msgstr ""
"Project-Id-Version: Odoo Server 10.0\n" "Project-Id-Version: Odoo Server 10.0\n"
"Report-Msgid-Bugs-To: \n" "Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2017-06-05 15:25+0000\n" "POT-Creation-Date: 2017-06-20 06:54+0000\n"
"PO-Revision-Date: 2017-06-05 15:25+0000\n" "PO-Revision-Date: 2017-06-20 06:54+0000\n"
"Last-Translator: <>\n" "Last-Translator: <>\n"
"Language-Team: \n" "Language-Team: \n"
"MIME-Version: 1.0\n" "MIME-Version: 1.0\n"
@ -430,7 +430,7 @@ msgid "GOLEM Members Tags"
msgstr "Catégories d'adhérents" msgstr "Catégories d'adhérents"
#. module: golem_member #. module: golem_member
#: code:addons/golem_member/models/golem_member.py:296 #: code:addons/golem_member/models/golem_member.py:309
#, python-format #, python-format
msgid "GOLEM Members merge has not been implemented yet. Please only merge partners, not members, or delete GOLEM Members manually before merging." 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." 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" msgid "Gender"
msgstr "Genre" 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 #. module: golem_member
#: model:ir.ui.view,arch_db:golem_member.golem_member_search #: model:ir.ui.view,arch_db:golem_member.golem_member_search
msgid "Group By" msgid "Group By"
@ -636,7 +641,7 @@ msgid "Member Tags"
msgstr "Catégories de l'adhérent" msgstr "Catégories de l'adhérent"
#. module: golem_member #. 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" msgid "Member computed name"
msgstr "Numéro et nom du membre" msgstr "Numéro et nom du membre"
@ -695,7 +700,7 @@ msgstr "NIC"
#. module: golem_member #. 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_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" msgid "Name"
msgstr "Nom" msgstr "Nom"
@ -707,8 +712,8 @@ msgid "Nationality"
msgstr "Nationalité" msgstr "Nationalité"
#. module: golem_member #. module: golem_member
#: code:addons/golem_member/models/golem_member.py:254 #: code:addons/golem_member/models/golem_member.py:262
#: code:addons/golem_member/models/golem_member.py:257 #: code:addons/golem_member/models/golem_member.py:265
#: selection:golem.member.numberconfig,is_automatic:0 #: selection:golem.member.numberconfig,is_automatic:0
#: selection:golem.member.numberconfig,is_per_season:0 #: selection:golem.member.numberconfig,is_per_season:0
#, python-format #, 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." msgstr "Ce champ contient l'image utilisée comme photo d'identité pour ce contact, limitée à 1024x1024px."
#. module: golem_member #. 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 #: sql_constraint:golem.member:0
#, python-format #, python-format
msgid "This member number has already been used." 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" msgstr "Site Web pour les Partenaires ou les Sociétés"
#. module: golem_member #. module: golem_member
#: code:addons/golem_member/models/golem_member.py:254 #: code:addons/golem_member/models/golem_member.py:262
#: code:addons/golem_member/models/golem_member.py:257 #: code:addons/golem_member/models/golem_member.py:265
#: selection:golem.member.numberconfig,is_automatic:0 #: selection:golem.member.numberconfig,is_automatic:0
#: selection:golem.member.numberconfig,is_per_season:0 #: selection:golem.member.numberconfig,is_per_season:0
#, python-format #, python-format

View File

@ -6,8 +6,8 @@ msgid ""
msgstr "" msgstr ""
"Project-Id-Version: Odoo Server 10.0\n" "Project-Id-Version: Odoo Server 10.0\n"
"Report-Msgid-Bugs-To: \n" "Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2017-06-05 15:25+0000\n" "POT-Creation-Date: 2017-06-20 06:54+0000\n"
"PO-Revision-Date: 2017-06-05 15:25+0000\n" "PO-Revision-Date: 2017-06-20 06:54+0000\n"
"Last-Translator: <>\n" "Last-Translator: <>\n"
"Language-Team: \n" "Language-Team: \n"
"MIME-Version: 1.0\n" "MIME-Version: 1.0\n"
@ -429,7 +429,7 @@ msgid "GOLEM Members Tags"
msgstr "" msgstr ""
#. module: golem_member #. module: golem_member
#: code:addons/golem_member/models/golem_member.py:296 #: code:addons/golem_member/models/golem_member.py:309
#, python-format #, python-format
msgid "GOLEM Members merge has not been implemented yet. Please only merge partners, not members, or delete GOLEM Members manually before merging." msgid "GOLEM Members merge has not been implemented yet. Please only merge partners, not members, or delete GOLEM Members manually before merging."
msgstr "" msgstr ""
@ -439,6 +439,11 @@ msgstr ""
msgid "Gender" msgid "Gender"
msgstr "" 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 #. module: golem_member
#: model:ir.ui.view,arch_db:golem_member.golem_member_search #: model:ir.ui.view,arch_db:golem_member.golem_member_search
msgid "Group By" msgid "Group By"
@ -629,7 +634,7 @@ msgid "Member Tags"
msgstr "" msgstr ""
#. module: golem_member #. 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" msgid "Member computed name"
msgstr "" msgstr ""
@ -688,7 +693,7 @@ msgstr ""
#. module: golem_member #. 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_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" msgid "Name"
msgstr "" msgstr ""
@ -700,8 +705,8 @@ msgid "Nationality"
msgstr "" msgstr ""
#. module: golem_member #. module: golem_member
#: code:addons/golem_member/models/golem_member.py:254 #: code:addons/golem_member/models/golem_member.py:262
#: code:addons/golem_member/models/golem_member.py:257 #: code:addons/golem_member/models/golem_member.py:265
#: selection:golem.member.numberconfig,is_automatic:0 #: selection:golem.member.numberconfig,is_automatic:0
#: selection:golem.member.numberconfig,is_per_season:0 #: selection:golem.member.numberconfig,is_per_season:0
#, python-format #, python-format
@ -1002,7 +1007,7 @@ msgid "This field holds the image used as avatar for this contact, limited to 10
msgstr "" msgstr ""
#. module: golem_member #. 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 #: sql_constraint:golem.member:0
#, python-format #, python-format
msgid "This member number has already been used." msgid "This member number has already been used."
@ -1094,8 +1099,8 @@ msgid "Website of Partner or Company"
msgstr "" msgstr ""
#. module: golem_member #. module: golem_member
#: code:addons/golem_member/models/golem_member.py:254 #: code:addons/golem_member/models/golem_member.py:262
#: code:addons/golem_member/models/golem_member.py:257 #: code:addons/golem_member/models/golem_member.py:265
#: selection:golem.member.numberconfig,is_automatic:0 #: selection:golem.member.numberconfig,is_automatic:0
#: selection:golem.member.numberconfig,is_per_season:0 #: selection:golem.member.numberconfig,is_per_season:0
#, python-format #, python-format

View File

@ -49,6 +49,15 @@ class ResPartner(models.Model):
for partner in self: for partner in self:
partner.is_member = len(partner.member_id) > 0 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 @api.multi
def create_golem_member(self): def create_golem_member(self):

View File

@ -34,7 +34,9 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
<label for="member_id" <label for="member_id"
attrs="{'invisible': ['|', ('is_company', '=', True), attrs="{'invisible': ['|', ('is_company', '=', True),
('member_id', '=', False)]}" /> ('member_id', '=', False)]}" />
<field name="member_id" widget="many2one" readonly="True" <field name="member_id" invisible="1" />
<button name="view_member" string="Go to member form" type="object"
class="oe_link"
attrs="{'invisible': ['|', ('is_company', '=', True), attrs="{'invisible': ['|', ('is_company', '=', True),
('member_id', '=', False)]}" /> ('member_id', '=', False)]}" />
<button type="object" name="create_golem_member" <button type="object" name="create_golem_member"