diff --git a/netforce_clinic/models/hd_case_expense.py b/netforce_clinic/models/hd_case_expense.py index 5bd5c9c..a6afdea 100644 --- a/netforce_clinic/models/hd_case_expense.py +++ b/netforce_clinic/models/hd_case_expense.py @@ -28,7 +28,7 @@ class HDCaseExpense(Model): return res _fields={ - 'name': fields.Char("Name", function="_get_store",store=True), + 'name': fields.Char("Name", size=256, function="_get_store",store=True), 'date': fields.Date("Date",required=True,search=True), 'patient_id': fields.Many2One("clinic.patient","Patient",domain=[['state','=','admit']], required=True,search=True), 'hd_case_id': fields.Many2One("clinic.hd.case","HD Case",required=True,search=True), diff --git a/netforce_clinic/models/report_cycle_item.py b/netforce_clinic/models/report_cycle_item.py index 06d9685..98dc708 100644 --- a/netforce_clinic/models/report_cycle_item.py +++ b/netforce_clinic/models/report_cycle_item.py @@ -143,8 +143,12 @@ class ReportCycleItem(Model): total_epo=0 for line in hdcase.lines: prod=line.product_id - if prod.categ_id.code=='EPO': - total_epo+=line.qty or 0 + if prod.categ_id: + if prod.categ_id.code=='EPO': + total_epo+=line.qty or 0 + else: + pass + #print('>>> ', hdcase.number, prod.id, prod.name) lines.append({ 'dlz_drop': dlz_drop,