Odoo is the world's easiest all-in-one management software. It includes hundreds of business apps:
CRM | e-Commerce | Accounting | Inventory | PoS | Project management | MRP | etc.
I need to filter a content of 2 relational fields
My case is I have Person that have enemy list and only one best friend.
It is required that one person can not be a friend and an enemy of another.
So I need if person is in the enemy list to not be shown in the best friend selection and
the opposite if a person is best friend to not be shown in enemy selection
Also that a person can not be best friend and enemy to it self.
# -*- coding: utf-8 -*-
from openerp import models, fields, api
_name = 'Person'
_description = 'Person is a human being with a name’
name = fields.Char('Name')
enemyRecordset = fields.Many2many(comodel_name='person',
bestFriendRecordset = fields.Many2one('person', 'Best Friend’)
<!-- Must not contain person it self and best friends -->
<field name="enemyRecordset" />
<!-- Must not contain person it self and enemies -->
<field name="bestFriendRecordset" />
About This Community
This platform is for beginners and experts willing to share their Odoo knowledge. It's not a forum to discuss ideas, but a knowledge base of questions and their answers.Register
Odoo Training Center
Access to our E-learning platform and experience all Odoo Apps through learning videos, exercises and Quizz.Test it now
|Asked: 8/5/15, 9:59 AM|
|Seen: 703 times|
|Last updated: 8/5/15, 9:59 AM|