跳至内容
菜单
此问题已终结
该问题已被关闭 原因: 不是一个真正的帖子
Muhammad Ihza Putra Handayani 2024年03月04日 04时09分35秒

i want to return a wizard when we press the duplicate button but i have this eror instead


@api.returns('self', lambda value: self.version_status_id.id,

            'date_application': self.date_application,

            'removal_date': self.removal_date,

            'min_point': self.min_point,

        }

        return new_data


    def copy(self, default=None):

        """ Overriding Odoo's copy method """

        default = dict(default or {})

        default.update(self._copy_data())

        view_id = self.env.ref('certification_app.view_wizard_repository_version_form').id

        return {

            'name': _('Duplicate Repository Version'),

            'type': 'ir.actions.act_window',

            'view_mode': 'form',

            'view_id': view_id,  # We'll set this dynamically in the action

            'res_model': 'repository.version.wizard',

            'target': 'new',

            'context': {

            },

        }


class WizardRepositoryVersion(models.TransientModel):

    _name = 'repository.version.wizard'


    name = fields.Char()

    repository_id = fields.Many2one('certification.repository', string='Repository')


    def action_confirm(self):

        self.ensure_one()

        return {'type': 'ir.actions.act_window_close'}

形象
丢弃
相关帖文 回复 查看 活动
0
3月 24
1052
0
1月 24
1642
0
4月 15
3448
0
1月 24
1226
1
4月 23
3992