forked from Yaltik/golem
[TMP] change metode onchange_member
This commit is contained in:
parent
3c795728b5
commit
e5cf4ad9d4
@ -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 """
|
||||
|
@ -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>
|
||||
|
Loading…
Reference in New Issue
Block a user