Browse Source

[FIX] agreement: Issue #290

pull/293/head
Maxime Chambreuil 6 years ago
parent
commit
a118dc7141
  1. 2
      agreement/models/agreement_appendix.py
  2. 2
      agreement/models/agreement_clause.py
  3. 2
      agreement/models/agreement_recital.py
  4. 2
      agreement/models/agreement_section.py

2
agreement/models/agreement_appendix.py

@ -51,7 +51,7 @@ class AgreementAppendix(models.Model):
@api.onchange('field_id')
def onchange_sub_object_id(self):
if self.field_id:
if self.field_id and self.field_id.relation:
self.sub_object_id = self.env['ir.model'].search(
[('model', '=', self.field_id.relation)])[0]

2
agreement/models/agreement_clause.py

@ -60,7 +60,7 @@ class AgreementClause(models.Model):
@api.onchange('field_id')
def onchange_sub_object_id(self):
if self.field_id:
if self.field_id and self.field_id.relation:
self.sub_object_id = self.env['ir.model'].search(
[('model', '=', self.field_id.relation)])[0]

2
agreement/models/agreement_recital.py

@ -52,7 +52,7 @@ class AgreementRecital(models.Model):
@api.onchange('field_id')
def onchange_sub_object_id(self):
if self.field_id:
if self.field_id and self.field_id.relation:
self.sub_object_id = self.env['ir.model'].search(
[('model', '=', self.field_id.relation)])[0]

2
agreement/models/agreement_section.py

@ -51,7 +51,7 @@ class AgreementSection(models.Model):
@api.onchange('field_id')
def onchange_sub_object_id(self):
if self.field_id:
if self.field_id and self.field_id.relation:
self.sub_object_id = self.env['ir.model'].search(
[('model', '=', self.field_id.relation)])[0]

Loading…
Cancel
Save