diff --git a/netforce_clinic/layouts/clinic_prod_categ_list.xml b/netforce_clinic/layouts/clinic_prod_categ_list.xml
index 682cad0..2fbe324 100644
--- a/netforce_clinic/layouts/clinic_prod_categ_list.xml
+++ b/netforce_clinic/layouts/clinic_prod_categ_list.xml
@@ -1,5 +1,5 @@
-
+
diff --git a/netforce_clinic/layouts/clinic_prod_list.xml b/netforce_clinic/layouts/clinic_prod_list.xml
index cb175ad..b2432ab 100644
--- a/netforce_clinic/layouts/clinic_prod_list.xml
+++ b/netforce_clinic/layouts/clinic_prod_list.xml
@@ -1,5 +1,6 @@
-
+
+
diff --git a/netforce_clinic/layouts/clinic_setting.xml b/netforce_clinic/layouts/clinic_setting.xml
index 56d866d..b8cadab 100644
--- a/netforce_clinic/layouts/clinic_setting.xml
+++ b/netforce_clinic/layouts/clinic_setting.xml
@@ -28,6 +28,7 @@
+
diff --git a/netforce_clinic/layouts/clinic_shop_form.xml b/netforce_clinic/layouts/clinic_shop_form.xml
index f1d0266..41401e7 100644
--- a/netforce_clinic/layouts/clinic_shop_form.xml
+++ b/netforce_clinic/layouts/clinic_shop_form.xml
@@ -18,7 +18,9 @@
-
+
+
+
diff --git a/netforce_clinic/models/make_apt.py b/netforce_clinic/models/make_apt.py
index 2a5dfe4..6b8ac78 100644
--- a/netforce_clinic/models/make_apt.py
+++ b/netforce_clinic/models/make_apt.py
@@ -47,12 +47,15 @@ class MakeAPT(Model):
if obj.cycle_id:
dom.append(['cycle_id','=',obj.cycle_id.id])
branch_id=obj.branch_id.id
- for pc in get_model("clinic.patient.cycle").search_browse(dom):
- branch=pc.department_id.branch_id
- if branch_id and branch_id!=branch.id:
- continue
+ pcs=get_model("clinic.patient.cycle").search_browse(dom)
+ if not pcs:
+ raise Exception("Please go to menu 'Patients -> Patient Cycles' and import data for %s"%(obj.department_id.name))
+ for pc in pcs:
patient=pc.patient_id
dpt=pc.department_id
+ branch=dpt.branch_id
+ if branch_id and branch_id!=branch.id:
+ continue
key=(patient.id,dpt.id)
if not pts.get(key):
pts[key]={
@@ -208,7 +211,7 @@ class MakeAPT(Model):
visit_obj.create(vals)
count+=1
if count:
- flash="Visit is generated succesfully %s items."%count
+ flash="Visit is generated succesfully %s items, please go to visit board."%count
return {
'next': {
'name': 'clinic_make_apt',
diff --git a/netforce_clinic/models/shop.py b/netforce_clinic/models/shop.py
index eedac77..9c8688d 100644
--- a/netforce_clinic/models/shop.py
+++ b/netforce_clinic/models/shop.py
@@ -112,6 +112,13 @@ class Shop(Model):
line['amount']=line['price']*line['qty']
data=self.update_all(context)
return data
+
+ def onchange_categ(self,context={}):
+ data=context['data']
+ path=context['path']
+ line=get_data_path(data,path,parent=True)
+ line['product_id']=None
+ return data
def create(self,vals,**kw):
id=super().create(vals,**kw)
diff --git a/netforce_clinic/models/shop_line.py b/netforce_clinic/models/shop_line.py
index b017161..89d8108 100644
--- a/netforce_clinic/models/shop_line.py
+++ b/netforce_clinic/models/shop_line.py
@@ -6,6 +6,7 @@ class ShopLine(Model):
_fields={
'shop_id': fields.Many2One('clinic.shop','Shop',required=True,on_delete="cascade"),
+ 'categ_id': fields.Many2One("product.categ","Category"),
'product_id': fields.Many2One('product','Product'),
'description': fields.Char("Description"),
'uom_id': fields.Many2One("uom","UOM"),
diff --git a/netforce_clinic/models/visit_board.py b/netforce_clinic/models/visit_board.py
index dacf375..243d1ba 100644
--- a/netforce_clinic/models/visit_board.py
+++ b/netforce_clinic/models/visit_board.py
@@ -337,6 +337,5 @@ class VisitBoard(Model):
'name': 'clinic_popup_visit_confirm',
}
}
-
VisitBoard.register()