Ver código fonte

[minor] fix patch and module command

version-14
Rushabh Mehta 8 anos atrás
pai
commit
5cebfb26b9
2 arquivos alterados com 6 adições e 4 exclusões
  1. +2
    -3
      frappe/patches/v8_0/set_currency_field_precision.py
  2. +4
    -1
      frappe/utils/bench_helper.py

+ 2
- 3
frappe/patches/v8_0/set_currency_field_precision.py Ver arquivo

@@ -6,7 +6,7 @@ import frappe
from frappe.utils import get_number_format_info

def execute():
frappe.reload_doc('core', 'doctype', 'system_settings')
frappe.reload_doc('core', 'doctype', 'system_settings', force=True)
if not frappe.db.get_value("System Settings", None, "currency_precision"):
default_currency = frappe.db.get_default("currency")
number_format = frappe.db.get_value("Currency", default_currency, "number_format") \
@@ -15,9 +15,8 @@ def execute():
precision = get_number_format_info(number_format)[2]
else:
precision = 2
ss = frappe.get_doc("System Settings")
ss.currency_precision = precision
ss.flags.ignore_mandatory = True
ss.save()

+ 4
- 1
frappe/utils/bench_helper.py Ver arquivo

@@ -5,6 +5,7 @@ import os
import json
import importlib
import frappe.utils
import traceback

click.disable_unicode_literals_warning = True

@@ -61,7 +62,9 @@ def get_sites(site_arg):
def get_app_commands(app):
try:
app_command_module = importlib.import_module(app + '.commands')
except ImportError:
except ImportError as e:
if not 'No module named commands' in str(e):
traceback.print_exc()
return []

ret = {}


Carregando…
Cancelar
Salvar