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"> <inherit inherit="main_menu">
<item string="General" position="before"> <item string="General" position="before">
<item string="Clinic" action="clinic_board"/> <item string="Clinic" perm="clinic_menu" action="clinic_board"/>
</item> </item>
</inherit> </inherit>

View File

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

View File

@ -1,4 +1,4 @@
from . import clinic_setting from . import clinic_setting
#from . import import_acc from . import import_acc
#from . import remove_conv_bal #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" _version="2.11.0"
def migrate(self): def migrate(self):
#data={} cbv_id=24
#lines=get_model("conv.bal").search_browse([]) cbv=get_model("conv.bal").browse(cbv_id)
#for conv in lines: cbv.write({
#if conv.id==24: 'file': 'tb.csv',
#for invoice in conv.sale_invoices: })
#amount_due=invoice.amount_due or 0 print("import acc file (step 1) running ...")
#number=invoice.number or "" get_model("conv.bal").import_acc([cbv.id],context={})
#if not data.get(number):
#data[number]={'amount_due': amount_due}
#f=open("/tmp/ar.csv","r") cbv.write({
#res=f.read().split("\n") 'file': 'ar.csv',
#total=0.0 })
#del res[0] print("import sale file (step 2)running ...")
#st="" get_model("conv.bal").import_sale_file([cbv.id],context={})
#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_id=24 print("import purch file (step 3) running ...")
#cbv=get_model("conv.bal").browse(cbv_id) cbv.write({
#cbv.write({ 'file': 'ap.csv',
#'file': 'tb.csv', })
#}) get_model("conv.bal").import_purch([cbv.id],context={})
#print("import acc file (step 1) running ...")
#cbv.write({ print("create invoice from setep 1 to 3 is running...")
#'file': 'ar.csv', print("create_open_entry...")
#}) cbv.create_open_entry()
#print("import sale file (step 2)running ...") print("create_sale_invoices...")
#get_model("conv.bal").import_sale_file([cbv.id],context={}) cbv.create_sale_invoices()
#user_id=get_active_user() print("create_purch_invoices...")
#print("user_id ", user_id) cbv.create_purch_invoices()
#set_active_user(1) print("Done!")
#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!")
return True return True
Migration.register() Migration.register()

View File

@ -21,7 +21,7 @@ class LaborCostLine(Model):
return res return res
_fields={ _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), "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), 'staff_id': fields.Many2One("clinic.staff", "Staff",search=True),
'level_id': fields.Many2One("clinic.staff.level", "Level",search=True), 'level_id': fields.Many2One("clinic.staff.level", "Level",search=True),