Skip to Content
Menu
This question has been flagged
1 Reply
8087 Views

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 

Avatar
Discard
Best Answer

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',
}


Avatar
Discard
Author

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')

Related Posts Replies Views Activity
2
Sep 20
5033
1
Sep 19
5336
2
Sep 23
2916
2
Sep 22
3250
0
Jan 21
2139