In v7 i could fill the one2many field with the following code, without creating an entry in the datebase.
from_template = self.pool.get('mrp.eq_routing_template').browse(cr, uid, routing_template, context)
wclist = []
#Creates the workcenter.lines and saves them in a list.
for workcenter in from_template.eq_workcenter_lines:
wc_vals = {
'workcenter_id': workcenter.eq_workcenter_id.id,
'name': workcenter.eq_name,
'sequence': workcenter.eq_sequence,
'cycle_nbr': workcenter.eq_cycle_nbr,
'hour_nbr': workcenter.eq_hour_nbr,
'note': workcenter.eq_note,
}
wclist.append((wc_vals))
#Data for the return
vals_from_template = {
'name': from_template.eq_name,
'active': True,
'code': from_template.eq_code,
'note': from_template.eq_note,
'location_id': from_template.eq_location_id.id,
'workcenter_lines': wclist,
}
return {'value': vals_from_template}
When i use this on_change Method with v8 it creates empty lines.
How am I able to do the same in v 8.0?