frappe / frappejs

Node + Electron + Vue based metadata web framework (inspired by Frappe)
263 stars 110 forks source link

Document.js do not verify the value of this[table.fieldname] before use it in applyFormula method. #112

Open Franklin0702 opened 4 years ago

Franklin0702 commented 4 years ago

THIS HAS AFFECTED IN FRAPPE BOOKS

Problem:

When you submit or revert an invoice with some item with 0% tax, the invoice doesn't update the status.

Steps to reproduce:

1. Create a tax with 0%. image

2. Create an Invoice, add an item and select this tax. image

3. Save the Invoice and submit it, then you will get the following error in the console: image image image

What I have done:

The error is occurs because in applyFormula method inside document.js, there's not a validation to prevent null values, look at the image below: image

To fix this I added the next lines: image

Greetings,