Odoo Help


How to add custom product export to sidebar?

on 2/11/13, 10:45 AM 1,851 views

I want to add a new menu item to the right side menu in the product list. When the menu item is clicked I want to call a method on the server which packs a zip file of the images of the selected products and offers it to the user as a download.

I got a general idea of some of the necessary steps, but I can't quite manage to put it all together.

I found how to add a menu item to the side menu:

      context="{'product_id': active_id}"
      name="Custom Export"

And I found that returning an act_url will let me redirect the user to where I want them to be:

class custom_export(osv.osv_memory):
  _name = 'custom_export'

  def export(self,cr,uid,ids,context={}):
    return {
    'type': 'ir.actions.act_url',
    'url': "link removed due to karma",
    'target': 'new'


Once I figure out how to call the method from the menu item the rest won't be a problem, just add code to create the file and return the file's location as the URL. But how can I connect these two things, the menu item and the method?

I read and tried some things with regular actions, server actions and wizards, but nothing I did solved the problem. Unfortunately I didn't find any good documentation on this kind of problem.


Andreas Brueckl

--Andreas Brueckl--

| 7 8 7
Vienna, Austria
--Andreas Brueckl--
OpenERP Consulting and Development
Andreas Brueckl
On 3/10/13, 5:20 AM

I assume that you are using version 6.0. Please correct me if my assumption is not correct.

OpenERP models must contain at least one "." in their name. So you have to change custom_export to custom.export in both, python and XML file.

About This Community

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


Odoo Training Center

Access to our E-learning platform and experience all Odoo Apps through learning videos, exercises and Quizz.

Test it now

Question tools

1 follower(s)


Asked: 2/11/13, 10:45 AM
Seen: 1851 times
Last updated: 3/16/15, 8:10 AM