Odoo Help

Welcome!

This community 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.

1

Popup in OpenErp??

By
Drees Far
on 12/1/15, 8:47 AM 602 views

hello everybody!!!

I work with Popups in OpenERP.

So, when i click on a button i open a new window which is of an other created model.

The problem here is that i want:

-When i click on save or not close the window,

-Put default values in the popup

-Create a report for the open window.

Here is my code:

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'])
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': 'Solde De Tout Compte',
'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_date_from':momo_id[0]['date_from'],'default_date_to_id':momo_id[0]['date_to']},
'type': 'ir.actions.act_window',
'nodestroy': True,
'target': 'new',
'flags' : { 'action_buttons' : True,},
'res_id': ref_id,
}

Who can help please.

Thanks a lot in advance.

Best Regards.

1
Mirco Strizzi
On 12/5/15, 2:04 PM

Hi @DressFar, you can create a wizard:

https://doc.openerp.com/v6.1/developer/04_wizard/


0

Serpent Consulting Services Pvt. Ltd.

--Serpent Consulting Services Pvt. Ltd.--
4341
| 6 6 8
Gandhinagar, India
--Serpent Consulting Services Pvt. Ltd.--

Serpent Consulting Services Pvt. Ltd. Your Odoo/OpenERP Solution, just an email away!

Serpent Consulting Services Pvt. Ltd.
On 12/7/15, 9:26 AM

You may see

https://www.odoo.com/apps/modules/8.0/popup_reminder/

Thanks.


Your Answer

Please try to give a substantial answer. If you wanted to comment on the question or answer, just use the commenting tool. Please remember that you can always revise your answers - no need to answer the same question twice. Also, please don't forget to vote - it really helps to select the best questions and answers!

About This Community

This community is for professionals and enthusiasts of our products and services. Read Guidelines

Question tools

1 follower(s)

Stats

Asked: 12/1/15, 8:47 AM
Seen: 602 times
Last updated: 12/7/15, 9:26 AM