2
0
mirror of https://github.com/frappe/books.git synced 2024-11-10 07:40:55 +00:00

Merge pull request #115 from rmehta/apply-forumla-fix

fix: fixes applyForumula for empty child table
This commit is contained in:
Rushabh Mehta 2020-05-06 23:05:16 +05:30 committed by GitHub
commit 8158dade1d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -432,7 +432,7 @@ module.exports = class BaseDocument extends Observable {
.getFormulaFields();
if (formulaFields.length) {
// for each row
for (let row of this[tablefield.fieldname]) {
for (let row of this[tablefield.fieldname] || []) {
for (let field of formulaFields) {
if (shouldApplyFormula(field, row)) {
let val = await this.getValueFromFormula(field, row);