Hi, I have a button inside an XML view that dispatch a wizard view of another addon, in this way:
```
<record id="view_contact_form" model="ir.ui.view">
<field name="name">res.partner.form</field>
<field name="model">res.partner</field>
<field name="inherit_id" ref="base.view_partner_form"/>
<field name="arch" type="xml">
<xpath expr="//form//sheet" position="before">
<header>
. . . .
<button name="%(report_generator.action_generate_report)d" string="Privacy Report" type="action" class="oe_highlight"/>
</header>
</xpath>
. . . .
```
And this is the action inside the other addon:
```
<record id="action_generate_report" model="ir.actions.act_window">
<field name="name">Generate Privacy Report</field>
<field name="type">ir.actions.act_window</field>
<field name="res_model">cliens.report_generator.privacy_report_model_wizard</field>
<field name="view_type">form</field>
<field name="view_mode">form</field>
<field name="target">new</field>
</record>
````
Now I need to pass default data to the wizard, and I need to have a function inside the TransientModel of the addons where the action is.
So I need to call the python method from the first addon passing the res partner record.
Anyone can help me?
Odoo is the world's easiest all-in-one management software.
It includes hundreds of business apps:
- सीआरएम
- e-Commerce
- लेखांकन
- इन्वेंटरी
- PoS
- Project
- MRP
This question has been flagged
pass values through the context as default_values: value
eg:
return {
'name': _('Shipment Line Items'),
'view_mode': 'form',
'res_model': 'cargo.details',
'view_id': self.env.ref('orderrace_export.cargo_details').id,
'type': 'ir.actions.act_window',
'context': {'default_partner_id': self.partner_id.id, 'default_company_id': self.company_id.id,
'default_name': self.name},
'target': 'new',
}
<field name="context">{'search_default_group_crossevered_budgdet_id': True, 'search_default_filter_not_cancelled':True}</field>
Enjoying the discussion? Don't just read, join in!
Create an account today to enjoy exclusive features and engage with our awesome community!
Sign upRelated Posts | Replies | Views | Activity | |
---|---|---|---|---|
|
3
अक्तू॰ 23
|
5819 | ||
|
2
अग॰ 22
|
3652 | ||
|
6
अक्तू॰ 20
|
3651 | ||
|
0
जुल॰ 19
|
5449 | ||
report in quality
Solved
|
|
3
मई 19
|
3121 |
Hope these tips will help you in future: https://github.com/sehrishnaz/learnopenerp/wiki