Merge branch 'hotfix'
This commit is contained in:
@@ -5,7 +5,7 @@ import frappe
|
|||||||
from erpnext.hooks import regional_overrides
|
from erpnext.hooks import regional_overrides
|
||||||
from frappe.utils import getdate
|
from frappe.utils import getdate
|
||||||
|
|
||||||
__version__ = '11.1.43'
|
__version__ = '11.1.44'
|
||||||
|
|
||||||
def get_default_company(user=None):
|
def get_default_company(user=None):
|
||||||
'''Get default company for user'''
|
'''Get default company for user'''
|
||||||
|
|||||||
@@ -4,6 +4,7 @@
|
|||||||
|
|
||||||
from __future__ import unicode_literals
|
from __future__ import unicode_literals
|
||||||
import frappe
|
import frappe
|
||||||
|
from frappe import _
|
||||||
from frappe.model.document import Document
|
from frappe.model.document import Document
|
||||||
|
|
||||||
class AccountingPeriod(Document):
|
class AccountingPeriod(Document):
|
||||||
@@ -33,7 +34,7 @@ class AccountingPeriod(Document):
|
|||||||
}, as_dict=True)
|
}, as_dict=True)
|
||||||
|
|
||||||
if len(existing_accounting_period) > 0:
|
if len(existing_accounting_period) > 0:
|
||||||
frappe.throw("Accounting Period overlaps with {0}".format(existing_accounting_period[0].get("name")))
|
frappe.throw(_("Accounting Period overlaps with {0}".format(existing_accounting_period[0].get("name"))))
|
||||||
|
|
||||||
def get_doctypes_for_closing(self):
|
def get_doctypes_for_closing(self):
|
||||||
docs_for_closing = []
|
docs_for_closing = []
|
||||||
|
|||||||
@@ -48,7 +48,7 @@ class BankStatementTransactionEntry(Document):
|
|||||||
|
|
||||||
def get_statement_headers(self):
|
def get_statement_headers(self):
|
||||||
if not self.bank_settings:
|
if not self.bank_settings:
|
||||||
frappe.throw("Bank Data mapper doesn't exist")
|
frappe.throw(_("Bank Data mapper doesn't exist"))
|
||||||
mapper_doc = frappe.get_doc("Bank Statement Settings", self.bank_settings)
|
mapper_doc = frappe.get_doc("Bank Statement Settings", self.bank_settings)
|
||||||
headers = {entry.mapped_header:entry.stmt_header for entry in mapper_doc.header_items}
|
headers = {entry.mapped_header:entry.stmt_header for entry in mapper_doc.header_items}
|
||||||
return headers
|
return headers
|
||||||
@@ -57,7 +57,7 @@ class BankStatementTransactionEntry(Document):
|
|||||||
if self.bank_statement is None: return
|
if self.bank_statement is None: return
|
||||||
filename = self.bank_statement.split("/")[-1]
|
filename = self.bank_statement.split("/")[-1]
|
||||||
if (len(self.new_transaction_items + self.reconciled_transaction_items) > 0):
|
if (len(self.new_transaction_items + self.reconciled_transaction_items) > 0):
|
||||||
frappe.throw("Transactions already retreived from the statement")
|
frappe.throw(_("Transactions already retreived from the statement"))
|
||||||
|
|
||||||
date_format = frappe.get_value("Bank Statement Settings", self.bank_settings, "date_format")
|
date_format = frappe.get_value("Bank Statement Settings", self.bank_settings, "date_format")
|
||||||
if (date_format is None):
|
if (date_format is None):
|
||||||
@@ -314,7 +314,7 @@ class BankStatementTransactionEntry(Document):
|
|||||||
try:
|
try:
|
||||||
reconcile_against_document(lst)
|
reconcile_against_document(lst)
|
||||||
except:
|
except:
|
||||||
frappe.throw("Exception occurred while reconciling {0}".format(payment.reference_name))
|
frappe.throw(_("Exception occurred while reconciling {0}".format(payment.reference_name)))
|
||||||
|
|
||||||
def submit_payment_entries(self):
|
def submit_payment_entries(self):
|
||||||
for payment in self.new_transaction_items:
|
for payment in self.new_transaction_items:
|
||||||
@@ -414,7 +414,7 @@ def get_transaction_entries(filename, headers):
|
|||||||
elif (filename.lower().endswith("xls")):
|
elif (filename.lower().endswith("xls")):
|
||||||
rows = get_rows_from_xls_file(filename)
|
rows = get_rows_from_xls_file(filename)
|
||||||
else:
|
else:
|
||||||
frappe.throw("Only .csv and .xlsx files are supported currently")
|
frappe.throw(_("Only .csv and .xlsx files are supported currently"))
|
||||||
|
|
||||||
stmt_headers = headers.values()
|
stmt_headers = headers.values()
|
||||||
for row in rows:
|
for row in rows:
|
||||||
|
|||||||
@@ -91,7 +91,7 @@ def get_paid_amount(payment_entry):
|
|||||||
return frappe.db.get_value(payment_entry.payment_document, payment_entry.payment_entry, "total_amount_reimbursed")
|
return frappe.db.get_value(payment_entry.payment_document, payment_entry.payment_entry, "total_amount_reimbursed")
|
||||||
|
|
||||||
else:
|
else:
|
||||||
frappe.throw("Please reconcile {0}: {1} manually".format(payment_entry.payment_document, payment_entry.payment_entry))
|
frappe.throw(_("Please reconcile {0}: {1} manually".format(payment_entry.payment_document, payment_entry.payment_entry)))
|
||||||
|
|
||||||
@frappe.whitelist()
|
@frappe.whitelist()
|
||||||
def unclear_reference_payment(doctype, docname):
|
def unclear_reference_payment(doctype, docname):
|
||||||
|
|||||||
@@ -157,7 +157,7 @@ erpnext.accounts.PurchaseInvoice = erpnext.buying.BuyingController.extend({
|
|||||||
can_change_release_date: function(date) {
|
can_change_release_date: function(date) {
|
||||||
const diff = frappe.datetime.get_diff(date, frappe.datetime.nowdate());
|
const diff = frappe.datetime.get_diff(date, frappe.datetime.nowdate());
|
||||||
if (diff < 0) {
|
if (diff < 0) {
|
||||||
frappe.throw('New release date should be in the future');
|
frappe.throw(__('New release date should be in the future'));
|
||||||
return false;
|
return false;
|
||||||
} else {
|
} else {
|
||||||
return true;
|
return true;
|
||||||
|
|||||||
@@ -4,6 +4,7 @@
|
|||||||
|
|
||||||
from __future__ import unicode_literals
|
from __future__ import unicode_literals
|
||||||
import frappe
|
import frappe
|
||||||
|
from frappe import _
|
||||||
from frappe.model.document import Document
|
from frappe.model.document import Document
|
||||||
from erpnext.utilities.product import get_price
|
from erpnext.utilities.product import get_price
|
||||||
|
|
||||||
@@ -13,7 +14,7 @@ class SubscriptionPlan(Document):
|
|||||||
|
|
||||||
def validate_interval_count(self):
|
def validate_interval_count(self):
|
||||||
if self.billing_interval_count < 1:
|
if self.billing_interval_count < 1:
|
||||||
frappe.throw('Billing Interval Count cannot be less than 1')
|
frappe.throw(_('Billing Interval Count cannot be less than 1'))
|
||||||
|
|
||||||
@frappe.whitelist()
|
@frappe.whitelist()
|
||||||
def get_plan_rate(plan, quantity=1, customer=None):
|
def get_plan_rate(plan, quantity=1, customer=None):
|
||||||
|
|||||||
@@ -4,6 +4,7 @@
|
|||||||
|
|
||||||
from __future__ import unicode_literals
|
from __future__ import unicode_literals
|
||||||
import frappe, json
|
import frappe, json
|
||||||
|
from frappe import _
|
||||||
from frappe.model.document import Document
|
from frappe.model.document import Document
|
||||||
from erpnext.education.api import get_grade
|
from erpnext.education.api import get_grade
|
||||||
from frappe.utils.pdf import get_pdf
|
from frappe.utils.pdf import get_pdf
|
||||||
@@ -88,4 +89,4 @@ def get_attendance_count(student, academic_year, academic_term=None):
|
|||||||
attendance["Present"] = 0
|
attendance["Present"] = 0
|
||||||
return attendance
|
return attendance
|
||||||
else:
|
else:
|
||||||
frappe.throw("Provide the academic year and set the starting and ending date.")
|
frappe.throw(_("Provide the academic year and set the starting and ending date."))
|
||||||
@@ -252,6 +252,6 @@ def get_tax_account_head(tax):
|
|||||||
{"parent": "Shopify Settings", "shopify_tax": tax_title}, "tax_account")
|
{"parent": "Shopify Settings", "shopify_tax": tax_title}, "tax_account")
|
||||||
|
|
||||||
if not tax_account:
|
if not tax_account:
|
||||||
frappe.throw("Tax Account not specified for Shopify Tax {0}".format(tax.get("title")))
|
frappe.throw(_("Tax Account not specified for Shopify Tax {0}".format(tax.get("title"))))
|
||||||
|
|
||||||
return tax_account
|
return tax_account
|
||||||
|
|||||||
@@ -30,7 +30,7 @@ class ClinicalProcedureTemplate(Document):
|
|||||||
try:
|
try:
|
||||||
frappe.delete_doc("Item",self.item)
|
frappe.delete_doc("Item",self.item)
|
||||||
except Exception:
|
except Exception:
|
||||||
frappe.throw("""Not permitted. Please disable the Procedure Template""")
|
frappe.throw(_("""Not permitted. Please disable the Procedure Template"""))
|
||||||
|
|
||||||
def get_item_details(self, args=None):
|
def get_item_details(self, args=None):
|
||||||
item = frappe.db.sql("""select stock_uom, item_name
|
item = frappe.db.sql("""select stock_uom, item_name
|
||||||
|
|||||||
@@ -160,7 +160,7 @@ var btn_create_vital_signs = function (frm) {
|
|||||||
|
|
||||||
var btn_create_procedure = function (frm) {
|
var btn_create_procedure = function (frm) {
|
||||||
if(!frm.doc.patient){
|
if(!frm.doc.patient){
|
||||||
frappe.throw("Please select patient");
|
frappe.throw(__("Please select patient"));
|
||||||
}
|
}
|
||||||
frappe.route_options = {
|
frappe.route_options = {
|
||||||
"patient": frm.doc.patient,
|
"patient": frm.doc.patient,
|
||||||
|
|||||||
@@ -84,7 +84,7 @@ def get_benefit_pro_rata_ratio_amount(employee, on_date, sal_struct):
|
|||||||
pay_against_benefit_claim, max_benefit_amount = frappe.db.get_value("Salary Component", sal_struct_row.salary_component, ["pay_against_benefit_claim", "max_benefit_amount"])
|
pay_against_benefit_claim, max_benefit_amount = frappe.db.get_value("Salary Component", sal_struct_row.salary_component, ["pay_against_benefit_claim", "max_benefit_amount"])
|
||||||
except TypeError:
|
except TypeError:
|
||||||
# show the error in tests?
|
# show the error in tests?
|
||||||
frappe.throw("Unable to find Salary Component {0}".format(sal_struct_row.salary_component))
|
frappe.throw(_("Unable to find Salary Component {0}".format(sal_struct_row.salary_component)))
|
||||||
if sal_struct_row.is_flexible_benefit == 1 and pay_against_benefit_claim != 1:
|
if sal_struct_row.is_flexible_benefit == 1 and pay_against_benefit_claim != 1:
|
||||||
total_pro_rata_max += max_benefit_amount
|
total_pro_rata_max += max_benefit_amount
|
||||||
if total_pro_rata_max > 0:
|
if total_pro_rata_max > 0:
|
||||||
|
|||||||
@@ -618,7 +618,7 @@ class SalarySlip(TransactionBase):
|
|||||||
elif not self.payment_days and not self.salary_slip_based_on_timesheet and cint(row.depends_on_payment_days):
|
elif not self.payment_days and not self.salary_slip_based_on_timesheet and cint(row.depends_on_payment_days):
|
||||||
amount, additional_amount = 0, 0
|
amount, additional_amount = 0, 0
|
||||||
elif not row.amount:
|
elif not row.amount:
|
||||||
amount = row.default_amount + row.additional_amount
|
amount = flt(row.default_amount) + flt(row.additional_amount)
|
||||||
|
|
||||||
# apply rounding
|
# apply rounding
|
||||||
if frappe.get_cached_value("Salary Component", row.salary_component, "round_to_the_nearest_integer"):
|
if frappe.get_cached_value("Salary Component", row.salary_component, "round_to_the_nearest_integer"):
|
||||||
|
|||||||
@@ -2,6 +2,7 @@ from __future__ import unicode_literals
|
|||||||
|
|
||||||
import frappe
|
import frappe
|
||||||
import json
|
import json
|
||||||
|
from frappe import _
|
||||||
|
|
||||||
from frappe import _
|
from frappe import _
|
||||||
from frappe.frappeclient import FrappeClient
|
from frappe.frappeclient import FrappeClient
|
||||||
@@ -120,7 +121,7 @@ def get_valid_items(search_value=''):
|
|||||||
def publish_selected_items(items_to_publish):
|
def publish_selected_items(items_to_publish):
|
||||||
items_to_publish = json.loads(items_to_publish)
|
items_to_publish = json.loads(items_to_publish)
|
||||||
if not len(items_to_publish):
|
if not len(items_to_publish):
|
||||||
frappe.throw('No items to publish')
|
frappe.throw(_('No items to publish'))
|
||||||
|
|
||||||
for item in items_to_publish:
|
for item in items_to_publish:
|
||||||
item_code = item.get('item_code')
|
item_code = item.get('item_code')
|
||||||
@@ -165,7 +166,7 @@ def item_sync_preprocess(intended_item_publish_count):
|
|||||||
frappe.db.set_value("Marketplace Settings", "Marketplace Settings", "sync_in_progress", 1)
|
frappe.db.set_value("Marketplace Settings", "Marketplace Settings", "sync_in_progress", 1)
|
||||||
return response
|
return response
|
||||||
else:
|
else:
|
||||||
frappe.throw('Unable to update remote activity')
|
frappe.throw(_('Unable to update remote activity'))
|
||||||
|
|
||||||
|
|
||||||
def item_sync_postprocess():
|
def item_sync_postprocess():
|
||||||
@@ -173,7 +174,7 @@ def item_sync_postprocess():
|
|||||||
if response:
|
if response:
|
||||||
frappe.db.set_value('Marketplace Settings', 'Marketplace Settings', 'last_sync_datetime', frappe.utils.now())
|
frappe.db.set_value('Marketplace Settings', 'Marketplace Settings', 'last_sync_datetime', frappe.utils.now())
|
||||||
else:
|
else:
|
||||||
frappe.throw('Unable to update remote activity')
|
frappe.throw(_('Unable to update remote activity'))
|
||||||
|
|
||||||
frappe.db.set_value('Marketplace Settings', 'Marketplace Settings', 'sync_in_progress', 0)
|
frappe.db.set_value('Marketplace Settings', 'Marketplace Settings', 'sync_in_progress', 0)
|
||||||
|
|
||||||
|
|||||||
@@ -316,6 +316,9 @@ def get_company_country(company):
|
|||||||
return frappe.get_cached_value('Company', company, 'country')
|
return frappe.get_cached_value('Company', company, 'country')
|
||||||
|
|
||||||
def get_e_invoice_attachments(invoice):
|
def get_e_invoice_attachments(invoice):
|
||||||
|
if not invoice.company_tax_id:
|
||||||
|
return []
|
||||||
|
|
||||||
out = []
|
out = []
|
||||||
attachments = get_attachments(invoice.doctype, invoice.name)
|
attachments = get_attachments(invoice.doctype, invoice.name)
|
||||||
company_tax_id = invoice.company_tax_id if invoice.company_tax_id.startswith("IT") else "IT" + invoice.company_tax_id
|
company_tax_id = invoice.company_tax_id if invoice.company_tax_id.startswith("IT") else "IT" + invoice.company_tax_id
|
||||||
|
|||||||
Reference in New Issue
Block a user