Skip to Content
Menu
This question has been flagged
1 Reply
1782 Views
Help me to convert to odoo 10

def raw_confirm(self, cr, uid, ids, context=None):
child_line = self.pool.get('rutile.quality.line.item')
for id_val in ids:
search_val = self.pool.get('rutile.quality.line.item').search(cr,uid,[('parent_id', '=', id_val)],context=context)
for line in self.pool.get('rutile.quality.line.item').browse( cr, uid, search_val):
child_line.write(cr, uid, line.id, {'state': 'waiting_approve'})
return self.write(cr, uid, ids, {'state': 'waiting_approve'}, context=context)

def onchange_grade_chemical(self, cr, uid, ids, grade, context=None):
product_grade_obj = self.pool.get('production.product_grade')
ls = []
bo_id = product_grade_obj.search(cr, uid, [('id','=',grade)])
for li in product_grade_obj.browse(cr, uid, bo_id):
for line in li.chemical_line_ids:
result = {'standard_from':line.standard_from,'standard_to':line.standard_to,'name':line.name.id,'sequence':line.sequence}
ls.append(result)
if grade:
return {'value': {'rutile_chemical_line_ids':ls}}
help me?
Avatar
Discard
Best Answer
Hi,
You can convert method like this

@api.multi
def raw_confirm(self):
child_line = self.env['rutile.quality.line.item']
for id_val in ids:
search_val = self.env['rutile.quality.line.item'].search([('parent_id', '=', id_val)])
for line in self.env['rutile.quality.line.item'].browse(search_val.id):
            child_line_id = child_line.browse(line.id)
child_line_id.write({'state': 'waiting_approve'})
return self.write({'state': 'waiting_approve'})




Best of Luck
Avatar
Discard
Related Posts Replies Views Activity
2
Apr 18
6841
2
Nov 24
25096
2
May 24
5519
3
Mar 24
4964
0
Mar 24
262