如何在odoo消息中添加attachment_ids

时间:2019-05-28 02:43:28

标签: react-native expo odoo-10

im试图使用基于react-native-odoo-promise的程序,在odoo消息中添加附件。

首先,我创建了ir.attachment,它显示成功值{成功:true,数据:1096}。

然后我尝试将此id(1096)添加到mail.message中的attachment_ids

    const data = {
        message_type: "comment",
        add_sign: false,
        reply_to: "Mitchell Admin <test@test.com>",
        attachment_ids: [1096],
        body: '<p>Coba WhiteCake</p>',
        create_date: "2019-05-20 08:15:47",
        display_name: "PO00013 (44)",
        record_name: "PO00013 (44)",
        author_id: 3,
        add_sign: false,

    }
    odoo.create('mail.message', data)
        .then(response => {
            console.log(response);
        })
        .catch(e => {
            console.log(e);
            console.log('eror')
        });
});

它也显示出成功的结果,

    {success: true, data: 1178}

那我已经读了mail.message ID 1178

add_sign: false
attachment_ids: []

但是attachment_ids仍然有一个空数组。

我已经尝试过:

attachment_id:['1096']

attachment_id:[(0,'1096')]

attachment_id:[(0,1096)],

attachment_id:[(1096)],

attachment_id:1096,

attachment_id:[1096],

attachment_ids:[1096],

attachment_ids:[(1096)],

attachment_ids:[('1096')],

attachment_ids:[(0,'1096')],

attachment_ids:[(0,1096)],

attachment_ids:[('0','1096')],

attachment_ids:[(0,1096)],

attachment_ids:'[1096]',

但是attachment_ids仍然有一个空数组。

0 个答案:

没有答案