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?
Odoo is the world's easiest all-in-one management software.
It includes hundreds of business apps:
- CRM
- e-Commerce
- Kế toán
- Tồn kho
- PoS
- Project
- MRP
Câu hỏi này đã bị gắn cờ
1
Trả lời
2662
Lượt xem
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
Bạn có hứng thú với cuộc thảo luận không? Đừng chỉ đọc, hãy tham gia nhé!
Tạo tài khoản ngay hôm nay để tận hưởng các tính năng độc đáo và tham gia cộng đồng tuyệt vời của chúng tôi!
Đăng kýBài viết liên quan | Trả lời | Lượt xem | Hoạt động | |
---|---|---|---|---|
|
2
thg 4 18
|
8050 | ||
|
2
thg 7 25
|
4691 | ||
|
2
thg 12 24
|
7810 | ||
How to ORDER BY? [Odoo 10]
Đã xử lý
|
|
2
thg 11 24
|
28603 | |
|
2
thg 5 24
|
7534 |