Skip to Content
Menu
You need to be registered to interact with the community.
This question has been flagged
The question has been closed iz razloga: not a real post
by Muhammad Ihza Putra Handayani na 04. 03. 2024 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'}

Avatar
Opusti
Related Posts Odgovori Prikazi Aktivnost
0
mar. 24
652
0
jan. 24
1044
0
apr. 15
3061
0
jan. 24
818
1
apr. 23
3383