[IMP]GOLEM Family : after michel new features merging, some typos

This commit is contained in:
Fabien BOURGEOIS 2018-01-29 15:35:52 +01:00
parent f30bd35a81
commit 4e2cee7d05
4 changed files with 67 additions and 71 deletions

View File

@ -18,7 +18,7 @@
{
'name': 'GOLEM families',
'summary': 'GOLEM Members Families',
'version': '10.0.2.0.0',
'version': '10.0.2.1.0',
'category': 'GOLEM',
'author': 'Fabien Bourgeois',
'license': 'AGPL-3',

View File

@ -24,7 +24,6 @@ class ResPartner(models.Model):
""" Partner adaptations """
_inherit = 'res.partner'
family_member = fields.Many2one(related='family_id')
family_member_ids = fields.One2many(related='family_id.member_ids')
family_street = fields.Char(related='family_id.street')
family_street2 = fields.Char(related='family_id.street2')
@ -40,7 +39,7 @@ class ResPartner(models.Model):
family_id = fields.Many2one('golem.family', string='Family', index=True)
family_role = fields.Many2one('golem.family.role', string='Role',
index=True)
family_count = fields.Integer('Family Count', related='family_id.count')
family_count = fields.Integer(related='family_id.count')
@api.multi
def button_family_members(self):
@ -59,11 +58,10 @@ class ResPartner(models.Model):
if member.family_id and not any((member.lastname, member.street, \
member.street2, member.zip, member.city)):
member.update({'lastname': member.family_id.name,
'street': member.family_id[0].street,
'street2': member.family_id[0].street2,
'zip': member.family_id[0].zip,
'city': member.family_id[0].city
})
'street': member.family_id.street,
'street2': member.family_id.street2,
'zip': member.family_id.zip,
'city': member.family_id.city})
class GolemMember(models.Model):
""" Member adaptations """
@ -98,25 +96,25 @@ class GolemFamily(models.Model):
def _get_default_nationality_id(self):
return self.env.ref('base.main_company').country_id
name = fields.Char('Name', index=True, required=True)
street = fields.Char('Street')
street2 = fields.Char('Street2')
zip = fields.Char('Zip')
city = fields.Char('City')
name = fields.Char(index=True, required=True)
street = fields.Char()
street2 = fields.Char()
zip = fields.Char()
city = fields.Char()
state_id = fields.Many2one('res.country.state', 'State',
ondelete='restrict')
country_id = fields.Many2one('res.country', 'Country',
ondelete='restrict',
default=_get_default_nationality_id)
phone = fields.Char('Phone')
mobile = fields.Char('Mobile')
email = fields.Char('Email')
website = fields.Char('Website')
phone = fields.Char()
mobile = fields.Char()
email = fields.Char()
website = fields.Char()
member_ids = fields.One2many('res.partner', 'family_id', 'Members',
domain=[('is_company', '=', False)])
note = fields.Text('Note')
count = fields.Integer('Count', compute='_compute_count', store=True)
note = fields.Text()
count = fields.Integer(compute='_compute_count', store=True)
@api.depends('member_ids')
def _compute_count(self):
@ -124,7 +122,7 @@ class GolemFamily(models.Model):
family.count = len(family.member_ids)
@api.onchange('member_ids')
def onchange_member(self):
def onchange_members(self):
""" Sets as member address if there was no precedence """
for family in self:
if family.member_ids and not any((family.street, family.street2,\
@ -132,8 +130,7 @@ class GolemFamily(models.Model):
family.update({'street': family.member_ids[0].street,
'street2': family.member_ids[0].street2,
'zip': family.member_ids[0].zip,
'city': family.member_ids[0].city
})
'city': family.member_ids[0].city})
class GolemFamilyRole(models.Model):
""" GOLEM Family Role """

View File

@ -26,7 +26,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
<field name="inherit_id" ref="golem_member.golem_member_form" />
<field name="arch" type="xml">
<field name="lastname" position="before">
<field name="family_id" invisible="1" />
<field name="family_id" />
<field name="family_role" />
</field>
<page name="other_page" position="before">
@ -64,7 +64,8 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
</group>
</group>
</group>
<field name="family_member_ids" context="{'default_family_id': active_id}">
<field name="family_member_ids"
context="{'default_family_id': active_id}">
<tree delete="false">
<field name="name" />
<field name="family_role" />
@ -78,14 +79,14 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
</field>
</record>
<!-- searches -->
<record model="ir.ui.view" id="golem_family_search_inherit_golem_membership">
<field name="name">GOLEM family search adaptations</field>
<!-- Searches -->
<record model="ir.ui.view" id="golem_member_search_inherit_golem_family">
<field name="name">GOLEM Member search adaptations</field>
<field name="model">golem.member</field>
<field name="inherit_id" ref="golem_member.golem_member_search" />
<field name="arch" type="xml">
<field name="name" position="after">
<field name="family_id" string="Family" />
<field name="family_id" />
</field>
</field>
</record>

View File

@ -43,7 +43,6 @@ class ResPartner(models.Model):
is_member = fields.Boolean('Is member', compute='_compute_is_member')
member_number = fields.Char('Member number', related='member_id.number')
@api.depends('member_id')
def _compute_is_member(self):
""" Computes is member """
@ -81,7 +80,6 @@ class GolemMember(models.Model):
partner_id = fields.Many2one('res.partner', required=True, index=True,
ondelete='cascade')
@api.model
def _default_season(self):
""" Get default season """