Aide

2

Tree's editable=bottom AND a way to open the popup (as without editable option)

Avatar
ATX

Hello

I would like the end user:

  1. To be able to edit lines to a one2many field directly inline (edit the cells of the form's tree lines).

  2. To be able to click on that line, or a button of that line, and access the popup form view of that line.

Technically:

  • With editable=bottom, I am able to do inline edit, 1. is solved.

  • Without editable, I am able to click on a line and edit it through a popup form view, 2. is solved.

Question:

Is that possible to achieve the two at the same time ? For instance using editable=bottom PLUS a button on the line to display the line's popup form view ?

Avatar
Annuler
2 Réponses
0
Meilleure réponse

You could create a method in the one2many field's comodel, this method will return an action to navigate to the record form view. You could return a new action, or an existed action. You could also change target to 'new' if you like. See example below:

    @api.multi
def action_show_details(self):
self.ensure_one()
        view = self.env.ref('module.record_form_view')
return {
'name': _('%s') % self.name,
'type': 'ir.actions.act_window',
'view_type': 'form',
'view_model': 'form',
            'res_model': 'model',
'views': [(view.id, 'form')],
'view_id': view.id,
'target': 'current',
'res_id': self.id,
'context': dict(self.env.context),
}
Avatar
Annuler
0
Avatar
ATX
Meilleure réponse

odoo.com/fr_FR/forum/aide-1/question/how-to-include-a-button-in-editable-treeview-cell-to-show-an-edit-form-on-the-current-record-61150​

Avatar
Annuler