2


我在 odoo 12 中有这段代码,我想迁移到 odoo 13。但我不知道src_model在 Odoo 13 中的等价物是什么。

<record model="ir.actions.act_window" id="complete_pieces_jointes">
       <field name="name">Complete Pieces Jointes</field>
       <field name="view_id" ref="view_id_3"/>
       <field name="res_model">ir.attachment.moveto.subscription</field>
       <field name="view_mode">form</field>
       <field name="target">new</field>
       <field name="src_model">ir.attachment</field>
       <field name="type">ir.actions.act_window</field>
    </record>

你能帮助我吗?

4

1 回答 1

5

您可以从 SMS 模块查看此示例。src_model更改为binding_model

<!-- Add action entry in the Action Menu for Partners -->
<act_window id="res_partner_act_window_sms_composer_multi"
    name="Send SMS Text Message"
    binding_model="res.partner"
    res_model="sms.composer"
    binding_views="list"
    view_mode="form"
    target="new"
    context="{
        'default_composition_mode': 'mass',
        'default_mass_keep_log': True,
        'default_res_ids': active_ids
    }"
/>
<act_window id="res_partner_act_window_sms_composer_single"
    name="Send SMS Text Message"
    binding_model="res.partner"
    res_model="sms.composer"
    binding_views="form"
    view_mode="form"
    target="new"
    context="{
        'default_composition_mode': 'comment',
        'default_res_id': active_id,
    }"
/>
于 2019-12-05T18:23:05.590 回答