Skip to Content
Menu
Musisz się zarejestrować, aby móc wchodzić w interakcje z tą społecznością.
To pytanie dostało ostrzeżenie
1 Odpowiedz
4860 Widoki

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

Awatar
Odrzuć
Najlepsza odpowiedź

Try old api style code, should help:

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

Works perfect, thanks!

Powiązane posty Odpowiedzi Widoki Czynność
2
mar 20
7775
0
mar 25
1815
0
sty 25
4068
2
sie 24
1982
0
sty 25
1937