How to work with pop (wizard) ups in Open ERP?

In fact, i am working with popups in OPenERP.

Here is my function:

def edit_solde(self, cr, uid, ids, employee_id, context=None):
result = []

mod_obj = self.pool.get('ir.model.data')

res = mod_obj.get_object_reference(cr, uid, 'hr_payroll', 'view_hr_payslip_form')

momo_id = self.read(cr, uid, ids,['id','employee_id','date_from','date_to','remaining_leave'])
obj = self.pool.get('hr.payslip')
obj_ids = obj.search(cr, uid, [('employee_id', '=', momo_id[0]['employee_id'][0])])
result = obj.read(cr, uid, obj_ids, ['id'], context)
ref_id = False
for r in result :
ref_id = r['id']
return {
'name': ''Data',
'view_type': 'form',
'view_mode': 'form',
'view_id': [res and res[1] or False],
'res_model': 'hr.payslip',
'context': {'default_employee_id':momo_id[0]['employee_id'][0],'default_seetek_worked_day':int(momo_id[0]['remaining_leave'])},
'type': 'ir.actions.act_window',
'nodestroy': True,
'target': 'new',
'flags' : { 'action_buttons' : True,},
'res_id': ref_id,
}

I have found many dificulties so that i want to ask you.

1- How to pass values to the popup

2-How to make a report to the popup without affecting the original menu

3- How to close the popup when i click on save or cancel

Thanks a lot in advance.

Best Regards.

Answers


You can apply when click on the button (save/cancel) then Example::

**view.xml**


<footer>
    <button name="save" type="object" string="Save" class="oe_highlight"/>
    <button string="Discard" special="cancel"/>
</footer>

def save(self, cr, uid, ids, context): **like name**
    **BODY apply ur code**
    return {'type': 'ir.actions.act_window_close'}

Link 1

Link 2


Need Your Help

Pass data from controller to view using ajax

jquery asp.net ajax asp.net-mvc razor

Hi i select data from database and i want these data pass from my controller to view via ajax but it is not working.

Java Android - How to sort a JSONArray based on keys

java android arrays json sorting

I'm getting this string (from a webservice) into a JSONArray like this,