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.

2

Is it possible to call method on menu?

By
Anirudh Lou
on 10/18/14, 4:22 AM 983 views

Hello, wanna ask if there is a way to call method on a menu. For example, when user click Sales Order i want to execute my custom method. If there is how? Any one knows?

1

Ivan

--Ivan--
3210
| 5 3 6
Jakarta, Indonesia
--Ivan--
Ivan
On 10/20/14, 7:54 AM

Anirudh, a menu can call an action.  There are at least 4 types of actions that OpenERP provides

  • window action, which will display the views, etc
  • report action that will run a report (like from the Print shortcut)
  • server action that will run an ORM method of your choice (with certain limitations)
  • cliet action that will run something in web client.

So, yes you can run a method from a menu (without showing any window), but I think from user experience perspective it is not too good as the user will have no feedback on what is happening.

based on this question, as i also have this question , so i test with a case , please read ... http://blog.instant-erp.com/2014/11/how-to-link-odoo-orm-method-with-menu.html

kalmenchia
on 11/23/14, 10:01 AM
1

Hi,

Basically when you click on Menu, there is no specific methods available in which you can add custom code. 

But I guess you know,

Menu >> Action >> Views ( Tree, Form )

So We can inherit field_view_get method of any class specified in that View.

Still I request you to please give detailed purpose of what you want to do exactly when you click on Sale Order menu.

May be after knowing the exact purpose we can help you more.

 

Thanks for reply sir, actually my aim is to delete what is being stored on the database so that it cannot be reloaded and without user clicking the delete button.

Anirudh Lou
on 10/18/14, 9:52 AM

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: 10/18/14, 4:22 AM
Seen: 983 times
Last updated: 10/30/15, 3:06 PM