Kanban view doesn't show constraint error message

Bug #1190236 reported by Karel Marissens on 2013-06-12
This bug affects 2 people
Affects Status Importance Assigned to Milestone
Fix Committed
OpenERP Publisher's Warranty Team
OpenERP Community Backports (Web)
Status tracked in 7.0

Bug Description

Problem description:
When dragging an item from one stage to another in the kanban view, it's possible to get the following error message:
"An error has occured while moving the record to this group: undefined"

It can for example happen when a constraint of the item is no longer valid (constraint depends on some factor elsewhere in OpenERP). When moving the item, the constraint is validated (since the item is changed), which blocks the action and results in the error.

Relevant code from kanban.js (web_kanban module):
            var data = {};
            data[this.group_by] = new_group.value;
            this.dataset.write(record.id, data, {}).done(function() {
            }).fail(function(error, evt) {
                alert(_t("An error has occured while moving the record to this group: ") + data.fault_code);
                self.do_reload(); // TODO: use draggable + sortable in order to cancel the dragging when the rcp fails

In the alert, 'data.fault_code' is used. The variable doesn't have an attribute fault_code (resulting in 'undefined'). However, the 'error' variable has a variable 'data', which does have a variable 'fault_code'. So instead of 'data.fault_code', 'error.data.fault_code' can be used.

Related branches

Amit Parik (amit-parik) on 2013-06-14
affects: openobject-addons → openerp-web
Oliver Yuan (oliver-yuan) wrote :

It works.

data.fault_code =》error.data.fault_code

Please merge into the next release

Changed in openerp-web:
assignee: nobody → OpenERP Publisher's Warranty Team (openerp-opw)
tags: added: maintenance
Changed in openerp-web:
status: New → Fix Committed
no longer affects: openerp-mgmtsystem
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers