[IMP]GOLEM Families : enhancements on res.partner and translations adapt

This commit is contained in:
Fabien Bourgeois 2016-07-11 20:13:34 +02:00
parent d845246aa6
commit 6f6751e1ce
5 changed files with 84 additions and 18 deletions

View File

@ -6,8 +6,8 @@ msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 8.0\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2016-07-08 19:50+0000\n"
"PO-Revision-Date: 2016-07-08 19:50+0000\n"
"POT-Creation-Date: 2016-07-11 18:06+0000\n"
"PO-Revision-Date: 2016-07-11 18:06+0000\n"
"Last-Translator: <>\n"
"Language-Team: \n"
"MIME-Version: 1.0\n"
@ -105,7 +105,8 @@ msgid "Family Count"
msgstr "Somme des membres de la famille"
#. module: golem_family
#: code:addons/golem_family/models/golem_family.py:37
#: code:addons/golem_family/models/golem_family.py:33
#: code:addons/golem_family/models/golem_family.py:46
#, python-format
msgid "Family Members"
msgstr "Membres de la famille"
@ -314,7 +315,8 @@ msgid "e.g. www.odoo.com"
msgstr "par exemple www.yaltik.com"
#. module: golem_family
#: view:golem.member:golem_family.family_smartbtn_add
#: view:golem.member:golem_family.golem_member_family_smartbtn_add
#: view:res.partner:golem_family.res_partner_family_smartbtn_add
msgid "family members"
msgstr "famille"

View File

@ -6,8 +6,8 @@ msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 8.0\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2016-07-08 19:50+0000\n"
"PO-Revision-Date: 2016-07-08 19:50+0000\n"
"POT-Creation-Date: 2016-07-11 18:06+0000\n"
"PO-Revision-Date: 2016-07-11 18:06+0000\n"
"Last-Translator: <>\n"
"Language-Team: \n"
"MIME-Version: 1.0\n"
@ -104,7 +104,8 @@ msgid "Family Count"
msgstr ""
#. module: golem_family
#: code:addons/golem_family/models/golem_family.py:37
#: code:addons/golem_family/models/golem_family.py:33
#: code:addons/golem_family/models/golem_family.py:46
#, python-format
msgid "Family Members"
msgstr ""
@ -313,7 +314,8 @@ msgid "e.g. www.odoo.com"
msgstr ""
#. module: golem_family
#: view:golem.member:golem_family.family_smartbtn_add
#: view:golem.member:golem_family.golem_member_family_smartbtn_add
#: view:res.partner:golem_family.res_partner_family_smartbtn_add
msgid "family members"
msgstr ""

View File

@ -27,6 +27,15 @@ class ResPartner(models.Model):
string='Role', index=True)
family_count = fields.Integer('Family Count', related='family_id.count')
@api.multi
def button_family_members(self):
self.ensure_one()
return {'name': _('Family Members'),
'type': 'ir.actions.act_window',
'res_model': 'golem.family',
'view_mode': 'form',
'res_id': self.family_id.id}
class GolemMember(models.Model):
_inherit = 'golem.member'

View File

@ -20,13 +20,12 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
<openerp>
<data>
<!-- Form -->
<record model="ir.ui.view" id="family_smartbtn_add">
<record model="ir.ui.view" id="golem_member_family_smartbtn_add">
<field name="name">Add family management smart button</field>
<field name="model">golem.member</field>
<field name="inherit_id" ref="golem_member.view_form" />
<field name="arch" type="xml">
<div class="oe_title" position="after">
<div class="oe_right oe_button_box">
<div name="buttons" position="inside">
<button class="oe_inline oe_stat_button" type="object"
name="button_family_members" icon="fa-users"
attrs="{'invisible': [('family_id', '=', False)]}">
@ -34,7 +33,6 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
widget="statinfo" />
</button>
</div>
</div>
<field name="lastname" position="before">
<field name="family_id" />
<field name="family_role" />

View File

@ -0,0 +1,55 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
Copyright 2016 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/>.
-->
<openerp>
<data>
<!-- Form -->
<record model="ir.ui.view" id="res_partner_family_smartbtn_add">
<field name="name">Add family management smart button</field>
<field name="model">res.partner</field>
<field name="inherit_id" ref="base.view_partner_form" />
<field name="arch" type="xml">
<div name="buttons" position="inside">
<button class="oe_inline oe_stat_button" type="object"
name="button_family_members" icon="fa-users"
attrs="{'invisible': [('family_id', '=', False)]}">
<field string="family members" name="family_count"
widget="statinfo" />
</button>
</div>
</field>
</record>
<record model="ir.ui.view" id="res_partner_family_role_add">
<field name="name">Add family role into res.partner form</field>
<field name="model">res.partner</field>
<field name="inherit_id"
ref="partner_firstname.view_partner_form_firstname" />
<field name="arch" type="xml">
<field name="lastname" position="before">
<field name="family_id"
attrs="{'invisible': [('is_company', '=', True)]}" />
<field name="family_role"
attrs="{'invisible': [('is_company', '=', True)]}" />
</field>
</field>
</record>
</data>
</openerp>