Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
irul
/
opensipkd-base
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Wiki
Settings
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit 7ef21837
authored
Oct 04, 2021
by
aa.gusti
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
remove odoo
1 parent
741afb2f
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
38 additions
and
5 deletions
opensipkd/base/models/__init__.py
opensipkd/base/scripts/initializedb.py
opensipkd/base/views/partner.py
opensipkd/base/models/__init__.py
View file @
7ef2183
...
...
@@ -368,6 +368,14 @@ class Holiday(Base, DefaultModel):
return
db_session
.
query
(
cls
)
.
filter_by
(
tanggal
=
tanggal
)
class
UserDeviceModel
(
Base
,
KodeModel
):
__tablename__
=
'user_device'
user_id
=
Column
(
Integer
,
ForeignKey
(
User
.
id
))
kode
=
Column
(
String
(
256
))
token
=
Column
(
String
(
256
))
logged_in
=
Column
(
Integer
)
las_login_date
=
Column
(
DateTime
)
# from .ws_user import WsUser
from
.targets
import
Targets
from
.departemen
import
Departemen
,
DepartemenUser
...
...
opensipkd/base/scripts/initializedb.py
View file @
7ef2183
...
...
@@ -170,7 +170,7 @@ def append_csv(table, filename, keys, get_file_func=get_file,
continue
else
:
row
=
table
()
user
=
False
for
fname
in
cf
:
if
not
fname
:
continue
...
...
@@ -179,13 +179,23 @@ def append_csv(table, filename, keys, get_file_func=get_file,
val
=
data
[
fname_orig
]
if
not
val
:
continue
setattr
(
row
,
fname_orig
,
val
)
if
fname_orig
==
"user_password"
:
init_model
()
UserService
.
set_password
(
row
,
val
)
if
fname_orig
==
"user_password"
:
user
=
True
password
=
val
else
:
print
(
fname_orig
)
setattr
(
row
,
fname_orig
,
val
)
db_session
.
add
(
row
)
db_session
.
flush
()
if
user
:
row
=
db_session
.
query
(
User
)
.
filter_by
(
id
=
row
.
id
)
.
first
()
init_model
()
UserService
.
set_password
(
row
,
password
)
db_session
.
add
(
row
)
db_session
.
flush
()
transaction
.
commit
()
# diperlukan commit per record khususnya untuk yang internal link
...
...
@@ -236,6 +246,7 @@ def base_alembic_run(ini_file, name=None):
def
main
(
argv
=
sys
.
argv
):
if
len
(
argv
)
!=
2
:
usage
(
argv
)
config_uri
=
argv
[
1
]
setup_logging
(
config_uri
)
settings
=
get_appsettings
(
config_uri
)
...
...
opensipkd/base/views/partner.py
View file @
7ef2183
...
...
@@ -357,3 +357,17 @@ def id_not_found(request):
msg
=
'Partner ID
%
s Tidak Ditemukan.'
%
request
.
matchdict
[
'id'
]
request
.
session
.
flash
(
msg
,
'error'
)
return
route_list
(
request
)
def
get_partner_list
():
r
=
[]
q
=
DBSession
.
query
(
Partner
)
.
order_by
(
Partner
.
nama
)
for
row
in
q
:
g
=
(
str
(
row
.
id
),
(
f
"{row.kode}/ {row.nama}"
))
r
.
append
(
g
)
return
r
@colander.deferred
def
partner_widget
(
node
,
kw
):
values
=
kw
.
get
(
'partner_list'
,
[])
return
widget
.
Select2Widget
(
values
=
values
)
Write
Preview
Markdown
is supported
Attach a file
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to post a comment