mirror of
https://github.com/frappe/books.git
synced 2024-12-23 19:39:07 +00:00
fix: more informative error messages
- set currency columns as not null
This commit is contained in:
parent
e249b033f1
commit
84724ff731
@ -163,7 +163,10 @@ module.exports = class Database extends Observable {
|
||||
}
|
||||
|
||||
// required
|
||||
if (!!field.required && !(field.required instanceof Function)) {
|
||||
if (
|
||||
(!!field.required && !(field.required instanceof Function)) ||
|
||||
field.fieldtype === 'Currency'
|
||||
) {
|
||||
column.notNullable();
|
||||
}
|
||||
|
||||
|
@ -668,7 +668,12 @@ module.exports = class BaseDocument extends Observable {
|
||||
.map((d) => {
|
||||
const value = d[childfield] ?? 0;
|
||||
if (!isPesa(value)) {
|
||||
return frappe.pesa(value);
|
||||
try {
|
||||
return frappe.pesa(value);
|
||||
} catch (err) {
|
||||
err.message += ` value: '${value}' of type: ${typeof value}, fieldname: '${tablefield}', childfield: '${childfield}'`;
|
||||
throw err;
|
||||
}
|
||||
}
|
||||
return value;
|
||||
})
|
||||
|
Loading…
Reference in New Issue
Block a user