[fix] Round status update percentages to 2 decimals

This commit is contained in:
Anand Doshi
2015-09-25 17:57:20 +05:30
parent 6239923340
commit d970b001a4
4 changed files with 18 additions and 2 deletions

View File

@@ -0,0 +1 @@
from __future__ import unicode_literals

View File

@@ -0,0 +1,14 @@
from __future__ import unicode_literals
import frappe
def execute():
for doctype, fieldname in (
("Sales Order", "per_billed"),
("Sales Order", "per_delivered"),
("Delivery Note", "per_installed"),
("Purchase Order", "per_billed"),
("Purchase Order", "per_received"),
("Material Request", "per_ordered"),
):
frappe.db.sql("""update `tab{doctype}` set `{fieldname}`=round(`{fieldname}`, 2)""".format(
doctype=doctype, fieldname=fieldname))