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.
If I have two models, f.e. : 'my.model.items' and 'my.model' where 'my.model.items' has many2one field to 'my.model' and 'my.model' has one2many field to 'my.model.items'
How could I implement ability to select from existing 'my.model.items' records in 'my.model'?
Re-Edit: Having models as described above, in 'my.model' form I only have functionality to create records in 'my.model.items'. I would like to have functionality in 'my.model' form to select multiple existing records from 'my.model.items', and create a record containing this selection in 'my.model'.
I want to get the same result as Antanas, I have models A and B:
class A (models.Model):
_name = 'example.a'
name = fields.Char(string="Model A")
b_id = fields.Many2one('example.b', string='Model B')
class B (models.Model):
_name = 'example.b'
name = fields.Char(string="Model B")
a_ids = fields.One2many('example.a', 'b_id', string="Models A")
I want to add an item in a_ids from the existing records of A, not create new ones, how can this be achieved ? thanks in advance
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: 4/25/13, 6:42 AM|
|Seen: 3514 times|
|Last updated: 3/16/15, 8:10 AM|