details: https://code.openbravo.com/erp/devel/pi/rev/5dc78551e4d7
changeset: 17763:5dc78551e4d7
user: David Baz Fayos <david.baz <at> openbravo.com>
date: Fri Aug 24 16:18:25 2012 +0200
summary: Fixed issue 21359: Moved all [PNE] error warns to the message bar
diffstat:
modules/org.openbravo.client.application/web/org.openbravo.client.application/js/process/ob-pick-and-execute-view.js
| 7 ++++++-
modules/org.openbravo.client.application/web/org.openbravo.client.application/js/return-material/ob-return-material.js
| 10 +++++-----
2 files changed, 11 insertions(+), 6 deletions(-)
diffs (62 lines):
diff -r c8346d4c6ffd -r 5dc78551e4d7
modules/org.openbravo.client.application/web/org.openbravo.client.application/js/process/ob-pick-and-execute-view.js
---
a/modules/org.openbravo.client.application/web/org.openbravo.client.application/js/process/ob-pick-and-execute-view.js
Fri Aug 24 15:21:58 2012 +0200
+++
b/modules/org.openbravo.client.application/web/org.openbravo.client.application/js/process/ob-pick-and-execute-view.js
Fri Aug 24 16:18:25 2012 +0200
@@ -49,10 +49,15 @@
okButton, newButton, cancelButton, i, buttonLayout = [];
function actionClick() {
+ view.messageBar.hide();
if (view.validate()) {
view.doProcess(this._buttonValue);
} else {
- view.messageBar.setMessage(isc.OBMessageBar.TYPE_ERROR, null,
OB.I18N.getLabel('OBUIAPP_ErrorInFields'));
+ // If the messageBar is visible, it means that it has been set due to
a custom validation inside view.validate()
+ // so we don't want to overwrite it with the generic
OBUIAPP_ErrorInFields message
+ if (!view.messageBar.isVisible()) {
+ view.messageBar.setMessage(isc.OBMessageBar.TYPE_ERROR, null,
OB.I18N.getLabel('OBUIAPP_ErrorInFields'));
+ }
}
}
diff -r c8346d4c6ffd -r 5dc78551e4d7
modules/org.openbravo.client.application/web/org.openbravo.client.application/js/return-material/ob-return-material.js
---
a/modules/org.openbravo.client.application/web/org.openbravo.client.application/js/return-material/ob-return-material.js
Fri Aug 24 15:21:58 2012 +0200
+++
b/modules/org.openbravo.client.application/web/org.openbravo.client.application/js/return-material/ob-return-material.js
Fri Aug 24 16:18:25 2012 +0200
@@ -36,7 +36,7 @@
if ((value !== null) &&
(newReturnedQty.compareTo(movementQty.subtract(returnedQty))) <= 0 && (value >
0)) {
return true;
} else {
- isc.warn(OB.I18N.getLabel('OBUIAPP_RM_OutOfRange',
[movementQty.subtract(returnedQty).toString()]));
+ item.grid.view.messageBar.setMessage(isc.OBMessageBar.TYPE_ERROR, null,
OB.I18N.getLabel('OBUIAPP_RM_OutOfRange',
[movementQty.subtract(returnedQty).toString()]));
return false;
}
};
@@ -60,7 +60,7 @@
if ((value !== null) && (value <= record.pending) && (value > 0)) {
return true;
} else {
- isc.warn(OB.I18N.getLabel('OBUIAPP_RM_ReceivingMoreThanPending',
[record.pending]));
+ item.grid.view.messageBar.setMessage(isc.OBMessageBar.TYPE_ERROR, null,
OB.I18N.getLabel('OBUIAPP_RM_ReceivingMoreThanPending', [record.pending]));
return false;
}
};
@@ -93,9 +93,9 @@
// check value is positive and below available qty and pending qty
if (value === null || value < 0 || value > record.pending || value >
record.availableQty) {
if (record.pending < record.availableQty) {
- isc.warn(OB.I18N.getLabel('OBUIAPP_RM_MoreThanPending',
[record.pending]));
+ item.grid.view.messageBar.setMessage(isc.OBMessageBar.TYPE_ERROR, null,
OB.I18N.getLabel('OBUIAPP_RM_MoreThanPending', [record.pending]));
} else {
- isc.warn(OB.I18N.getLabel('OBUIAPP_RM_MoreThanAvailable',
[record.availableQty]));
+ item.grid.view.messageBar.setMessage(isc.OBMessageBar.TYPE_ERROR, null,
OB.I18N.getLabel('OBUIAPP_RM_MoreThanAvailable', [record.availableQty]));
}
return false;
}
@@ -105,7 +105,7 @@
if (editedRecord.orderLine === orderLine) {
pendingQty -= editedRecord.movementQuantity;
if (pendingQty < 0) {
- isc.warn(OB.I18N.getLabel('OBUIAPP_RM_TooMuchShipped',
[record.pending]));
+ item.grid.view.messageBar.setMessage(isc.OBMessageBar.TYPE_ERROR,
null, OB.I18N.getLabel('OBUIAPP_RM_TooMuchShipped', [record.pending]));
return false;
}
}
------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and
threat landscape has changed and how IT managers can respond. Discussions
will include endpoint security, mobile security and the latest in malware
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
Openbravo-commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/openbravo-commits