콘텐츠로 건너뛰기
메뉴
커뮤니티에 참여하려면 회원 가입을 하시기 바랍니다.
신고된 질문입니다
2 답글
1895 화면

Hello all,


I would like to display a confirmation popup when saving, creating, or modifying a field. Cancel popup will cancel modifications.

Doable with inherit of methods write, create,..


But, the difficulty is that I want to allow the user to choose the fields that trigger the popup call.

How to proceed dynamically?


Thank you in advance !


Jérôme

아바타
취소
작성자 베스트 답변

Hello Creyox Technologies,

Thanks, nice approach.

However, write method doesn't open my action to show the wizard, and I think she can't.

Any alternatives ? 

class Esignature(models.Model):
    _inherit = 'res.partner'

    @api.multi
    def write(self, vals):
        rc = super(Esignature, self).write(vals)

        # Resarch in modified vals in field need confirmation
        for val in vals:
            field_rc = self.env['ir.model.fields'].search([('model', '=', self.model.model), ('name', '=', val), ('need_confirm', '=', True)])
            if field_rc:  # Confirmation needed, show confirmation wizard
                return {
                    'name': 'Open Wizard',
                    'type': 'ir.actions.act_window',
                    'res_model': 'a4.password.request',
                    'view_mode': 'form',
                    'target': 'new',
                }

        return rc



아바타
취소
베스트 답변

Hello,

You can put a boolean field inside the ir.fields models to identify whether this field is a popup call field or not.
If you get a modified field in the popup call field then you can trigger the popup.

Thanks,
info@creyox.com

아바타
취소
관련 게시물 답글 화면 활동
4
10월 16
4256
3
4월 18
5189
2
4월 23
23357
4
6월 25
2077
1
6월 25
918