conv_bal
watcha.h 2015-02-02 17:47:19 +07:00
parent f3d340b744
commit 570dde6b52
3 changed files with 24 additions and 10 deletions

View File

@ -7,18 +7,17 @@
</head>
<group form_layout="stacked">
<field name="number" span="2"/>
<field name="date" span="2"/>
<field name="patient_id" required='1' span="2"/>
<field name="ref" span="2"/>
<field name="date" span="2"/>
<field name="patient_id" span="2" onchange="onchange_patient"/>
<field name="contact_id" required='1' span="2"/>
<field name="branch_id" span="2"/>
<field name="department_id" domain='[["branch_id","=",branch_id]]' span="2"/>
<field name="related_id" span="2"/>
<field name="shop_categs" invisible="1"/>
<tabs>
<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="categ_id" onchange="onchange_categ"/>
<field name="product_id" domain='[["can_sell","=","true"],["categ_id","=",categ_id]]' onchange="onchange_product"/>
<field name="description"/>
@ -28,19 +27,20 @@
<field name="amount"/>
</list>
</field>
</tab>
<tab string="Other">
<group form_layout="stacked">
<field name="user_id" span="3"/>
</group>
</tab>
</tabs>
</group>
<group span="9" columns="1">
</group>
<group span="3" columns="1">
<field name="total"/>
</group>
</tab>
<tab string="Other">
<group form_layout="stacked">
<field name="user_id" span="3"/>
<field name="related_id" span="3"/>
</group>
</tab>
</tabs>
</group>
<foot>
<button string="Pay" method="pay" type="success"/>
</foot>

View File

@ -28,6 +28,7 @@ class Shop(Model):
"ref": fields.Char("Ref",search=True),
'date': fields.Date("Date",search=True),
'patient_id': fields.Many2One('clinic.patient','Patient',search=True),
'contact_id': fields.Many2One('partner','Contact',search=True),
'department_id': fields.Many2One("clinic.department","Department"),
'branch_id': fields.Many2One("clinic.branch","Branch"),
'lines': fields.One2Many('clinic.shop.line','shop_id','Lines'),
@ -120,6 +121,18 @@ class Shop(Model):
line['product_id']=None
return data
def onchange_patient(self,context={}):
data=context['data']
patient_id=data['patient_id']
patient=get_model("clinic.patient").browse(patient_id)
dpt=patient.department_id
branch=patient.branch_id
contact=patient.partner_id
data['department_id']=dpt.id
data['branch_id']=branch.id
data['contact_id']=contact.id
return data
def create(self,vals,**kw):
id=super().create(vals,**kw)
self.function_store([id])

View File

@ -12,7 +12,8 @@ todo:
- credit <= product -> tab -> accounting -> sale -> sale account
- debit <= 1. contact -> tab accounting -> account receiaveble , 2. finacial setting -> account receiable
- sale medicine
- matching payment
-
- matching payment **
- patient