[list] UI not updated if record disappears after clicking on a button

Bug #1042718 reported by Juan Rial (OpenERP)
14
This bug affects 2 people
Affects Status Importance Assigned to Milestone
Odoo Web (MOVED TO GITHUB)
Fix Released
Medium
OpenERP R&D Web Team

Bug Description

Steps to reproduce:

 1) Install CRM and Marketing Campaigns
 2) Create at least one company & contact in CRM
 3) Create a search that returns at least one contact in CRM
 4) Create a marketing campaign that operates on Partner Addresses
 5) Create an activity within this campaign that is the start activity, set its condition to False, don't check "Don't delete workitems"
 6) Create a segment for the campaign based on the search from step 4
 7) Start the campaign and the segment
 8) Synchronize segment manually
 9) Click on the green arrow for the workitem
10) The workitem is deleted since its run condition wasn't met, but the screen is not updated. So it remains on the screen and the green arrow can be clicked again.
11) Clicking the green arrow again will attempt to run a workitem that no longer exists and result in the following stacktrace:

2012-08-28 12:25:58,804 8913 WARNING ? openerp.osv.orm: No field_values found for ids [1] in browse_record(marketing.campaign.workitem, 1)
2012-08-28 12:25:58,805 8913 ERROR ? openerp.osv.osv: Uncaught exception
Traceback (most recent call last):
  File "/home/nighty/src/OpenERP/shared_repo/server/mckinsey_trunk/openerp/osv/osv.py", line 121, in wrapper
    return f(self, dbname, *args, **kwargs)
  File "/home/nighty/src/OpenERP/shared_repo/server/mckinsey_trunk/openerp/osv/osv.py", line 189, in execute
    res = self.execute_cr(cr, uid, obj, method, *args, **kw)
  File "/home/nighty/src/OpenERP/shared_repo/server/mckinsey_trunk/openerp/osv/osv.py", line 177, in execute_cr
    return getattr(object, method)(cr, uid, *args, **kw)
  File "/home/nighty/workspaces/openerp/mckinsey/addons/marketing_campaign/marketing_campaign.py", line 765, in process
    self._process_one(cr, uid, wi, context=context)
  File "/home/nighty/workspaces/openerp/mckinsey/addons/marketing_campaign/marketing_campaign.py", line 677, in _process_one
    if workitem.state != 'todo':
  File "/home/nighty/src/OpenERP/shared_repo/server/mckinsey_trunk/openerp/osv/orm.py", line 478, in __getattr__
    raise AttributeError(e)
AttributeError: 'Field state not found in browse_record(marketing.campaign.workitem, 1)'
2012-08-28 12:25:58,847 8913 ERROR ? openerp.netsvc: Field state not found in browse_record(marketing.campaign.workitem, 1)
> /home/nighty/src/OpenERP/shared_repo/server/mckinsey_trunk/openerp/osv/orm.py(478)__getattr__()
-> raise AttributeError(e)

Related branches

Revision history for this message
Juan Rial (OpenERP) (jri-openerp) wrote :
Revision history for this message
Olivier Dony (Odoo) (odo-openerp) wrote :

This is indeed not very user-friendly, but it is also to be expected, given the non-standard implementation of the "Process" button.
Buttons do not usually cause the deletion of the underlying record, this is normally accomplished via the Delete button of the UI.

I suspect this issue is web-only. It's not an addons issue in any case, because calling a function on deleted records is not supported.
Now, as clicking on a button should cause a refresh of the record afterwards, it might be feasible in the web client to detect the fact that the record has gone missing (upon refresh), and update the UI accordingly. To be confirmed by the web team.

affects: openobject-addons → openerp-web
Changed in openerp-web:
assignee: nobody → OpenERP R&D Web Team (openerp-dev-web)
importance: Undecided → Low
status: New → Confirmed
summary: - Stacktrace on Marketing Campaign when trying to execute deleted workitem
+ UI not updated if record disappears after clicking on a button
Revision history for this message
Vishmita Jadeja (openerp) (vja-openerp) wrote : Re: UI not updated if record disappears after clicking on a button
Changed in openerp-web:
status: Confirmed → Fix Committed
Changed in openerp-web:
importance: Low → Medium
Revision history for this message
Nicolas Vanhoren (OpenERP) (niv-openerp) wrote :

We agreed with XMO that, even if the post gtk/web clients never handled that case correctly, we should modify the list view to remove the record if it was deleted.

summary: - UI not updated if record disappears after clicking on a button
+ [list] UI not updated if record disappears after clicking on a button
Changed in openerp-web:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.