is it possible to call the menu action by clicking the button?i want to load the create_quotation form when click on the create_quotation button in the another form?how can solve it?
Yes you can.
Create a new method in the other form you need to launch the create_quotation from from it and put in it the following code:
def call_quotation(self,cr,uid,ids,context): mod_obj = self.pool.get('ir.model.data') act_obj = self.pool.get('ir.actions.act_window') result = mod_obj.get_object_reference(cr, uid, 'sale', 'act_res_partner_2_sale_order') id = result and result or False result = act_obj.read(cr, uid, [id], context=context) return result
Make the type of the button you created in the other form type="object" and assign to it this method
<button name="call_quotation" type="object" string="Call Quotation"/>
Note : use your preferred names, in place of the bold names above use the exact module/action names
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
|Asked: 8/6/15, 3:52 AM|
|Seen: 387 times|
|Last updated: 8/17/15, 4:21 AM|