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.

0

Print delivery Order report

By
Ankit Gauri
on 6/16/15, 3:39 AM 565 views

hello i am trying to print report  that is already created now i want to print that report on button through method so i am trying following but its not working

def get_assortment(self, cr, uid, ids, context=None): picking_obj = self.pool.get("stock.picking")

        domain = [('assort_id', 'in', ids)]

        del_order_ids= picking_obj.search(cr, uid, domain,context=context)    

        del_record = picking_obj.browse(cr, uid, del_order_ids, context=context)

          datas = {  'active_ids': del_order_ids,

                        'active_model': 'stock.picking', }

       return self.pool['report'].get_action(cr, uid, del_record.id, 'stock.report_picking', data=datas, context=context) // it genrates only pdf no data inside



1
Virali
On 6/17/15, 3:11 AM

If you want to print report using get_action method you need to pass ids of model 'stock.picking' and model name('stock.picking).

 STEPS:

--> First search stock picking ids which comes in given assortment like:

as you are in soortment object you can take ids[0].

pick_ids = self.pool.get('stock.picking').search(cr, uid, [('assortment_id', '=', ids[0])], context=context)

--> Then simpaly just return report using get_action 

return self.pool.get('report').get_action(cr, uid, pick_ids, 'stock.report_picking', context=context)


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: 6/16/15, 3:39 AM
Seen: 565 times
Last updated: 6/17/15, 8:26 AM