Skip to Content
Menu
You need to be registered to interact with the community.
This question has been flagged
1 Odgovori
4595 Prikazi

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

Avatar
Opusti
Best Answer

Try old api style code, should help:

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

Works perfect, thanks!

Related Posts Odgovori Prikazi Aktivnost
2
mar. 20
7420
0
mar. 25
1377
0
jan. 25
3462
2
avg. 24
1491
0
jan. 25
1386