diff --git a/tryton/gui/window/view_form/view/list_gtk/editabletree.py b/tryton/gui/window/view_form/view/list_gtk/editabletree.py index a7a4bd0487..3c76d15399 100644 --- a/tryton/gui/window/view_form/view/list_gtk/editabletree.py +++ b/tryton/gui/window/view_form/view/list_gtk/editabletree.py @@ -79,6 +79,9 @@ class EditableTreeView(gtk.TreeView): if focus_column and (focus_column._type in ('many2one','many2many')) \ and self.screen.form: self.screen.form.message_state(_('Relation Field: F1: New F2: Open/Search')) + elif focus_column and (focus_column._type in ('one2many')) \ + and self.screen.form: + self.screen.form.message_state(_('Relation Field: F1: New')) elif focus_column and (focus_column._type in ('boolean')): start_editing = False elif self.screen.form: diff --git a/tryton/gui/window/view_form/view/list_gtk/parser.py b/tryton/gui/window/view_form/view/list_gtk/parser.py index e5a7ce5321..c80add355e 100644 --- a/tryton/gui/window/view_form/view/list_gtk/parser.py +++ b/tryton/gui/window/view_form/view/list_gtk/parser.py @@ -457,6 +457,25 @@ class O2M(Char): def value_from_text(self, model, text): raise UnsettableColumn('Can not set column of type o2m') + def open_remote(self, model, create=True, changed=False, text=None): + if not create: + raise NotImplementedError + modelfield = model.mgroup.mfields[self.field_name] + relation = modelfield.attrs['relation'] + context = modelfield.context_get(model) + + dia = O2MDialog(relation, parent=model, attrs=modelfield.attrs, + default_get_ctx=context, window=self.window) + res = True + while res: + res, value = dia.run() + if res: + model.value[self.field_name].model_add(value) + value.signal('record-changed', value.parent) + dia.new() + dia.destroy() + return False, False + class M2M(Char):