跳至内容
菜单
此问题已终结
2 回复
12871 查看

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 ?

形象
丢弃
最佳答案

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),
}
形象
丢弃
编写者 最佳答案

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​

形象
丢弃
相关帖文 回复 查看 活动
1
9月 21
5335
4
12月 23
20638
2
11月 18
13132
0
4月 17
3292
1
9月 15
3728