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
Odoo Training Center
|Asked: 4/25/13, 6:42 AM|
|Seen: 3418 times|
|Last updated: 3/16/15, 8:10 AM|