shop rd
parent
f3d340b744
commit
570dde6b52
|
@ -7,18 +7,17 @@
|
||||||
</head>
|
</head>
|
||||||
<group form_layout="stacked">
|
<group form_layout="stacked">
|
||||||
<field name="number" span="2"/>
|
<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="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="branch_id" span="2"/>
|
||||||
<field name="department_id" domain='[["branch_id","=",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"/>
|
<field name="shop_categs" invisible="1"/>
|
||||||
<tabs>
|
<tabs>
|
||||||
<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="categ_id" onchange="onchange_categ"/>
|
<field name="categ_id" onchange="onchange_categ"/>
|
||||||
<field name="product_id" domain='[["can_sell","=","true"],["categ_id","=",categ_id]]' onchange="onchange_product"/>
|
<field name="product_id" domain='[["can_sell","=","true"],["categ_id","=",categ_id]]' onchange="onchange_product"/>
|
||||||
<field name="description"/>
|
<field name="description"/>
|
||||||
|
@ -28,19 +27,20 @@
|
||||||
<field name="amount"/>
|
<field name="amount"/>
|
||||||
</list>
|
</list>
|
||||||
</field>
|
</field>
|
||||||
|
<group span="9" columns="1">
|
||||||
|
</group>
|
||||||
|
<group span="3" columns="1">
|
||||||
|
<field name="total"/>
|
||||||
|
</group>
|
||||||
</tab>
|
</tab>
|
||||||
<tab string="Other">
|
<tab string="Other">
|
||||||
<group form_layout="stacked">
|
<group form_layout="stacked">
|
||||||
<field name="user_id" span="3"/>
|
<field name="user_id" span="3"/>
|
||||||
|
<field name="related_id" span="3"/>
|
||||||
</group>
|
</group>
|
||||||
</tab>
|
</tab>
|
||||||
</tabs>
|
</tabs>
|
||||||
</group>
|
</group>
|
||||||
<group span="9" columns="1">
|
|
||||||
</group>
|
|
||||||
<group span="3" columns="1">
|
|
||||||
<field name="total"/>
|
|
||||||
</group>
|
|
||||||
<foot>
|
<foot>
|
||||||
<button string="Pay" method="pay" type="success"/>
|
<button string="Pay" method="pay" type="success"/>
|
||||||
</foot>
|
</foot>
|
||||||
|
|
|
@ -28,6 +28,7 @@ class Shop(Model):
|
||||||
"ref": fields.Char("Ref",search=True),
|
"ref": fields.Char("Ref",search=True),
|
||||||
'date': fields.Date("Date",search=True),
|
'date': fields.Date("Date",search=True),
|
||||||
'patient_id': fields.Many2One('clinic.patient','Patient',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"),
|
'department_id': fields.Many2One("clinic.department","Department"),
|
||||||
'branch_id': fields.Many2One("clinic.branch","Branch"),
|
'branch_id': fields.Many2One("clinic.branch","Branch"),
|
||||||
'lines': fields.One2Many('clinic.shop.line','shop_id','Lines'),
|
'lines': fields.One2Many('clinic.shop.line','shop_id','Lines'),
|
||||||
|
@ -119,6 +120,18 @@ class Shop(Model):
|
||||||
line=get_data_path(data,path,parent=True)
|
line=get_data_path(data,path,parent=True)
|
||||||
line['product_id']=None
|
line['product_id']=None
|
||||||
return data
|
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):
|
def create(self,vals,**kw):
|
||||||
id=super().create(vals,**kw)
|
id=super().create(vals,**kw)
|
||||||
|
|
|
@ -12,7 +12,8 @@ todo:
|
||||||
- credit <= product -> tab -> accounting -> sale -> sale account
|
- credit <= product -> tab -> accounting -> sale -> sale account
|
||||||
- debit <= 1. contact -> tab accounting -> account receiaveble , 2. finacial setting -> account receiable
|
- debit <= 1. contact -> tab accounting -> account receiaveble , 2. finacial setting -> account receiable
|
||||||
- sale medicine
|
- sale medicine
|
||||||
- matching payment
|
-
|
||||||
|
- matching payment **
|
||||||
|
|
||||||
|
|
||||||
- patient
|
- patient
|
||||||
|
|
Loading…
Reference in New Issue