improve
parent
c2bf1aaa86
commit
9f1fe78829
|
@ -2,7 +2,7 @@
|
||||||
<head>
|
<head>
|
||||||
<field name="state"/>
|
<field name="state"/>
|
||||||
<button string="Options" dropdown="1">
|
<button string="Options" dropdown="1">
|
||||||
<item string="Copy" method="copy" states="active,drop,expire"/>
|
<item string="Copy" method="copy"/>
|
||||||
<item string="To Draft" method="to_draft" states="active"/>
|
<item string="To Draft" method="to_draft" states="active"/>
|
||||||
</button>
|
</button>
|
||||||
</head>
|
</head>
|
||||||
|
|
|
@ -4,4 +4,5 @@
|
||||||
#from . import tb_ap_import
|
#from . import tb_ap_import
|
||||||
#from . import check_seq
|
#from . import check_seq
|
||||||
#from . import del_gi
|
#from . import del_gi
|
||||||
from . import restore_picking
|
#from . import restore_picking
|
||||||
|
from . import rename_dbl_hdcase_number
|
||||||
|
|
|
@ -0,0 +1,28 @@
|
||||||
|
import time
|
||||||
|
|
||||||
|
from netforce.model import get_model
|
||||||
|
from netforce import migration
|
||||||
|
from netforce.access import set_active_user, set_active_company
|
||||||
|
from netforce.database import get_connection
|
||||||
|
|
||||||
|
class Migration(migration.Migration):
|
||||||
|
_name="clinic.rename.dbl.hdcase.number"
|
||||||
|
_version="2.12.2"
|
||||||
|
|
||||||
|
def migrate(self):
|
||||||
|
db=get_connection()
|
||||||
|
res=db.query("""
|
||||||
|
select c, number from (select count(number) as c,number from clinic_hd_case group by number order by number) as r1 where c > 1;
|
||||||
|
""")
|
||||||
|
for r in res:
|
||||||
|
number=r['number']
|
||||||
|
if number!='/':
|
||||||
|
count=1
|
||||||
|
for hdcase in get_model('clinic.hd.case').search_browse([['number','=',number]]):
|
||||||
|
hdcase.write({
|
||||||
|
'number': number+"."+str(count),
|
||||||
|
})
|
||||||
|
count+=1
|
||||||
|
print(r)
|
||||||
|
|
||||||
|
Migration.register()
|
|
@ -14,4 +14,5 @@ class User(Model):
|
||||||
_defaults={
|
_defaults={
|
||||||
'auto_load_dpt': True,
|
'auto_load_dpt': True,
|
||||||
}
|
}
|
||||||
|
|
||||||
User.register()
|
User.register()
|
||||||
|
|
|
@ -91,7 +91,7 @@ class Department(Model):
|
||||||
['clinic.sickbed','department_id.code','='],
|
['clinic.sickbed','department_id.code','='],
|
||||||
['clinic.shop','department_id.code','='],
|
['clinic.shop','department_id.code','='],
|
||||||
['clinic.department','code','='], #XXX
|
['clinic.department','code','='], #XXX
|
||||||
['clinic.dialyzer','department_id.code','='],
|
#['clinic.dialyzer','department_id.code','='], # support to use different location
|
||||||
['clinic.schedule','department_id.code','='],
|
['clinic.schedule','department_id.code','='],
|
||||||
]
|
]
|
||||||
for obj in self.browse(ids):
|
for obj in self.browse(ids):
|
||||||
|
|
|
@ -319,7 +319,8 @@ class HDCase(Model):
|
||||||
"date": lambda *a: time.strftime("%Y-%m-%d"),
|
"date": lambda *a: time.strftime("%Y-%m-%d"),
|
||||||
"time_start": lambda *a: time.strftime("%Y-%m-%d %H:%M:%S"),
|
"time_start": lambda *a: time.strftime("%Y-%m-%d %H:%M:%S"),
|
||||||
"time_stop": lambda *a: time.strftime("%Y-%m-%d %H:%M:%S"),
|
"time_stop": lambda *a: time.strftime("%Y-%m-%d %H:%M:%S"),
|
||||||
'number': '/',
|
#'number': '/',
|
||||||
|
'number': _get_number,
|
||||||
"company_id": lambda *a: get_active_company(),
|
"company_id": lambda *a: get_active_company(),
|
||||||
'hd_acc': 'o',
|
'hd_acc': 'o',
|
||||||
'hd_mode': 'chronic',
|
'hd_mode': 'chronic',
|
||||||
|
|
Loading…
Reference in New Issue