Is it possible to add a customized option in print button other than report action. Such that the option should call a function, is it possible? if yes how can we do that
Thanks in advance.....
Odoo is the world's easiest all-in-one management software.
It includes hundreds of business apps:
Is it possible to add a customized option in print button other than report action. Such that the option should call a function, is it possible? if yes how can we do that
Thanks in advance.....
Hello,I know it's very late to answer this question. But I'm answering for the upcoming people who are facing the same issue.
We can open a wizard from "print" option. we have to use the "<act_window id='.....". Inside the act window, you can give the attribute "binding_type". The binding_type have the two options which are "action" and "report". In your case you've to select the "report" option. So that you can popup (wizard) as per your requirement.
Example:
<act_window id="yourid"
name="Name"
res_model="your.wizard"
binding_model="in.which.model.you.have.to.bind.it"
view_mode="form"
binding_views="list"
binding_type="report"
target="new" />
Thank you !!
@Umashankar. Short answer: yes. There are 3 types of buttons which is indicated by it's type: worfklow (default and usually not stated), action (type='action'), and object (type='object').
Now, more on the actions, there are at least 4 types of actions, AFAIK: window (which will display a view), report (which will execute a report), clients (which calls a method in client and AFAIK cannot be used properly in buttons), and server (which will execute a method).
So, if you want to call a method from a button, you have 2 alternatives: use an object button, or use an action button that calls a server action. Samples of server action can be found in odoo/addons/stock/wizard/stock_partial_move_view.xml, e.g. action_partial_move_server action calls a code. The action is called by "Process Partially" button in odoo/addons/stock/stock_view.xml.
Hi Ivan, You from??
Hi ivan i just wanted to add option in the dropdown menu in the print button is it possible
@Umarshankar, no. But you can add that to the More button. The 'action_partial_move_server' sample that I gave above is also available through the More button. It is done through creation of ir.values record which you can also find in odoo/addons/stock/wizard/stock_partial_move_view.xml.
How can we do using this Ivan i cant understand
I would suggest that you look at the example first. It is quite simple.
You can add a undermenu in the print button.
You have to use in act_window key2="client_print_multi" for the more button. Instead of key2="client_action_multi for the more button
Create an account today to enjoy exclusive features and engage with our awesome community!
Sign up
hi uma