[TMP] change metode onchange_member

This commit is contained in:
michel 2018-01-22 12:37:06 +01:00
parent 3c795728b5
commit e5cf4ad9d4
2 changed files with 6 additions and 13 deletions

View File

@ -98,12 +98,12 @@ class GolemFamily(models.Model):
for family in self:
family.count = len(family.member_ids)
# @api.onchange('member_ids')
# def onchange_member(self):
# """ Sets as member address if there was no precedence """
# for family in self:
# if not any({'family.street': False}):
# self.update({'family.street': family.member_ids.street})
@api.onchange('member_ids')
def onchange_member(self):
""" Sets as member address if there was no precedence """
for family in self:
if not any ({'family.street': True}):
self.update({'family.street': family.member_ids.street})
class GolemFamilyRole(models.Model):
""" GOLEM Family Role """

View File

@ -34,13 +34,6 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
<tree string="Family">
<field name="name" />
<field name="family_role" />
<field name="street" placeholder="Street..." />
<field name="street2" />
<field name="zip" placeholder="ZIP" />
<field name="city" placeholder="City" />
<field name="phone" />
<field name="mobile" />
<field name="email" widget="email" />
</tree>
</page>
</notebook>