improvement
parent
d3a5cb86e2
commit
0364dcfa13
|
@ -1,5 +1,5 @@
|
||||||
<inherit model="product.categ" inherit="prod_categ_list">
|
<inherit model="product.categ" inherit="prod_categ_list">
|
||||||
<field name="parent_id" position="after">
|
<field name="parent_id" position="after">
|
||||||
<field name="expense"/>
|
<!--<field name="expense"/>-->
|
||||||
</field>
|
</field>
|
||||||
</inherit>
|
</inherit>
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
<inherit model="product" inherit="product_list">
|
<inherit model="product.categ" inherit="product_list">
|
||||||
<field name="brand_id" position="replace">
|
<field name="brand_id" position="replace">
|
||||||
<field name="categ_id"/>
|
<field name="categ_id"/>
|
||||||
|
<field name="can_sell"/>
|
||||||
</field>
|
</field>
|
||||||
</inherit>
|
</inherit>
|
||||||
|
|
|
@ -28,6 +28,7 @@
|
||||||
</field>
|
</field>
|
||||||
</group>
|
</group>
|
||||||
</tab>
|
</tab>
|
||||||
|
<!--
|
||||||
<tab string="RD Shop">
|
<tab string="RD Shop">
|
||||||
<group span="6" columns="1">
|
<group span="6" columns="1">
|
||||||
<separator string="Filter Product By Category Below"/>
|
<separator string="Filter Product By Category Below"/>
|
||||||
|
@ -39,6 +40,7 @@
|
||||||
</field>
|
</field>
|
||||||
</group>
|
</group>
|
||||||
</tab>
|
</tab>
|
||||||
|
-->
|
||||||
<tab string="Development">
|
<tab string="Development">
|
||||||
<button string="Click Me" type="default" method="run_script" perm="clinic_setting_test"/>
|
<button string="Click Me" type="default" method="run_script" perm="clinic_setting_test"/>
|
||||||
</tab>
|
</tab>
|
||||||
|
|
|
@ -18,7 +18,9 @@
|
||||||
<tab string="General">
|
<tab string="General">
|
||||||
<field name="lines" nolabel="1">
|
<field name="lines" nolabel="1">
|
||||||
<list>
|
<list>
|
||||||
<field name="product_id" domain='[["categ_id","in",parent.shop_categs]]' onchange="onchange_product"/>
|
<!--<field name="product_id" domain='[["categ_id","in",parent.shop_categs]]' onchange="onchange_product"/>-->
|
||||||
|
<field name="categ_id" onchange="onchange_categ"/>
|
||||||
|
<field name="product_id" domain='[["can_sell","=","true"],["categ_id","=",categ_id]]' onchange="onchange_product"/>
|
||||||
<field name="description"/>
|
<field name="description"/>
|
||||||
<field name="uom_id"/>
|
<field name="uom_id"/>
|
||||||
<field name="qty" onchange="onchange_line"/>
|
<field name="qty" onchange="onchange_line"/>
|
||||||
|
|
|
@ -47,12 +47,15 @@ class MakeAPT(Model):
|
||||||
if obj.cycle_id:
|
if obj.cycle_id:
|
||||||
dom.append(['cycle_id','=',obj.cycle_id.id])
|
dom.append(['cycle_id','=',obj.cycle_id.id])
|
||||||
branch_id=obj.branch_id.id
|
branch_id=obj.branch_id.id
|
||||||
for pc in get_model("clinic.patient.cycle").search_browse(dom):
|
pcs=get_model("clinic.patient.cycle").search_browse(dom)
|
||||||
branch=pc.department_id.branch_id
|
if not pcs:
|
||||||
if branch_id and branch_id!=branch.id:
|
raise Exception("Please go to menu 'Patients -> Patient Cycles' and import data for %s"%(obj.department_id.name))
|
||||||
continue
|
for pc in pcs:
|
||||||
patient=pc.patient_id
|
patient=pc.patient_id
|
||||||
dpt=pc.department_id
|
dpt=pc.department_id
|
||||||
|
branch=dpt.branch_id
|
||||||
|
if branch_id and branch_id!=branch.id:
|
||||||
|
continue
|
||||||
key=(patient.id,dpt.id)
|
key=(patient.id,dpt.id)
|
||||||
if not pts.get(key):
|
if not pts.get(key):
|
||||||
pts[key]={
|
pts[key]={
|
||||||
|
@ -208,7 +211,7 @@ class MakeAPT(Model):
|
||||||
visit_obj.create(vals)
|
visit_obj.create(vals)
|
||||||
count+=1
|
count+=1
|
||||||
if count:
|
if count:
|
||||||
flash="Visit is generated succesfully %s items."%count
|
flash="Visit is generated succesfully %s items, please go to visit board."%count
|
||||||
return {
|
return {
|
||||||
'next': {
|
'next': {
|
||||||
'name': 'clinic_make_apt',
|
'name': 'clinic_make_apt',
|
||||||
|
|
|
@ -112,6 +112,13 @@ class Shop(Model):
|
||||||
line['amount']=line['price']*line['qty']
|
line['amount']=line['price']*line['qty']
|
||||||
data=self.update_all(context)
|
data=self.update_all(context)
|
||||||
return data
|
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):
|
def create(self,vals,**kw):
|
||||||
id=super().create(vals,**kw)
|
id=super().create(vals,**kw)
|
||||||
|
|
|
@ -6,6 +6,7 @@ class ShopLine(Model):
|
||||||
|
|
||||||
_fields={
|
_fields={
|
||||||
'shop_id': fields.Many2One('clinic.shop','Shop',required=True,on_delete="cascade"),
|
'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'),
|
'product_id': fields.Many2One('product','Product'),
|
||||||
'description': fields.Char("Description"),
|
'description': fields.Char("Description"),
|
||||||
'uom_id': fields.Many2One("uom","UOM"),
|
'uom_id': fields.Many2One("uom","UOM"),
|
||||||
|
|
|
@ -337,6 +337,5 @@ class VisitBoard(Model):
|
||||||
'name': 'clinic_popup_visit_confirm',
|
'name': 'clinic_popup_visit_confirm',
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
VisitBoard.register()
|
VisitBoard.register()
|
||||||
|
|
Loading…
Reference in New Issue