diff --git a/netforce_clinic/models/hd_case.py b/netforce_clinic/models/hd_case.py index ada3f76..bc57792 100644 --- a/netforce_clinic/models/hd_case.py +++ b/netforce_clinic/models/hd_case.py @@ -1157,10 +1157,23 @@ class HDCase(Model): sub_total=0 amount_total=0 lines=[] + def get_prod(desc): + product=None + if desc: + i1=desc.index('[') + i2=desc.index(']') + code=desc[i1+1:i2] + for prod in get_model("product").search_browse([['code','=',code]]): + product=prod + return product + for line in payment.lines: amt=line.amount or 0 desc=line.description or '' uom_name="" + prod=get_prod(desc) + if prod: + uom_name=prod.uom_id.name lines.append({ 'no': no, 'product_name': '',