Kanban view doesn't show constraint error message

Bug #1190236 reported by Karel Marissens
10
This bug affects 2 people
Affects Status Importance Assigned to Milestone
Odoo Web (MOVED TO GITHUB)
Fix Committed
Undecided
OpenERP Publisher's Warranty Team
OpenERP Community Backports (Web)
Status tracked in 7.0
7.0
New
Undecided
Unassigned

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() {
                record.do_reload();
                new_group.do_save_sequences();
            }).fail(function(error, evt) {
                evt.preventDefault();
                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.

Tags: maintenance

Related branches

Amit Parik (amit-parik)
affects: openobject-addons → openerp-web
Revision history for this message
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  
Everyone can see this information.

Other bug subscribers

Remote bug watches

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