I think you have created a button in form or tree view of a model and trying to call a method in another model. The method for button should be defined in the model itself. To call method in another model, first you have to define a method in the model in form of which the button is created. Then you can call the method of another model from that method using object of the other model.
Suppose you have created a button in form view of sale order as:
<button name="method_a" type="object" string="Call Method" />
If you want to call a method 'method_b' in purchase order,
_inherit = 'purchase.order'
Then you have to define method 'method_a' in sale order as follows:
_inherit = 'sale.order'
Thanks & Regards
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: 3/28/14, 3:23 PM|
|Seen: 1391 times|
|Last updated: 5/26/16, 12:29 AM|