[IMP][REF]GOLEM Family : enhancements
* Allow partner selection from family members tab ; * Allow family linking from new sevrice user, without mandatory save ; * Fix UI for family tab ; * Create a family from sevrice user through button on header.
This commit is contained in:
parent
d070acfbe0
commit
893bfcd79b
@ -19,7 +19,7 @@
|
|||||||
'name': 'GOLEM families',
|
'name': 'GOLEM families',
|
||||||
'summary': 'GOLEM Members Families',
|
'summary': 'GOLEM Members Families',
|
||||||
'description': 'GOLEM Members Families',
|
'description': 'GOLEM Members Families',
|
||||||
'version': '10.0.2.2.4',
|
'version': '10.0.2.3.0',
|
||||||
'category': 'GOLEM',
|
'category': 'GOLEM',
|
||||||
'author': 'Fabien Bourgeois',
|
'author': 'Fabien Bourgeois',
|
||||||
'license': 'AGPL-3',
|
'license': 'AGPL-3',
|
||||||
|
@ -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: 2018-03-18 09:24+0000\n"
|
"POT-Creation-Date: 2018-08-01 10:12+0000\n"
|
||||||
"PO-Revision-Date: 2018-03-18 09:24+0000\n"
|
"PO-Revision-Date: 2018-08-01 12:15+0200\n"
|
||||||
"Last-Translator: <>\n"
|
"Last-Translator: <>\n"
|
||||||
"Language-Team: \n"
|
"Language-Team: \n"
|
||||||
"MIME-Version: 1.0\n"
|
"MIME-Version: 1.0\n"
|
||||||
@ -38,14 +38,9 @@ msgstr "<strong>Pays</strong> :"
|
|||||||
|
|
||||||
#. module: golem_family
|
#. module: golem_family
|
||||||
#: model:ir.ui.view,arch_db:golem_family.golem_member_card_template_inherit_golem_family
|
#: model:ir.ui.view,arch_db:golem_family.golem_member_card_template_inherit_golem_family
|
||||||
msgid "<strong>Family :</strong>"
|
msgid "<strong>Family </strong>"
|
||||||
msgstr "<strong>Famille :</strong>"
|
msgstr "<strong>Famille :</strong>"
|
||||||
|
|
||||||
#. module: golem_family
|
|
||||||
#: model:ir.ui.view,arch_db:golem_family.golem_member_card_template_inherit_golem_family
|
|
||||||
msgid "<strong>Role :</strong>"
|
|
||||||
msgstr "<strong>Role :</strong>"
|
|
||||||
|
|
||||||
#. module: golem_family
|
#. module: golem_family
|
||||||
#: model:ir.ui.view,arch_db:golem_family.golem_family_card_template
|
#: model:ir.ui.view,arch_db:golem_family.golem_family_card_template
|
||||||
msgid "<strong>State</strong> :"
|
msgid "<strong>State</strong> :"
|
||||||
@ -98,9 +93,9 @@ msgid "Country"
|
|||||||
msgstr "Pays"
|
msgstr "Pays"
|
||||||
|
|
||||||
#. module: golem_family
|
#. module: golem_family
|
||||||
#: model:ir.ui.view,arch_db:golem_family.golem_family_card_template
|
#: model:ir.ui.view,arch_db:golem_family.golem_member_form_inherit_golem_family
|
||||||
msgid "Country :"
|
msgid "Create a new family"
|
||||||
msgstr "Pays :"
|
msgstr "Créer une nouvelle famille"
|
||||||
|
|
||||||
#. module: golem_family
|
#. module: golem_family
|
||||||
#: model:ir.model.fields,field_description:golem_family.field_golem_family_create_uid
|
#: model:ir.model.fields,field_description:golem_family.field_golem_family_create_uid
|
||||||
@ -150,8 +145,8 @@ msgid "Family"
|
|||||||
msgstr "Famille"
|
msgstr "Famille"
|
||||||
|
|
||||||
#. module: golem_family
|
#. module: golem_family
|
||||||
#: code:addons/golem_family/models/golem_family.py:48
|
#: code:addons/golem_family/models/golem_family.py:50
|
||||||
#: code:addons/golem_family/models/golem_family.py:82
|
#: code:addons/golem_family/models/golem_family.py:84
|
||||||
#, python-format
|
#, python-format
|
||||||
msgid "Family Members"
|
msgid "Family Members"
|
||||||
msgstr "Membres de la famille"
|
msgstr "Membres de la famille"
|
||||||
@ -295,11 +290,6 @@ msgstr "Téléphone"
|
|||||||
msgid "Phone :"
|
msgid "Phone :"
|
||||||
msgstr "Téléphone :"
|
msgstr "Téléphone :"
|
||||||
|
|
||||||
#. module: golem_family
|
|
||||||
#: model:ir.ui.view,arch_db:golem_family.golem_member_form_inherit_golem_family
|
|
||||||
msgid "Please save new member before assigning a family."
|
|
||||||
msgstr "Merci de sauvegarder la fiche du nouveau membre avant de pouvoir lui assigner une famille."
|
|
||||||
|
|
||||||
#. module: golem_family
|
#. module: golem_family
|
||||||
#: model:ir.ui.view,arch_db:golem_family.golem_family_form
|
#: model:ir.ui.view,arch_db:golem_family.golem_family_form
|
||||||
msgid "Put an internal note..."
|
msgid "Put an internal note..."
|
||||||
|
@ -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: 2018-03-18 09:23+0000\n"
|
"POT-Creation-Date: 2018-08-01 10:12+0000\n"
|
||||||
"PO-Revision-Date: 2018-03-18 09:23+0000\n"
|
"PO-Revision-Date: 2018-08-01 10:12+0000\n"
|
||||||
"Last-Translator: <>\n"
|
"Last-Translator: <>\n"
|
||||||
"Language-Team: \n"
|
"Language-Team: \n"
|
||||||
"MIME-Version: 1.0\n"
|
"MIME-Version: 1.0\n"
|
||||||
@ -38,12 +38,7 @@ msgstr ""
|
|||||||
|
|
||||||
#. module: golem_family
|
#. module: golem_family
|
||||||
#: model:ir.ui.view,arch_db:golem_family.golem_member_card_template_inherit_golem_family
|
#: model:ir.ui.view,arch_db:golem_family.golem_member_card_template_inherit_golem_family
|
||||||
msgid "<strong>Family :</strong>"
|
msgid "<strong>Family </strong>"
|
||||||
msgstr ""
|
|
||||||
|
|
||||||
#. module: golem_family
|
|
||||||
#: model:ir.ui.view,arch_db:golem_family.golem_member_card_template_inherit_golem_family
|
|
||||||
msgid "<strong>Role :</strong>"
|
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#. module: golem_family
|
#. module: golem_family
|
||||||
@ -97,6 +92,11 @@ msgstr ""
|
|||||||
msgid "Country"
|
msgid "Country"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
|
#. module: golem_family
|
||||||
|
#: model:ir.ui.view,arch_db:golem_family.golem_member_form_inherit_golem_family
|
||||||
|
msgid "Create a new family"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
#. module: golem_family
|
#. module: golem_family
|
||||||
#: model:ir.model.fields,field_description:golem_family.field_golem_family_create_uid
|
#: model:ir.model.fields,field_description:golem_family.field_golem_family_create_uid
|
||||||
#: model:ir.model.fields,field_description:golem_family.field_golem_family_role_create_uid
|
#: model:ir.model.fields,field_description:golem_family.field_golem_family_role_create_uid
|
||||||
@ -145,8 +145,8 @@ msgid "Family"
|
|||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#. module: golem_family
|
#. module: golem_family
|
||||||
#: code:addons/golem_family/models/golem_family.py:48
|
#: code:addons/golem_family/models/golem_family.py:50
|
||||||
#: code:addons/golem_family/models/golem_family.py:82
|
#: code:addons/golem_family/models/golem_family.py:84
|
||||||
#, python-format
|
#, python-format
|
||||||
msgid "Family Members"
|
msgid "Family Members"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
@ -290,11 +290,6 @@ msgstr ""
|
|||||||
msgid "Phone :"
|
msgid "Phone :"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#. module: golem_family
|
|
||||||
#: model:ir.ui.view,arch_db:golem_family.golem_member_form_inherit_golem_family
|
|
||||||
msgid "Please save new member before assigning a family."
|
|
||||||
msgstr ""
|
|
||||||
|
|
||||||
#. module: golem_family
|
#. module: golem_family
|
||||||
#: model:ir.ui.view,arch_db:golem_family.golem_family_form
|
#: model:ir.ui.view,arch_db:golem_family.golem_family_form
|
||||||
msgid "Put an internal note..."
|
msgid "Put an internal note..."
|
||||||
|
@ -85,6 +85,33 @@ class GolemMember(models.Model):
|
|||||||
'view_mode': 'form',
|
'view_mode': 'form',
|
||||||
'res_id': member.family_id.id}
|
'res_id': member.family_id.id}
|
||||||
|
|
||||||
|
@api.multi
|
||||||
|
def create_family(self):
|
||||||
|
""" Create family from service user """
|
||||||
|
self.ensure_one()
|
||||||
|
member = self[0]
|
||||||
|
if member.family_id:
|
||||||
|
member.family_id = False
|
||||||
|
data = {'name': member.lastname,
|
||||||
|
'street': member.street,
|
||||||
|
'street2': member.street2,
|
||||||
|
'zip': member.zip,
|
||||||
|
'city': member.city,
|
||||||
|
'member_ids': [(4, member.partner_id.id, False)]}
|
||||||
|
self.env['golem.family'].create(data)
|
||||||
|
# self.family_id = new_family.id
|
||||||
|
|
||||||
|
@api.model
|
||||||
|
def create(self, values):
|
||||||
|
""" Handles family fields at creation """
|
||||||
|
family_id = values.get('family_id')
|
||||||
|
if family_id:
|
||||||
|
del values['family_id']
|
||||||
|
members = super(GolemMember, self).create(values)
|
||||||
|
if family_id:
|
||||||
|
members.mapped('partner_id').write({'family_id': family_id})
|
||||||
|
return members
|
||||||
|
|
||||||
|
|
||||||
class GolemFamily(models.Model):
|
class GolemFamily(models.Model):
|
||||||
""" GOLEM Family Entity """
|
""" GOLEM Family Entity """
|
||||||
|
@ -25,64 +25,60 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|||||||
<field name="model">golem.member</field>
|
<field name="model">golem.member</field>
|
||||||
<field name="inherit_id" ref="golem_member.golem_member_form" />
|
<field name="inherit_id" ref="golem_member.golem_member_form" />
|
||||||
<field name="arch" type="xml">
|
<field name="arch" type="xml">
|
||||||
|
<header position="inside">
|
||||||
|
<button type="object" name="create_family" string="Create a new family"
|
||||||
|
attrs="{'invisible': ['|', ('id', '=', False), ('family_id', '!=', False)]}" />
|
||||||
|
</header>
|
||||||
<field name="lastname" position="before">
|
<field name="lastname" position="before">
|
||||||
<field name="id" invisible="1" />
|
<field name="id" invisible="1" />
|
||||||
<field name="partner_id" invisible="1" required="0" />
|
<field name="partner_id" invisible="1" required="0" />
|
||||||
<p class="oe_grey" colspan="2"
|
|
||||||
attrs="{'invisible': [('id', '!=', False)]}">
|
|
||||||
Please save new member before assigning a family.
|
|
||||||
</p>
|
|
||||||
<field name="family_id"
|
<field name="family_id"
|
||||||
attrs="{'readonly': [('id', '=', False)]}"
|
options="{'no_create': True}" />
|
||||||
context="{'default_member_ids': [(4, partner_id, False)]}" />
|
<field name="family_role" />
|
||||||
<field name="family_role"
|
|
||||||
attrs="{'readonly': [('id', '=', False)]}" />
|
|
||||||
</field>
|
</field>
|
||||||
<page name="membership" position="before">
|
<page name="membership" position="before">
|
||||||
<page string="Family"
|
<page string="Family"
|
||||||
attrs="{'invisible': [('family_id', '=', False)]}">
|
attrs="{'invisible': ['|', ('id', '=', False), ('family_id', '=', False)]}">
|
||||||
<group>
|
<group string="Address">
|
||||||
<group string="Address">
|
<group>
|
||||||
<group>
|
<field name="family_street" placeholder="Street..." />
|
||||||
<field name="family_street" placeholder="Street..." />
|
<field name="family_street2" />
|
||||||
<field name="family_street2" />
|
<field name="family_zip" placeholder="ZIP" />
|
||||||
<field name="family_zip" placeholder="ZIP" />
|
<field name="family_city" placeholder="City" />
|
||||||
<field name="family_city" placeholder="City" />
|
</group>
|
||||||
</group>
|
<group>
|
||||||
<group>
|
<field name="family_state_id" class="oe_no_button"
|
||||||
<field name="family_state_id" class="oe_no_button"
|
placeholder="State" />
|
||||||
placeholder="State" />
|
<field name="family_country_id" placeholder="Country"
|
||||||
<field name="family_country_id" placeholder="Country"
|
class="oe_no_button" />
|
||||||
class="oe_no_button" />
|
</group>
|
||||||
</group>
|
</group>
|
||||||
|
<group string="Communication">
|
||||||
|
<group>
|
||||||
|
<field name="family_phone" placeholder="0000000000"
|
||||||
|
widget="phonefr" />
|
||||||
|
<field name="family_mobile" placeholder="0000000000"
|
||||||
|
widget="phonefr" />
|
||||||
|
</group>
|
||||||
|
<group>
|
||||||
|
<field name="family_email" widget="email"
|
||||||
|
placeholder="name@example.org" />
|
||||||
|
<field name="family_website" widget="url"
|
||||||
|
placeholder="e.g. www.odoo.com"/>
|
||||||
</group>
|
</group>
|
||||||
</group>
|
</group>
|
||||||
<group>
|
<group>
|
||||||
<group string="Communication">
|
<field name="family_member_ids" widget="many2many"
|
||||||
<group>
|
context="{'default_family_id': active_id}">
|
||||||
<field name="family_phone" placeholder="0000000000"
|
<tree delete="false" create="true" edit="true">
|
||||||
widget="phonefr" />
|
<field name="name" />
|
||||||
<field name="family_mobile" placeholder="0000000000"
|
<field name="family_role" />
|
||||||
widget="phonefr" />
|
<field name="phone" />
|
||||||
</group>
|
<field name="mobile" />
|
||||||
<group>
|
<field name="email" widget="email" />
|
||||||
<field name="family_email" widget="email"
|
</tree>
|
||||||
placeholder="name@example.org" />
|
</field>
|
||||||
<field name="family_website" widget="url"
|
|
||||||
placeholder="e.g. www.odoo.com"/>
|
|
||||||
</group>
|
|
||||||
</group>
|
|
||||||
</group>
|
</group>
|
||||||
<field name="family_member_ids"
|
|
||||||
context="{'default_family_id': active_id}">
|
|
||||||
<tree delete="false">
|
|
||||||
<field name="name" />
|
|
||||||
<field name="family_role" />
|
|
||||||
<field name="phone" />
|
|
||||||
<field name="mobile" />
|
|
||||||
<field name="email" widget="email" />
|
|
||||||
</tree>
|
|
||||||
</field>
|
|
||||||
</page>
|
</page>
|
||||||
</page>
|
</page>
|
||||||
</field>
|
</field>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user