Is there any way to use one2many field without declaring it in a class? I
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
This question has been flagged
hi,
Please go through this link
https://www.odoo.com/nl_NL/forum/help-1/question/show-tree-view-inside-a-note-book-page-22944
Thank you for responding,it is not clear and what i want to know is whether we can use a one2many field without declaring it in a specified class?
friend did you find an answer to your problem
#--------------- Class 2----------------
class class2(models.Model):
_name = 'class2'
_description = 'Class 2'
item_order_line = fields.Many2one('class1','Item')
item_id = fields.Char('Item Number')
item_title = fields.Char('Item Title')
quantity_ordered = fields.Integer('Quantity')
sale_price = fields.Char('Sale Price')
#----------------- Class 1 -----------------
class class1(models.Model):
_name = 'class1'
_description = 'Class 1'
_inherit = ['class2']
#------------------ o2m -----------------
order_line = fields.One2many('class2','item_order_line',string='Order Lines')
Example ;)
Enjoying the discussion? Don't just read, join in!
Create an account today to enjoy exclusive features and engage with our awesome community!
Sign upRelated Posts | Replies | Views | Activity | |
---|---|---|---|---|
|
1
Aug 23
|
12549 | ||
change password
Solved
|
|
1
Aug 23
|
11054 | |
|
1
Jul 23
|
7228 | ||
|
4
Apr 23
|
8677 | ||
|
2
Feb 23
|
17600 |