fix: minor linting issues (#27314)

* fix: syntax error in gratuity

* fix: unpacking None into three variables

* fix: unexpected kwarg for delete_accounting_dimensions
This commit is contained in:
Ankush Menat 2021-09-02 17:42:45 +05:30 committed by GitHub
parent 60185c8c71
commit eec40513be
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 6 additions and 6 deletions

View File

@ -48,9 +48,9 @@ class AccountingDimension(Document):
def on_trash(self):
if frappe.flags.in_test:
delete_accounting_dimension(doc=self, queue='long')
delete_accounting_dimension(doc=self)
else:
frappe.enqueue(delete_accounting_dimension, doc=self)
frappe.enqueue(delete_accounting_dimension, doc=self, queue='long')
def set_fieldname_and_label(self):
if not self.label:

View File

@ -1405,7 +1405,7 @@ def get_reference_details(reference_doctype, reference_name, party_account_curre
})
def get_amounts_based_on_reference_doctype(reference_doctype, ref_doc, party_account_currency, company_currency, reference_name):
total_amount, outstanding_amount, exchange_rate = None
total_amount = outstanding_amount = exchange_rate = None
if reference_doctype == "Fees":
total_amount = ref_doc.get("grand_total")
exchange_rate = 1
@ -1425,7 +1425,7 @@ def get_amounts_based_on_reference_doctype(reference_doctype, ref_doc, party_acc
return total_amount, outstanding_amount, exchange_rate
def get_amounts_based_on_ref_doc(reference_doctype, ref_doc, party_account_currency, company_currency):
total_amount, outstanding_amount, exchange_rate = None
total_amount = outstanding_amount = exchange_rate = None
if ref_doc.doctype == "Expense Claim":
total_amount = flt(ref_doc.total_sanctioned_amount) + flt(ref_doc.total_taxes_and_charges)
elif ref_doc.doctype == "Employee Advance":
@ -1465,7 +1465,7 @@ def get_total_amount_exchange_rate_base_on_currency(party_account_currency, comp
return total_amount, exchange_rate
def get_bill_no_and_update_amounts(reference_doctype, ref_doc, total_amount, exchange_rate, party_account_currency, company_currency):
outstanding_amount, bill_no = None
outstanding_amount = bill_no = None
if reference_doctype in ("Sales Invoice", "Purchase Invoice"):
outstanding_amount = ref_doc.get("outstanding_amount")
bill_no = ref_doc.get("bill_no")

View File

@ -14,7 +14,7 @@ class GratuityRule(Document):
def validate(self):
for current_slab in self.gratuity_rule_slabs:
if (current_slab.from_year > current_slab.to_year) and current_slab.to_year != 0:
frappe(_("Row {0}: From (Year) can not be greater than To (Year)").format(current_slab.idx))
frappe.throw(_("Row {0}: From (Year) can not be greater than To (Year)").format(current_slab.idx))
if current_slab.to_year == 0 and current_slab.from_year == 0 and len(self.gratuity_rule_slabs) > 1:
frappe.throw(_("You can not define multiple slabs if you have a slab with no lower and upper limits."))