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
0
votes
2 answers

How to add new record to One2Many field automatically via create function in different model?

I have written a method _update_config_list which should automatically be called when a record has been created in account.analytic.line. This method should create a new record in the One2Many field if the Employee is not found in the One2Many field…
for-loop
  • 47
  • 1
  • 8
0
votes
1 answer

How to copy one2many filed in odoo?

I have problem with copy one2many field. I create assignment field for Project: assignment_ids = fields.One2many( string='Project Assignments', comodel_name='project.assignment', inverse_name='project_id', …
Tung Van
  • 15
  • 4
0
votes
1 answer

How Can i set track visibility for One2many Fields ? Odoo 10

Hi i want to set track_visibility for one2many fields by set : track_visibility='onchange' but it doesn't work. This is my code: class TransportManagement(models.Model): _name = 'transport.management' _inherit = ['mail.thread'] …
0
votes
1 answer

Filter one2many with dynamic values in interface

Take this scenario: class Model1(models.Model): _name = "model1" _description = "Model 1" custom_field = fields.One2many( 'model2', 'registration', ) class Model2(models.Model): _name = "model2" _description = "Model 2" …
0
votes
1 answer

Set the filter for one2many list showing based on the condition of many2one field? (Odoo 13)

Im trying to set the filter for one2many list showing based on the condition of many2one field. model_a.py : name = fields.Many2one('hr.employee') keya = fields.Many2one('model.b') num_a = fields.Monetary() model_b.py: name =…
Leon Nguyen
  • 187
  • 1
  • 16
0
votes
0 answers

how i can pass a parent value to a one 2 many and used in an if in odoo 12

I have this code I need if currency is MXN I can choose MXN and USD in presu_detalle, but if in presupuesto currency_id is USD I can't choose nothing and currency_id in presu_detalle would be USD by default, I tried to pass the value in the context…
Lomba
  • 3
  • 3
0
votes
1 answer

How to create a record for field using many2one in Odoo 13?

I have 3 models. I used One2many field o put the tree view of model 3 in form view of model 1 and 2. 1/ bao_hiem.py with one2many field: lstd_baohiem = fields.One2many('lich.su', 'name') thamchieu = fields.Char('Tham chiếu') 2/ dieu_chinh.py…
Leon Nguyen
  • 187
  • 1
  • 16
0
votes
1 answer

ODOO - How to update two levels o2m fileds relation

Odoo community version 11.0-20190311 I have a parent class (dt_tst001) with a o2m field (itens) related to a class (dt_tst002), with another o2m field (tributos) related to a third class (dt_tst003). In the parent class there is another field…
0
votes
1 answer

How to inherit One2many field in Odoo 12?

I've created a module "school" in which I have a One2many field "remarks_lines_ids", now I want this "remarks_lines_ids" field to be inherit in "sale" module (addons). I tried this by the way. #School Module........student.py class…
0
votes
2 answers

V10 Passing One2Many values into Transient Model One2Many (TypeError from onchange & DataError from default)

I'm customizing a module for hr.payroll that registers payment for the payslip, starting with a Register Payment wizard that then passes the data to account.payment when validated for the check to be printed. All other fields like memo and…
0
votes
1 answer

Odoo display multiple wizards using tree view

I have a form with a tree view. Each line has a button to open a wizard containing informations about the line. This first wizard contains also a tree view and each line of it has a button to trigger the opening of another wizard (second one). But…
Mssm
  • 717
  • 11
  • 29
0
votes
0 answers

One2many relationship in Odoo model linked to self can't add record

I'm currently using Odoo 12.0+e-20181025. At the moment I'm using the Helpdesk module and have been trying to modify it so that it can have a child ticket from another ticket. At first, I was just going to make it choose an existing ticket, but then…
shad12ow
  • 169
  • 6
0
votes
0 answers

Sending data from a one 2 many field of a parent class to a wizard opens from a button click in the parent class

I need to send data in a one2many field of a form to a a one2many field of a wizard [opens on a button click].. the wizard contains a one2many field of same format.. How to acheive this?? Parent CLass class wrhouse(models.Model): wproductlist =…
0
votes
0 answers

Create custom search view to search based on two fields in one2many field along with the other fields present in the module

I created a module for managing employee resume in Odoo. Employees will fill their work_experience, education, technology-wise experience, etc. I wanted to make the search view search for all these parameters. The technology-wise Experience here is…
0
votes
1 answer

odoo: it's not possible to make a line invisible on one2many?

I am traying to make some lines (one2many stock.move) invisble based on a field filtre_project (in stock.picking). I tried using domain as:
m3asmi
  • 1,252
  • 1
  • 16
  • 36