improvement

conv_bal
watcha.h 2015-02-02 08:41:43 +07:00
parent d3a5cb86e2
commit 0364dcfa13
8 changed files with 24 additions and 9 deletions

View File

@ -1,5 +1,5 @@
<inherit model="product.categ" inherit="prod_categ_list">
<field name="parent_id" position="after">
<field name="expense"/>
<!--<field name="expense"/>-->
</field>
</inherit>

View File

@ -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="categ_id"/>
<field name="can_sell"/>
</field>
</inherit>

View File

@ -28,6 +28,7 @@
</field>
</group>
</tab>
<!--
<tab string="RD Shop">
<group span="6" columns="1">
<separator string="Filter Product By Category Below"/>
@ -39,6 +40,7 @@
</field>
</group>
</tab>
-->
<tab string="Development">
<button string="Click Me" type="default" method="run_script" perm="clinic_setting_test"/>
</tab>

View File

@ -18,7 +18,9 @@
<tab string="General">
<field name="lines" nolabel="1">
<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="uom_id"/>
<field name="qty" onchange="onchange_line"/>

View File

@ -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',

View File

@ -113,6 +113,13 @@ class Shop(Model):
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)
self.function_store([id])

View File

@ -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"),

View File

@ -338,5 +338,4 @@ class VisitBoard(Model):
}
}
VisitBoard.register()