Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

odoo - add one2many field programmatically

def action_create_estimation_lines(self):
  default_fases = ['Analysis','Functional Design','Development','Testing', 'Server Push']
  count = 1
  estimation_lines = []

  for fase in default_fases:
    estimation_line = {'analyse_line_id':self.id,'name':fase,'sequence':count}
    count = count + 1
    estimation_lines.append((0,0, estimation_line))
  self.estimation_line_ids = estimation_lines
 
PREVIOUS NEXT
Tagged: #odoo #add #field #programmatically
ADD COMMENT
Topic
Name
7+1 =