Bỏ qua để đến Nội dung
Menu
Câu hỏi này đã bị gắn cờ
215 Lượt xem

Hi guys!!!

Please who can help me.

I have this function which let you select from a manyone field and then will copy all the line of this selected object in the class. It works fine but it doesnt display line in the class please help.

I work with odoo v8.

 def add_service(self,cr,uid,ids,context):
services = self.pool.get('project.service.line')
for element in self.browse(cr,uid,ids,context):
if not element.select_service_id:
continue
service_id = element.select_service_id.service_id
unit_service = element.select_service_id.unit_service
ext_service = element.select_service_id.ext_service
int_service = element.select_service_id.int_service
int_service_unit = element.select_service_id.int_service_unit
ext_service_unit = element.select_service_id.ext_service_unit
service_type = element.select_service_id.service_type
service_condition = element.select_service_id.service_condition
project_id = element.id,
project_service = element.select_service_id.id
value = {
'project_id' : project_id[0],
'project_service' : project_service,
'service_idd': service_id,
'ext_services': ext_service,
'unit_services': unit_service,
'int_services': int_service,
'int_services_unit': int_service_unit,
'ext_services_unit': ext_service_unit,
'service_type': service_type,
'service_condition': service_condition,
'service_mode' : 'prepaid',
'state_service' : 'active',
}
self.write(cr,uid,element.id,{'select_service_id': False},context)
services.create(cr,uid,value) 
print ('------------------------add_service-------------------')
return True


Ảnh đại diện
Huỷ bỏ

Is this method called onchange of a field?

Bài viết liên quan Trả lời Lượt xem Hoạt động
0
thg 4 24
1878
4
thg 11 23
5999
0
thg 10 23
1744
0
thg 12 22
2637
2
thg 12 23
19361