Merge branch 'develop' into typo-fix
This commit is contained in:
commit
afa03fd654
@ -3,6 +3,7 @@
|
|||||||
|
|
||||||
from __future__ import unicode_literals
|
from __future__ import unicode_literals
|
||||||
import frappe, json
|
import frappe, json
|
||||||
|
from frappe import _
|
||||||
from frappe.utils import add_to_date, date_diff, getdate, nowdate, get_last_day, formatdate
|
from frappe.utils import add_to_date, date_diff, getdate, nowdate, get_last_day, formatdate
|
||||||
from erpnext.accounts.report.general_ledger.general_ledger import execute
|
from erpnext.accounts.report.general_ledger.general_ledger import execute
|
||||||
from frappe.core.page.dashboard.dashboard import cache_source, get_from_date_from_timespan
|
from frappe.core.page.dashboard.dashboard import cache_source, get_from_date_from_timespan
|
||||||
@ -24,6 +25,9 @@ def get(chart_name = None, chart = None, no_cache = None, from_date = None, to_d
|
|||||||
account = filters.get("account")
|
account = filters.get("account")
|
||||||
company = filters.get("company")
|
company = filters.get("company")
|
||||||
|
|
||||||
|
if not account and chart:
|
||||||
|
frappe.throw(_("Account is not set for the dashboard chart {0}").format(chart))
|
||||||
|
|
||||||
if not to_date:
|
if not to_date:
|
||||||
to_date = nowdate()
|
to_date = nowdate()
|
||||||
if not from_date:
|
if not from_date:
|
||||||
|
@ -39,7 +39,7 @@ def get_message(exception):
|
|||||||
if hasattr(exception, 'message'):
|
if hasattr(exception, 'message'):
|
||||||
message = exception.message
|
message = exception.message
|
||||||
elif hasattr(exception, '__str__'):
|
elif hasattr(exception, '__str__'):
|
||||||
message = e.__str__()
|
message = exception.__str__()
|
||||||
else:
|
else:
|
||||||
message = "Something went wrong while syncing"
|
message = "Something went wrong while syncing"
|
||||||
return message
|
return message
|
||||||
|
@ -43,7 +43,7 @@ class ShopifySettings(Document):
|
|||||||
d.raise_for_status()
|
d.raise_for_status()
|
||||||
self.update_webhook_table(method, d.json())
|
self.update_webhook_table(method, d.json())
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
make_shopify_log(status="Warning", message=e, exception=False)
|
make_shopify_log(status="Warning", exception=e, rollback=True)
|
||||||
|
|
||||||
def unregister_webhooks(self):
|
def unregister_webhooks(self):
|
||||||
session = get_request_session()
|
session = get_request_session()
|
||||||
|
@ -2,11 +2,11 @@ frappe.listview_settings['Expense Claim'] = {
|
|||||||
add_fields: ["total_claimed_amount", "docstatus"],
|
add_fields: ["total_claimed_amount", "docstatus"],
|
||||||
get_indicator: function(doc) {
|
get_indicator: function(doc) {
|
||||||
if(doc.status == "Paid") {
|
if(doc.status == "Paid") {
|
||||||
return [__("Paid"), "green", "status,=,'Paid'"];
|
return [__("Paid"), "green", "status,=,Paid"];
|
||||||
}else if(doc.status == "Unpaid") {
|
}else if(doc.status == "Unpaid") {
|
||||||
return [__("Unpaid"), "orange"];
|
return [__("Unpaid"), "orange", "status,=,Unpaid"];
|
||||||
} else if(doc.status == "Rejected") {
|
} else if(doc.status == "Rejected") {
|
||||||
return [__("Rejected"), "grey"];
|
return [__("Rejected"), "grey", "status,=,Rejected"];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
@ -5,7 +5,7 @@ from __future__ import unicode_literals
|
|||||||
import frappe, erpnext
|
import frappe, erpnext
|
||||||
import datetime, math
|
import datetime, math
|
||||||
|
|
||||||
from frappe.utils import add_days, cint, cstr, flt, getdate, rounded, date_diff, money_in_words, getdate
|
from frappe.utils import add_days, cint, cstr, flt, getdate, rounded, date_diff, money_in_words
|
||||||
from frappe.model.naming import make_autoname
|
from frappe.model.naming import make_autoname
|
||||||
|
|
||||||
from frappe import msgprint, _
|
from frappe import msgprint, _
|
||||||
|
@ -33,6 +33,10 @@ class Company(NestedSet):
|
|||||||
return exists
|
return exists
|
||||||
|
|
||||||
def validate(self):
|
def validate(self):
|
||||||
|
self.update_default_account = False
|
||||||
|
if self.is_new():
|
||||||
|
self.update_default_account = True
|
||||||
|
|
||||||
self.validate_abbr()
|
self.validate_abbr()
|
||||||
self.validate_default_accounts()
|
self.validate_default_accounts()
|
||||||
self.validate_currency()
|
self.validate_currency()
|
||||||
@ -203,8 +207,8 @@ class Company(NestedSet):
|
|||||||
"default_expense_account": "Cost of Goods Sold"
|
"default_expense_account": "Cost of Goods Sold"
|
||||||
})
|
})
|
||||||
|
|
||||||
|
if self.update_default_account or frappe.flags.in_test:
|
||||||
for default_account in default_accounts:
|
for default_account in default_accounts:
|
||||||
if self.is_new() or frappe.flags.in_test or frappe.flags.in_demo:
|
|
||||||
self._set_default_account(default_account, default_accounts.get(default_account))
|
self._set_default_account(default_account, default_accounts.get(default_account))
|
||||||
|
|
||||||
if not self.default_income_account:
|
if not self.default_income_account:
|
||||||
|
@ -6,9 +6,9 @@ frappe.listview_settings['Delivery Note'] = {
|
|||||||
return [__("Return"), "darkgrey", "is_return,=,Yes"];
|
return [__("Return"), "darkgrey", "is_return,=,Yes"];
|
||||||
} else if (doc.status === "Closed") {
|
} else if (doc.status === "Closed") {
|
||||||
return [__("Closed"), "green", "status,=,Closed"];
|
return [__("Closed"), "green", "status,=,Closed"];
|
||||||
} else if (doc.grand_total !== 0 && flt(doc.per_billed, 2) < 100) {
|
} else if (flt(doc.per_billed, 2) < 100) {
|
||||||
return [__("To Bill"), "orange", "per_billed,<,100"];
|
return [__("To Bill"), "orange", "per_billed,<,100"];
|
||||||
} else if (doc.grand_total === 0 || flt(doc.per_billed, 2) == 100) {
|
} else if (flt(doc.per_billed, 2) == 100) {
|
||||||
return [__("Completed"), "green", "per_billed,=,100"];
|
return [__("Completed"), "green", "per_billed,=,100"];
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
Loading…
Reference in New Issue
Block a user