[IMP]GOLEM Family : limit families choice to persons

This commit is contained in:
Fabien Bourgeois 2016-07-13 20:06:35 +02:00
parent 5790393126
commit 35c52a25d5
3 changed files with 4 additions and 3 deletions

View File

@ -74,7 +74,8 @@ class GolemFamily(models.Model):
email = fields.Char('Email')
website = fields.Char('Website')
member_ids = fields.One2many('res.partner', 'family_id', 'Members')
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)

View File

@ -30,7 +30,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
<field name="partner_id" invisible="True" />
</field>
<field name="legal_guardian" position="attributes">
<attribute name="domain">['&amp;', ('is_company', '=', False), ('family_id', '=', family_id), ('id', '!=', partner_id)]</attribute>
<attribute name="domain">['&amp;', ('family_id', '=', family_id), ('id', '!=', partner_id)]</attribute>
<attribute name="options">{'no_create': True}</attribute>
</field>
</field>

View File

@ -24,7 +24,7 @@ class GolemMember(models.Model):
ADULT_DURATION = timedelta(days=365*18)
legal_guardian = fields.Many2one('res.partner', 'Legal guardian',
domain="[('is_company', '=', False)]")
domain=[('is_company', '=', False)])
activities_participation = fields.Boolean('Activities participation?')
is_minor = fields.Boolean('Is minor?', compute='_compute_is_minor',
store=True, default=False)