Skip to Content
Menu
This question has been flagged

I create 1 model for 2 view

in py create mail.activity action button


letternumber = fields.Many2one(comodel_name="letter.number", string="Nomor Surat", track_visibility='onchange', store=True)

otherproduct = fields.Many2many(comodel_name="other.product", string="Nama Barang", store=True, track_visibility='onchange')


    @api.multi

    def action_approval(self):

        self.ensure_one()

        self.write({'state': 'Approval', 'status_proses':'Need Approval'})

        user_id = self.env['res.users'].sudo().search([('manager1', '=', True)]).id

        newActivity = self.env['mail.activity'].sudo().create({

            'activity_type_id': self.env.ref('art_mod.mail_activity_data_approval').id,

            'note': 'Report %s need your approval' % (self.name),

            'res_id': self.id,

            'res_model_id': self.env.ref('art_mod.model_name').id,

            'user_id': user_id

            })


if i use 1 model = 1 view the value in kanban is available

if 1 model = 2 view, kaban value not showing value of many2many and many2one

note: the data is still available in standart menu, but not available in activitys link


<a href="https://ibb.co/G3HVHF3"><img src="https://i.ibb.co/G3HVHF3/case3.png" alt="case3" border="0"></a>
<a href="https://ibb.co/whZqkFS"><img src="https://i.ibb.co/whZqkFS/case1.png" alt="case1" border="0"></a>

<a href="https://ibb.co/smFzZBV"><img src="https://i.ibb.co/smFzZBV/case2.png" alt="case2" border="0"></a>


anyone can help? thank you

Avatar
Discard
Related Posts Replies Views Activity
0
Sep 24
210
1
Oct 21
1382
2
Jun 20
5100
1
Nov 19
4146
1
Apr 19
4079