A one-to-many relationship in a database occurs when each record in Table A may have many linked records in Table B, but each record in Table B may have only one corresponding record in Table A. A one-to-many relationship in a database is the most common relational database design and is at the heart of good design.
Questions tagged [one2many]
75 questions
1
vote
0 answers
Odoo13: nested One2many field in UI
Good afternoon, colleagues,
I'm trying to create a proper form UI for a model that contains nested One2many field with depth = 2. Here is shortened code listing:
class ModelA(models.Model):
v_enabled = fields.Boolean(…

Alexey Goncharov
- 21
- 2
1
vote
2 answers
Add values on One2many field onchange
I'm trying to add values in my one2many field onchange.
I tried using the [(0,0, {values})] but nothing happened. Any idea on how to implement it?
custom_line_ids = fields.One2many('mrp.production', 'product_id', 'Custom Line') …

Kai Ning
- 159
- 9
1
vote
1 answer
Is it possible to hide/invisible notebook page based on states? (Odoo 13)
I have the notebook page and 4 states in the form view.
I want the notebook page just to show in states 1 and 2 when clicking the wizard button. But when it changes to states 3 and 4, it will be hide/invisible.
So is it possible to do it?
Please…

Leon Nguyen
- 187
- 1
- 16
1
vote
1 answer
How to save one2many field in set_values method odoo 14
I am using odoo 14 and added one2many field in 'res.config.settings'. But this field value show false when save this res.config.settings form.
Below is my code:-
class ProjectResConfigSettings(models.TransientModel):
_inherit =…

Pawan Kumar Sharma
- 1,168
- 8
- 30
1
vote
0 answers
Odoo - one2many relation - updating fields on child table
I have a main model with a one2many field, linked to a secondary model, which also has a one2many field, linked to a third model.
How can I update values on the third model using onchange event of a field on the main model?
This is a short version…

Wallace Muniz
- 11
- 2
1
vote
0 answers
widget radio not working in one2many line odoo
Need to add widget radio to a field in one2many line in Odoo 12 community,
My code
…

Thayif kabir
- 715
- 5
- 20
1
vote
1 answer
Sum selected records in one2many field odoo12
i Have the following models
class WorkStation(models.Model):
_name = 'dlc.workstation'
_description = 'list of work station'
production_ids = fields.One2many(comodel_name="dlc.pdetails", inverse_name="workstation_id", string="Production",…

Dominic Anyanna
- 13
- 3
1
vote
1 answer
How to save One2many fields values?
I am adding custom One2many field in sale.order form view just below the sale.order.line.
I am computing values on_change it is displaying values but when I am going to save the sales order it is generating error that
ValueError: Wrong value for…

Adam Strauss
- 1,889
- 2
- 15
- 45
1
vote
1 answer
Value not update in one2many field with compute method Odoo12
My below method for value insertion in one2many field works with the onchange method and the compute method with depends decorator. But my requirement not full-fill with depends decorator. My method should work with view load. At present method…

Pawan Kumar Sharma
- 1,168
- 8
- 30
1
vote
1 answer
How to bind value from one2many dropdown data to column field in odoo 12?
i trying to add field named "price" from one2many dropdown relationship to the parent table, which is i relate the second table with many2one relationship? can i do this? if yes, how to do this?
here is my salesorder class code :
# -*- coding: utf-8…

Ke Vin
- 3,478
- 11
- 60
- 91
1
vote
2 answers
one2many in kanban nothing is displayed
I am using Odoo 12. I don't have access to Odoo's Python part, only the Odoo developer mode. I installed the web_one2many_kanban module but apart from the images and the id of the lines of my one2many, I can not display the rest of the data.
My…
1
vote
0 answers
How to Add a popover in a specific sale order line column, in the xml view? Using One2ManyListView js inheritance?
I want to show a popover in a specific sales order line column, like shown in the first screenshot here : https://ibb.co/n0FP1Jf
I tried to show a popover by inheriting the Javascript class FieldOne2Many and One2ManyListView, this trick is working…

Zoubida
- 11
- 2
1
vote
0 answers
How to shift tree view column string on right side for Odoo
i Have problem related to UI. i want to shift sale order line tree view column string on right side. So, Is there any solution for this problem. I'm using Odoo 10.
I'm also attaching screenshot below related to problem.
PFA

Pawan Kumar Sharma
- 1,168
- 8
- 30
1
vote
2 answers
Issue with editing Odoo 11 One2many computed field
When I edit a record from this field (code below), it doesn't save for some reason. It's a computed field, linking to res.partner records. If I edit it and click save, it doesn't save at all (no changes in the database and/or if I hard refresh the…

foo
- 21
- 1
- 4
1
vote
0 answers
Button readonly when adding in one2many field on wizard for Odoo 10
I have a wizard in sale order form. On this wizard i added a "button" field in one2many field, but it show no click-able action or it is readonly. and this accidence happen only for button field, other fields are work well. So, Why it is readonly…

Pawan Kumar Sharma
- 1,168
- 8
- 30