Skip to content

Commit

Permalink
feat: port to version-14
Browse files Browse the repository at this point in the history
  • Loading branch information
agritheory committed Nov 16, 2022
1 parent 3f61a25 commit cb8f9a5
Show file tree
Hide file tree
Showing 7 changed files with 54 additions and 36 deletions.
2 changes: 1 addition & 1 deletion check_run/__init__.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@

__version__ = '13.0.0'
__version__ = '14.0.0'

3 changes: 2 additions & 1 deletion check_run/hooks.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,15 @@
app_color = "grey"
app_email = "[email protected]"
app_license = "MIT"
required_apps = ["erpnext", "hrms"]

# Includes in <head>
# ------------------

# include js, css files in header of desk.html
# app_include_css = "/assets/check_run/css/check_run.css"
app_include_js = [
"/assets/js/check_run.min.js"
"check_run.bundle.js",
]

# include js, css files in header of web template
Expand Down
2 changes: 2 additions & 0 deletions check_run/public/js/check_run.bundle.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
import './check_run/check_run_quick_entry.js'
import './check_run/check_run.js'
30 changes: 15 additions & 15 deletions check_run/public/js/check_run/check_run_quick_entry.js
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
frappe.provide('frappe.ui.form')
frappe.provide('frappe.ui.form');

frappe.ui.form.CheckRunQuickEntryForm = frappe.ui.form.QuickEntryForm.extend({
init: function (doctype, after_insert) {
this._super(doctype, after_insert)
},
render_dialog: function () {
frappe.ui.form.CheckRunQuickEntryForm = class CheckRunQuickEntryForm extends frappe.ui.form.QuickEntryForm {
constructor(doctype, after_insert, init_callback, doc, force) {
super(doctype, after_insert, init_callback, doc, force)
}
render_dialog() {
this.mandatory = this.get_fields()
this._super()
super.render_dialog();
this.dialog.$wrapper.find('.btn-secondary').hide()
this.dialog.fields_dict["bank_account"].get_query = () => {
return {
Expand All @@ -27,8 +27,8 @@ frappe.ui.form.CheckRunQuickEntryForm = frappe.ui.form.QuickEntryForm.extend({
this.default_accounts()
}
this.default_accounts()
},
get_fields: function () {
}
get_fields() {
return [
{
label: __("Company"),
Expand All @@ -52,8 +52,8 @@ frappe.ui.form.CheckRunQuickEntryForm = frappe.ui.form.QuickEntryForm.extend({
reqd: 1
}
]
},
default_accounts: function () {
}
default_accounts() {
if (frappe.get_route() && frappe.get_route()[0] == 'Form') {
this.dialog.fields_dict["company"] = cur_frm.doc.company
this.dialog.fields_dict["pay_to_account"].set_value(cur_frm.doc.pay_to_account)
Expand All @@ -69,8 +69,8 @@ frappe.ui.form.CheckRunQuickEntryForm = frappe.ui.form.QuickEntryForm.extend({
this.dialog.fields_dict["bank_account"].set_value(r.message.name)
})
}
},
register_primary_action: function () {
}
register_primary_action() {
const me = this
this.dialog.set_primary_action(__('Start Check Run'), () => {
let values = me.dialog.get_values()
Expand All @@ -80,5 +80,5 @@ frappe.ui.form.CheckRunQuickEntryForm = frappe.ui.form.QuickEntryForm.extend({
frappe.set_route("Form", "Check Run", r)
})
})
},
})
}
}
31 changes: 31 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
[project]
name = "check_run"
authors = [
{ name = "AgriTheory", email = "[email protected]"}
]
description = "Payables utility for ERPNext"
requires-python = ">=3.10"
readme = "README.md"
dynamic = ["version"]
dependencies = [
"atnacha @ git+https://github.com/AgriTheory/atnacha.git@main#egg=atnacha"
]

[build-system]
requires = ["flit_core >=3.4,<4"]
build-backend = "flit_core.buildapi"

[tool.bench.dev-dependencies]
hypothesis = "~=6.31.0"

[tool.black]
line-length = 99

[tool.isort]
line_length = 99
multi_line_output = 3
include_trailing_comma = true
force_grid_wrap = 0
use_parentheses = true
ensure_newline_before_comments = true
indent = "\t"
2 changes: 0 additions & 2 deletions requirements.txt

This file was deleted.

20 changes: 3 additions & 17 deletions setup.py
Original file line number Diff line number Diff line change
@@ -1,19 +1,5 @@
from setuptools import setup, find_packages
from setuptools import setup

with open("requirements.txt") as f:
install_requires = f.read().strip().split("\n")
name = "check_run"

# get version from __version__ variable in check_run/__init__.py
from check_run import __version__ as version

setup(
name="check_run",
version=version,
description="Payables Utilities for ERPNext",
author="AgriTheory",
author_email="[email protected]",
packages=find_packages(),
zip_safe=False,
include_package_data=True,
install_requires=install_requires
)
setup()

0 comments on commit cb8f9a5

Please sign in to comment.