Odoo Help

0

open another form, from custom module

By
Joaquin
on 6/6/13, 12:35 PM 3,238 views

I have a custom program, I need the function call, send me another form. I have a view based on settings, I read an XLS file, and load me into a temporary table. Once done, I need to open another view to display the data loaded for the user to review and if you agree to be stored in the final table based on business logic. I have everything already operational and running, except for the part to send the form data loading. If instead of return True, I put this:

return {
'name': 'Data Loaded',
'view_type': 'tree',
'view_mode': 'tree',
'res_model': 'excel.datosembarque'
'view_id': False,
'type': 'ir.actions.act_window'
}

GTK client closes giving an error that the RETURN bad.

0
Joaquin
On 6/11/13, 6:51 AM

Hello. I solved opening the form, but I only work in web client and gtk client fails.

cr.execute("select * from ir_model_data where name = 'excel_dembarque_form'")
tree_obj_id = cr.dictfetchall()[0]['res_id']
cr.execute("select * from ir_model_data where name = 'excel_dembarque_form'")
form_obj_id = cr.dictfetchall()[0]['res_id']

return {
'domain': str(domain),
'name': 'Ver Datos Cargados',
'view_type': 'form',
'view_mode': 'tree,form',
'res_model': 'excel.datosembarque',
'views': [(tree_obj_id,'tree'),(form_obj_id,'form')],
'type': 'ir.actions.act_window'
}

At the end of a file upload form based on some parameters and should be uploaded and inserted into another table data differently, and once the information has been inserted, it should be displayed.

Any can help me please?

0

Borni DHIFI

--Borni DHIFI--
5172
| 6 8 9
Tunis, Tunisia
--Borni DHIFI--

Techno Functional Consultant Odoo(OpenERP) 

http://www.linkedin.com/in/borni

Skype : dhifi.borni

Borni DHIFI
On 6/6/13, 7:51 PM

Hi,

If you want to redirect to another object you just need to return dictionary with the syntax :

return {
    'name':_('Name of the form'),
    'view_mode': 'form',
    'view_id': False,
    'views': [(resource_id,'form')],
    'view_type': 'form',
    'res_id' : res_id, # id of the object to which to redirected
    'res_model': 'object.name',
    'type': 'ir.actions.act_window',
    'target': 'new', #  open the form in new tab
}

not you want to tell me: "[(resource_id, 'form')]": is not equal to: [('tree', 'form')], And the: 'res_id': res_id, # id of the object to Which to redirected the 'res_id' is the id of "<record model="ir.ui.view" id="excel_dembarque_form">"?

Joaquin
on 6/7/13, 6:58 AM

Hello<br/>

Joaquin
on 6/11/13, 6:45 AM

About This Community

This platform is for beginners and experts willing to share their Odoo knowledge. It's not a forum to discuss ideas, but a knowledge base of questions and their answers.

Register

Odoo Training Center

Access to our E-learning platform and experience all Odoo Apps through learning videos, exercises and Quizz.

Test it now

Question tools

1 follower(s)

Stats

Asked: 6/6/13, 12:35 PM
Seen: 3238 times
Last updated: 3/16/15, 8:10 AM