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:
- CRM
- e-Commerce
- Akuntansi
- Inventaris
- PoS
- Project
- MRP
Pertanyaan ini telah diberikan tanda
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>
Menikmati diskusi? Jangan hanya membaca, ikuti!
Buat akun sekarang untuk menikmati fitur eksklufi dan agar terlibat dengan komunitas kami!
DaftarPost Terkait | Replies | Tampilan | Aktivitas | |
---|---|---|---|---|
|
3
Okt 23
|
5822 | ||
|
2
Agu 22
|
3659 | ||
add Bottle deposit money to the product in Odoo V12
Diselesaikan
|
|
6
Okt 20
|
3654 | |
|
0
Jul 19
|
5458 | ||
report in quality
Diselesaikan
|
|
3
Mei 19
|
3122 |
Hope these tips will help you in future: https://github.com/sehrishnaz/learnopenerp/wiki