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.

1

[Odoo V8] Server Actions

By
Tazan
on 6/30/15, 10:36 AM 599 views

Hi all!

I want create new Server Action

 <record id="action_transfer" model="ir.actions.server">
   <field name="name">Transfer</field>
<field name="model_id" search="[('model','=','stock.picking')]" model="ir.model"/>
<field name="state">code</field>
<field name="code">self.multi_transfer()</field>
</record>

Code action

 @api.model 
def multi_transfer(self):
print 'aaaa'

But i have error!

 ValueError: "old_api() takes at least 3 arguments (1 given)" while evaluating
u'self.multi_transfer()'

Hoping for some feedback!

Thanks

3

zbik

--zbik--
5941
| 6 4 7
Lodz, Poland
--zbik--


zbik
On 6/30/15, 12:55 PM

Try old api style code, should help:

<field name="code">self.multi_transfer(cr,uid,context=context)</field>

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: 6/30/15, 10:36 AM
Seen: 599 times
Last updated: 7/30/15, 4:57 AM