style: Indents & file headers
This commit is contained in:
parent
9c69b9e9f7
commit
e989bfa41d
4 changed files with 18 additions and 11 deletions
|
|
@ -1,13 +1,14 @@
|
|||
# -*- coding: utf-8 -*-
|
||||
# Copyright (c) 2018, Frappe Technologies and contributors
|
||||
# Copyright (c) 2021, Frappe Technologies and contributors
|
||||
# License: MIT. See LICENSE
|
||||
|
||||
import hashlib
|
||||
|
||||
import frappe
|
||||
from frappe import _
|
||||
from frappe.model.document import Document
|
||||
from frappe.utils import cint, now_datetime
|
||||
import hashlib
|
||||
from frappe.query_builder import DocType
|
||||
from frappe.utils import cint, now_datetime
|
||||
|
||||
|
||||
class TransactionLog(Document):
|
||||
def before_insert(self):
|
||||
|
|
@ -50,7 +51,9 @@ def get_current_index():
|
|||
frappe.qb.from_(series)
|
||||
.where(series.name == "TRANSACTLOG")
|
||||
.for_update()
|
||||
.select("current").run())
|
||||
.select("current")
|
||||
).run()
|
||||
|
||||
if current and current[0][0] is not None:
|
||||
current = current[0][0]
|
||||
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
# Copyright (c) 2019, Frappe Technologies and contributors
|
||||
# Copyright (c) 2021, Frappe Technologies and contributors
|
||||
# License: MIT. See LICENSE
|
||||
|
||||
import frappe
|
||||
|
|
@ -12,9 +12,9 @@ def execute(filters=None):
|
|||
return columns, data
|
||||
|
||||
def get_data(filters=None):
|
||||
|
||||
logs = frappe.get_all("Transaction Log", fields=["*"], order_by="creation desc")
|
||||
result = []
|
||||
logs = frappe.get_all("Transaction Log", fields=["*"], order_by="creation desc")
|
||||
|
||||
for l in logs:
|
||||
row_index = int(l.row_index)
|
||||
if row_index > 1:
|
||||
|
|
|
|||
|
|
@ -47,7 +47,8 @@ def get_tagged_docs(doctype, tag):
|
|||
return (
|
||||
frappe.qb.from_(doctype)
|
||||
.where(doctype._user_tags.like(tag))
|
||||
.select(doctype.name).run())
|
||||
.select(doctype.name)
|
||||
).run()
|
||||
|
||||
@frappe.whitelist()
|
||||
def get_tags(doctype, txt):
|
||||
|
|
|
|||
|
|
@ -201,7 +201,9 @@ def getseries(key, digits):
|
|||
frappe.qb.from_(series)
|
||||
.where(series.name == key)
|
||||
.for_update()
|
||||
.select("current").run())
|
||||
.select("current")
|
||||
).run()
|
||||
|
||||
if current and current[0][0] is not None:
|
||||
current = current[0][0]
|
||||
# yes, update it
|
||||
|
|
@ -272,7 +274,8 @@ def revert_series_if_last(key, name, doc=None):
|
|||
frappe.qb.from_(series)
|
||||
.where(series.name == prefix)
|
||||
.for_update()
|
||||
.select("current").run())
|
||||
.select("current")
|
||||
).run()
|
||||
|
||||
if current and current[0][0]==count:
|
||||
frappe.db.sql("UPDATE `tabSeries` SET `current` = `current` - 1 WHERE `name`=%s", prefix)
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue