Bug 2597 - Kiwi comboentries should allow duplicated strings in the list
: Kiwi comboentries should allow duplicated strings in the list
Status: REOPENED
: Kiwi
ComboEntry
: SVN trunk
: PC Linux
: P5 (unset)
Assigned To:
:
:
:
:
:
:
  Show dependency treegraph
 
Reported: 2006-05-11 12:35 BRT by
Modified: 2008-03-06 14:13 BRT (History)


Attachments


Note

You need to log in before you can comment on or make changes to this bug.


Description From 2006-05-11 12:35:05 BRT
I think it's a bad limitation if we do not allow duplicated strings in a
comboentry. Imagine a combo which show a list of people by name. It's normal to
have two or more people with the same name but the objects will be different
and some other attributes two.
------- Comment #1 From 2006-05-11 12:43:33 BRT -------
> and some other attributes two.

s/two/too ;-)
------- Comment #2 From 2007-01-17 20:43:32 BRT -------
(In reply to comment #0)
> I think it's a bad limitation if we do not allow duplicated strings in a
> comboentry. Imagine a combo which show a list of people by name. It's normal to
> have two or more people with the same name but the objects will be different
> and some other attributes two.

How would a user decide between two items with identical string (two persons
with same name in your example) given that the string is the only information
he/she can see?
------- Comment #3 From 2007-07-24 17:55:00 BRT -------
Example from Stoq:

Traceback (most recent call last):
  File "/home/jdahlin/dev/stoq/trunk/stoq/stoq/gui/purchase/purchase.py", line
264, in _on_order_action_clicked
    self._open_order()
  File "/home/jdahlin/dev/stoq/trunk/stoq/stoq/gui/purchase/purchase.py", line
143, in _open_order
    edit_mode)
  File "/home/jdahlin/dev/stoq/trunk/stoqlib/stoqlib/gui/base/application.py",
line 117, in run_dialog
    return run_dialog(dialog_class, self, *args, **kwargs)
  File "/home/jdahlin/dev/stoq/trunk/stoqlib/stoqlib/gui/base/dialogs.py", line
415, in run_dialog
    dialog = get_dialog(parent, dialog, *args, **kwargs)
  File "/home/jdahlin/dev/stoq/trunk/stoqlib/stoqlib/gui/base/dialogs.py", line
384, in get_dialog
    dialog = dialog(*args, **kwargs)
  File
"/home/jdahlin/dev/stoq/trunk/stoqlib/stoqlib/gui/wizards/purchasewizard.py",
line 372, in __init__
    first_step = StartPurchaseStep(self, conn, model)
  File
"/home/jdahlin/dev/stoq/trunk/stoqlib/stoqlib/gui/wizards/purchasewizard.py",
line 72, in __init__
    WizardEditorStep.__init__(self, conn, wizard, model)
  File "/home/jdahlin/dev/stoq/trunk/stoqlib/stoqlib/gui/base/wizards.py", line
51, in __init__
    BaseEditorSlave.__init__(self, conn, model)
  File
"/home/jdahlin/dev/stoq/trunk/stoqlib/stoqlib/gui/editors/baseeditor.py", line
103, in __init__
    self.setup_proxies()
  File
"/home/jdahlin/dev/stoq/trunk/stoqlib/stoqlib/gui/wizards/purchasewizard.py",
line 124, in setup_proxies
    self._setup_widgets()
  File
"/home/jdahlin/dev/stoq/trunk/stoqlib/stoqlib/gui/wizards/purchasewizard.py",
line 89, in _setup_widgets
    self._fill_supplier_combo()
  File
"/home/jdahlin/dev/stoq/trunk/stoqlib/stoqlib/gui/wizards/purchasewizard.py",
line 79, in _fill_supplier_combo
    self.supplier.prefill(items)
  File "/home/jdahlin/dev/stoq/trunk/kiwi/kiwi/ui/comboentry.py", line 576, in
prefill
    self.entry.prefill(itemdata, sort)
  File "/home/jdahlin/dev/stoq/trunk/kiwi/kiwi/ui/entry.py", line 1015, in
prefill
    "%r into the entry" % text)
KeyError: "Tried to insert duplicate value u'ZEM COMERCIO E INDUSTRIA LTDA'
into the entry"
------- Comment #4 From 2007-09-04 16:44:11 BRT -------
Resolvido na versão 0.9.2
------- Comment #5 From 2007-10-08 12:21:18 BRT -------
Ali says this is still not fixed
------- Comment #6 From 2007-10-08 17:48:04 BRT -------
Sorry, I was slightly mistaken. It is fixed when data mode on the combo is
ENTRY_MODE_DATA, ie prefill with a list of pairs: (text, value). It does not
however work when the mode is ENTRY_MODE_TEXT. I suppose this is reasonable
since ENTRY_MODE_TEXT is kind of like a unique set of keys.

I think the best behaviour would be that when ENTRY_MODE_TEXT is set and there
are duplicates, foo (1), foo (2) etc should be displayed, but "foo" should be
returned when the value is read.

Maybe this is a bad idea, I haven't thought about it.

Ali