Reputation: 721
I am overriding print picking button in warehouse. But the requirement is that it should show a popup which has selection field as sort. then grab that value from user and print report based on the value passed. below is my tried code, but it does not work.
Overridden function for click on print picking list button:
def do_print_picking(self, cr, uid, ids, context=None):
return {
'name':'input sort report',
'view_type':'form',
'view_mode':'form',
'res_model':'my.report',
'type':'ir.actions.act_window',
'target':'new',
'context':None,
}
This opens a blank page. How to achieve below stated requirement.
Then i want to get sort value from that popup and print the report by passing the value. i am able to print the report without popup. only need to intercept to show popup and get input from user.
The field in the popup is not stored in database. only need a value of sort selected by user to send to the report
Please help me. Thanks,
Upvotes: 1
Views: 730
Reputation: 702
Odoo can't show a form view if it hasn't got an id. you should add res_id to your return dict.
for example:
return {
'name':'input sort report',
'view_type':'form',
'view_mode':'form',
'res_model':'my.report',
'res_id : ids[0],
'type':'ir.actions.act_window',
'target':'new',
'context':None,
}
This code might work for you. If not you should find a method to get the correct id.
Upvotes: 0