improvement

conv_bal
watcha.h@almacom.co.th 2015-01-20 20:58:38 +07:00
parent 91836fc86c
commit 44afe08d55
8 changed files with 25 additions and 17 deletions

View File

@ -6,6 +6,7 @@
<field name="date"/>
<field name="department_id"/>
<field name="branch_id"/>
<field name="nurse_total"/>
<field name="user_id"/>
<field name="state"/>
</list>

View File

@ -4,7 +4,7 @@
<item string="Labor Cost" action="clinic_labor_cost"/>
<item string="Labor Cost Items" action="clinic_labor_cost_item"/>
<item string="Labor Cost Entries" action="clinic_labor_cost_entry"/>
<!--<item string="Matching Invoices" action="clinic_report_payment_matching"/>-->
<item string="Matching Payment(Old)" action="clinic_report_payment_matching"/>
<item string="Matching Payment" action="clinic_matching_payment"/>
<item string="HD Case Expenses" action="clinic_hd_case_expense"/>
<divider/>

View File

@ -3,10 +3,6 @@
<field name="type_id" onchange="onchange_type" span="3"/>
<field name="hcode_id" span="3" attrs='{"invisible":[["show_hcode","=",0]]}'/>
<field name="show_hcode" invisible="1" span="3"/>
<group span="6" columns="1">
<button string='Match' type="success" icon="ok" method="match_invoice"/>
<button string='Make A Payment' method="make_payment" type="default" icon="arrow-right"/>
</group>
<group span="6" columns="1">
</group>
<button string='Match' type="success" icon="ok" size="small" method="match_invoice"/>
<button string='Make A Payment' method="make_payment" size="small" type="default" icon="arrow-right"/>
</form>

View File

@ -4,6 +4,7 @@ class AccountInvoice(Model):
_inherit="account.invoice"
_fields={
'clinic_expense_id': fields.Many2One("clinic.hd.case.expense","Expense"),
'department_id': fields.Many2One("clinic.department","Department",search=True),
}
AccountInvoice.register()

View File

@ -10,7 +10,7 @@ class CycleItem(Model):
_name_field="name"
_multi_company=True
def _get_all(self,ids,context={}):
def _get_store(self,ids,context={}):
res={}
for obj in self.browse(ids):
cycle=obj.cycle_id
@ -25,20 +25,29 @@ class CycleItem(Model):
}
return res
def _get_all(self,ids,context={}):
res={}
for obj in self.browse(ids):
res[obj.id]={
'nurse_total': len(obj.lines),
}
return res
_fields={
'name': fields.Char("Name",function="_get_all",function_multi=True,store=True),
'name': fields.Char("Name",function="_get_store",function_multi=True,store=True),
'date': fields.Date("Date",search=True),
'cycle_id': fields.Many2One("clinic.cycle", "Cycle",search=True),
'visits': fields.One2Many("clinic.visit","cycle_item_id", "Visits"),
'hd_cases': fields.One2Many("clinic.hd.case","cycle_item_id", "HD Cases"),
'lines': fields.One2Many("clinic.cycle.item.line",'cycle_item_id','Nurses'),
'sequence': fields.Char("Sequence",function="_get_all",function_multi=True,store=True),
'sequence': fields.Char("Sequence",function="_get_store",function_multi=True,store=True),
'user_id': fields.Many2One("base.user","Validator"),
'company_id': fields.Many2One("company", "Company"),
'branch_id': fields.Many2One("clinic.branch", "Branch",search=True),
'department_id': fields.Many2One("clinic.department", "Department",search=True),
"comments": fields.One2Many("message","related_id","Comments"), "company_id": fields.Many2One("company","Company"),
"state": fields.Selection([("draft","Draft"),("validated","Validated")],"Status",required=True),
'nurse_total': fields.Integer("Total (Nurse)",function="_get_all",function_multi=True),
}
def _get_branch(self,context={}):

View File

@ -25,9 +25,9 @@ class Dialyzer(Model):
"company_id": fields.Many2One("company","Company"),
'product_id': fields.Many2One("product", "Product",required=True),
"pickings": fields.One2Many("stock.picking","related_id","Pickings"),
"patient_id": fields.Many2One("clinic.patient","Patient"),
"visit_id": fields.Many2One("clinic.visit","Visit"),
"hd_case_id": fields.Many2One("clinic.hd.case","HD Case"),
"patient_id": fields.Many2One("clinic.patient","Patient",search=True),
"visit_id": fields.Many2One("clinic.visit","Visit",search=True),
"hd_case_id": fields.Many2One("clinic.hd.case","HD Case",search=True),
"hd_cases": fields.One2Many("clinic.hd.case","dlz_id","HD Case"), #TODO funtion to get hd case
'department_id': fields.Many2One("clinic.department","Department",search=True),
}

View File

@ -435,7 +435,8 @@ class HDCase(Model):
"inv_type": "invoice",
"tax_type": "tax_in",
'due_date': due_date,
"ref": obj.number,
"ref": '%s (%s)'%(patient.name or '',patient.number or ''),
'department_id': obj.department_id.id,
"related_id": "clinic.hd.case,%s"%obj.id,
"currency_id": currency_id,
"company_id": company_id,

View File

@ -161,7 +161,7 @@ class VisitBoard(Model):
department=visit.department_id
if not branch:
branch=department.branch_id
hn_name=patient.hn_no or '-'
visit_date=visit.visit_date
@ -183,8 +183,8 @@ class VisitBoard(Model):
'cycle_color': cycle.color,
'department_id': department.id,
'department_name': department.name or '',
'branch_id': branch.id,
'branch_name': branch.name or '',
'branch_id': branch and branch.id or None,
'branch_name': branch and branch.name or '',
'patient_name': patient.name,
'patient_id': patient.id,
'patient_type': patient.type_id.name or "",