Deleting a new, unsaved record causes ValueError

Bug #701298 reported by Don Kirkby
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Fix Released
OpenERP sa GTK client R&D

Bug Description

Here's a detailed description of one way to cause this error:
1. Create a new database with sample data and any profile. Complete the installation.
2. Go to the Partners screen and click the New button to create a new partner.
3. Type "Foo" in the Name field.
4. Click the Delete button.
5. A dialog box appears, "Record is not saved ! Do you want to clear current record?" Click the OK button.

Expected behaviour:
Either all the fields are cleared back to default values, or the screen loads an existing partner and takes you out of the "new record" mode.

Actual behaviour:
None of the fields change value. An error appears in the client error log:
Traceback (most recent call last):
  File "/mnt/workspace/don/openerp-bzr/client/delete-new-record/bin/modules/gui/", line 1334, in _sig_child_call
    res = wid.handlers[button_name]()
  File "/mnt/workspace/don/openerp-bzr/client/delete-new-record/bin/modules/gui/window/", line 263, in sig_remove
    id = self.screen.remove(unlink=True)
  File "/mnt/workspace/don/openerp-bzr/client/delete-new-record/bin/widget/screen/", line 507, in remove
    idx = self.models.models.index(self.current_model)
ValueError: list.index(x): x not in list

I am testing this with OpenERP 5.0.15 running on Ubuntu 5.0.15.

Related branches

Revision history for this message
Don Kirkby (donkirkby) wrote :

I found the problem and created a merge proposal with my fix.

Changed in openobject-client:
assignee: nobody → OpenERP sa GTK client R&D (openerp-dev-gtk)
importance: Undecided → Low
status: New → Confirmed
Revision history for this message
Ravi Gadhia (OpenERP) (rga-openerp) wrote :

Hello Don Kirkby,

            It has been fixed in ~openerp-dev/openobject-client/trunk-dev-client and it will merge soon with trunk client. thank you for report and patch
           here could not apply your patch because it's break consistency between one2many and parent record deletion.


Changed in openobject-client:
status: Confirmed → Fix Released
Revision history for this message
Don Kirkby (donkirkby) wrote :

OK, I took out my changes and backported yours to my delete-new-record branch in case anybody else needs to merge this change into a 5.0 branch.

Thanks for the fix.

Changed in openobject-client:
milestone: none → 6.0
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers