コンテンツへスキップ
メニュー
この質問にフラグが付けられました
1 返信
8967 ビュー

what i'm doing pls correct me where i'm wrong

```

<record id="action_view_account_process_adjustments" model="ir.actions.act_window">

 <field name="name">Process Adjustment</field> 

 <field name="type">ir.actions.act_window</field> 

 <field name="res_model">invoice.process.adjustment</field> 

 <field name="view_type">form</field> <field name="view_mode">form</field> 

 <field name="context">{'parent_obj': self.id}</field> 

 <field name="view_id" ref="invoices_process_adjustment_wizard"/> 

 <field name="target">new</field> </record>

```


i want current account.move id into my opend wizard form and how to get in py file 

アバター
破棄
最善の回答

Hi Usman Farzand,
you can call wizard on a button click and pass ID,Try like below

def action_method(self):

return {
'name': self.name,
'res_model': 'wizard_model_name',
'type': 'ir.actions.act_window',
'context': {'current_id': self.id},
'view_mode': 'form',
'view_type': 'form',
'target': 'new',
}


アバター
破棄
著作者

how i can get value in py file of current_id pls

try like below:

amount = context.get('current_id')

you can call paren form like:

c_obj = self.env['obj.obj'].browse([(self._context['current_id'])])

self.env.context.get('active_id')

関連投稿 返信 ビュー 活動
2
9月 20
6060
1
9月 19
6529
2
9月 23
4616
2
9月 22
4376
0
1月 21
3154