conv_bal
watcha.h 2015-02-23 14:12:30 +07:00
parent 4b767ecab8
commit 26441129be
5 changed files with 31 additions and 71 deletions

View File

@ -1,5 +1,5 @@
<inherit inherit="main_menu">
<item string="General" position="before">
<item string="Clinic" action="clinic_board"/>
<item string="Clinic" perm="clinic_menu" action="clinic_board"/>
</item>
</inherit>

View File

@ -1,4 +1,4 @@
<menu string="Clinic" perm="clinic">
<menu string="Clinic">
<item string="Dashboard" action="clinic_board"/>
<item string="Staffs" perm="clinic_staff">
<item string="Staffs" action="clinic_staff" action_options="tab_no=2"/>

View File

@ -1,4 +1,4 @@
from . import clinic_setting
#from . import import_acc
from . import import_acc
#from . import remove_conv_bal
from . import update_labor_cost_line
#from . import update_labor_cost_line

View File

@ -7,74 +7,34 @@ class Migration(migration.Migration):
_version="2.11.0"
def migrate(self):
#data={}
#lines=get_model("conv.bal").search_browse([])
#for conv in lines:
#if conv.id==24:
#for invoice in conv.sale_invoices:
#amount_due=invoice.amount_due or 0
#number=invoice.number or ""
#if not data.get(number):
#data[number]={'amount_due': amount_due}
cbv_id=24
cbv=get_model("conv.bal").browse(cbv_id)
cbv.write({
'file': 'tb.csv',
})
print("import acc file (step 1) running ...")
get_model("conv.bal").import_acc([cbv.id],context={})
#f=open("/tmp/ar.csv","r")
#res=f.read().split("\n")
#total=0.0
#del res[0]
#st=""
#no=1
#for r in res:
#r=r.split(",")
#number=r[0]
#if not data.get(number):
#st+=','.join(r)
#st+='\n'
#print(no, 'XXX ', r)
#no+=1
#f=open("res.csv","w")
#f.write(st)
#f.close()
#print("diff ", total)
cbv.write({
'file': 'ar.csv',
})
print("import sale file (step 2)running ...")
get_model("conv.bal").import_sale_file([cbv.id],context={})
#cbv_id=24
#cbv=get_model("conv.bal").browse(cbv_id)
#cbv.write({
#'file': 'tb.csv',
#})
#print("import acc file (step 1) running ...")
#cbv.write({
#'file': 'ar.csv',
#})
#print("import sale file (step 2)running ...")
#get_model("conv.bal").import_sale_file([cbv.id],context={})
#user_id=get_active_user()
#print("user_id ", user_id)
#set_active_user(1)
#cbv_id=24
#print("create_open_entry...")
#cbv=get_model("conv.bal").browse(cbv_id)
#old={}
#for purchase in cbv.purch_invoices:
#number=purchase.number or ''
#print('number ', number)
#if not old.get(number):
#old.update({
#'x': [number],
#})
#else:
#x=old[number]['x']
#number='%s.%s'%(number,len(x))
#print('!!number ', number)
#purchase.write({
#'number': number,
#})
#x.append(number)
#cbv.create_open_entry()
#print("create_sale_invoices...")
#cbv.create_sale_invoices()
#print("create_purch_invoices...")
#cbv.create_purch_invoices()
#print("Done!")
print("import purch file (step 3) running ...")
cbv.write({
'file': 'ap.csv',
})
get_model("conv.bal").import_purch([cbv.id],context={})
print("create invoice from setep 1 to 3 is running...")
print("create_open_entry...")
cbv.create_open_entry()
print("create_sale_invoices...")
cbv.create_sale_invoices()
print("create_purch_invoices...")
cbv.create_purch_invoices()
print("Done!")
return True
Migration.register()

View File

@ -21,7 +21,7 @@ class LaborCostLine(Model):
return res
_fields={
"labor_cost_id": fields.Many2One("clinic.labor.cost","Cycle Item",required=True,on_delete="cascade"),
"labor_cost_id": fields.Many2One("clinic.labor.cost","Labor Cost",required=True,on_delete="cascade"),
"type": fields.Selection([('staff','Staff'),("doctor","Doctor"),('nurse','Nurse')],"Staff Type",required=True,search=True,function="_get_store",function_multi=True),
'staff_id': fields.Many2One("clinic.staff", "Staff",search=True),
'level_id': fields.Many2One("clinic.staff.level", "Level",search=True),