openerp-community-reviewer team mailing list archive
-
openerp-community-reviewer team
-
Mailing list archive
-
Message #06082
[Bug 1190236] Re: Kanban view doesn't show constraint error message
** Also affects: ocb-web
Importance: Undecided
Status: New
** Also affects: ocb-web/7.0
Importance: Undecided
Status: New
--
You received this bug notification because you are a member of OpenERP
Community Backports Team, which is subscribed to OpenERP Community
Backports (Web).
https://bugs.launchpad.net/bugs/1190236
Title:
Kanban view doesn't show constraint error message
Status in OpenERP Community Backports (Web):
New
Status in OpenERP Community Backports (Web) 7.0 series:
New
Status in OpenERP Web:
Fix Committed
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.
To manage notifications about this bug go to:
https://bugs.launchpad.net/ocb-web/+bug/1190236/+subscriptions