0

I have a button that will print a report ( view Qweb ) but when i press the button to print on the form I get the following message:

TypeError: print_report() takes at least 6 arguments (5 given)

The button that I have in view is as follows:

And the function that is used to print is:

@api.v7

def print_report(self, cr, uid, ids, context=None):

    if context is None:

        context = {}

    data = {}

    data['ids'] = context.get('active_ids', [])

    data['model'] = context.get('active_model', 'ir.ui.menu')



    return self.pool['report'].get_action(cr, uid, [], 'custom_module.report_pricelist', data=data, context=context)

PLease help me with this. Thanks.

4

1 に答える 1

0

こんにちは、decorate を使用しないでください。新しい API を使用している場合は、次のようにします。

def print_report(self, data):    
    return self.env['report'].get_action(self, 'custom_module.report_pricelis', data=data)

お役に立てば幸いです。

于 2016-03-04T06:37:58.067 に答える