Questions tagged [one2many]

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.

75 questions
1
vote
1 answer

How to update all values of One2many field in Table for Odoo10

I have a One2many field in inventory for product pack. And I want that all fields values of that One2many field should update in fields of One2many field in sales order, row and column wise. So, Anyone can help me. My Python code is here: class…
Pawan Kumar Sharma
  • 1,168
  • 8
  • 30
1
vote
1 answer

Odoo One2Many table creates line when pressing enter

I made a relational table in my own created object called typology. here's how the thing works there’s a field in which you have to enter something like 1+1 or 2+3+4 and for each number in this field lines are created on this typology table, so the…
Rui Vieira
  • 23
  • 3
1
vote
1 answer

odoo 9 how to add relational field to pivot view?

I'm customizing Project's pivot view to show timesheet description along with task's name. here is my code below but when I click pivot view it shows an error
Eric Lee
  • 700
  • 2
  • 9
  • 30
1
vote
1 answer

Odoo set specific domain on xml file

I made a custom button whick call a view: @api.multi def split_bot(self): view = self.env.ref('purchase_request.view_supply_conditions_tree') context = self.env.context return { 'name':blabla', 'type':…
fueggit
  • 859
  • 1
  • 22
  • 44
1
vote
0 answers

One2many field issue Odoo 10.0

I have this very weird issue with One2many field. First let me explain you the scenario... I have a One2many field in sale.order.line, below code will explain the structure better class testModule(models.Model): _name = 'test.module' name =…
maharshi
  • 586
  • 12
  • 30
1
vote
2 answers

Set default value while creating record from one2many field - odoo

I want to set default value for multiple fields while creating records from one2many field, in that default value will be taken from the parent model. Odoo Model Structure class purchase_order(models.Model): _inherit='purchase.order' …
0
votes
1 answer

odoo One2Many relation problem between 2 addons

i want to link 2 models of 2 diffrent addons i put one of them in the depends listin the manifest file but i had an error: here is the code: class Employee(models.Model): _name = 'prof.zaouia.employee' image = fields.Binary() name =…
0
votes
3 answers

Update one2many form view based on onchange

I assign for each project many tasks into task view form by using many2one field related project model. Then i create one2many field into project model to retrieve tasks directly into project View form, and into the code i'm looping from all the…
Sadiki Ayoub
  • 101
  • 1
  • 10
0
votes
1 answer

Counting Rows of one2many field odoo

How can I count the rows of a one2many field and output the current row count ? This is how it should work.For example: 1 ------column1------------ 2 ------column2------------ 3 ------column3------------ 4 ------Column4------------ etc.. I have made…
kayalotta
  • 53
  • 9
0
votes
1 answer

Update records on one2many fields in wizard for odoo16

Geting Issue 'TypeError: unhashable type: 'dict' for insert values in one2many field from onchange method in odoo16 My code is below: class EmployeeAddWizard(models.TransientModel): _name = 'employee.add.wizard' line_ids =…
Pawan Kumar Sharma
  • 1,168
  • 8
  • 30
0
votes
0 answers

Count of O2M relations with condition

My question will be linked with SQL, Python and SQLAlchemy I've got 3 models in database: Department ---------- id: int name: varchar Employee -------- id: int name: varchar email: varchar department: FK to Depratment table Report ------ id:…
kevlinsky
  • 3
  • 2
0
votes
0 answers

Odoo: Create function creates multiple subscriptions, but I only want one subscription to be created

My Code is creating multiple subscriptions right now and it is confusing and not expected. I am trying to create a subscription from a sales order, while odoo does provide that automatically in my cas I am creating a subscription from a sales order…
0
votes
1 answer

On a button click show the products in a one2many field in another one2many field in a different model

I am trying to access a one2many field from a specific model and display it in another one, both models already exist and I am applying few changes to them. I inherited the first model and added a button to it and upon pressing it, this button…
0
votes
1 answer

Odoo - Iterate through field, take the values and put them in a new field

Hay I am new to Odoo Customizing and Python and wanted to know how I can iterate through a field and take the values out of the field and put them in a new one. The field I want to iterate through contains multiple email adresses. I want to iterate…
kayalotta
  • 53
  • 9
0
votes
0 answers

Why many2one field in one2many is a littlte spacing odoo13

I have 13 column in my one2many field and I can't reduce cause of requirement. The problem is my many2one column is very less space. When I remove some column , many2one field take perfect column width.But I can't reduce. How can I do that? I try to…
Neural
  • 370
  • 1
  • 11