conv_bal
watcha.h 2015-03-17 23:31:41 +07:00
parent b340622e9e
commit be291d21a2
2 changed files with 10 additions and 4 deletions

View File

@ -14,9 +14,9 @@
<field name="contact_id" domain='["or",["is_patient","=","true"],["walkin_cust","=","true"]]' onchange="onchange_contact" required='1' span="2"/> <field name="contact_id" domain='["or",["is_patient","=","true"],["walkin_cust","=","true"]]' onchange="onchange_contact" required='1' span="2"/>
<field name="ref" span="2"/> <field name="ref" span="2"/>
<field name="date" span="2"/> <field name="date" span="2"/>
<field name="branch_id" span="2"/>
<field name="department_id" domain='[["branch_id","=",branch_id]]' span="2"/>
<field name="pay_type" span="2"/> <field name="pay_type" span="2"/>
<field name="branch_id" onchange="onchange_branch" span="2" required="1"/>
<field name="department_id" domain='[["branch_id","=",branch_id]]' required="1" span="2"/>
<field name="pay_date" span="2"/> <field name="pay_date" span="2"/>
<field name="cheque_no" span="2"/> <field name="cheque_no" span="2"/>
<field name="bank_name" span="2"/> <field name="bank_name" span="2"/>

View File

@ -93,7 +93,7 @@ class Shop(Model):
def _get_number(self,context={}): def _get_number(self,context={}):
while 1: while 1:
seq_id=get_model("sequence").find_sequence(name="Clinic RD Shop") seq_id=get_model("sequence").find_sequence(type="clinic_rdshop",context=context)
num=get_model("sequence").get_next_number(seq_id,context=context) num=get_model("sequence").get_next_number(seq_id,context=context)
if not num: if not num:
return None return None
@ -217,8 +217,9 @@ class Shop(Model):
if not st.shop_type_id: if not st.shop_type_id:
raise Exception("Please defind Shop Type on menu Clinic Settings -> RD Shop") raise Exception("Please defind Shop Type on menu Clinic Settings -> RD Shop")
if obj.number=="/": if obj.number=="/":
context['branch_id']=obj.branch_id.id
obj.write({ obj.write({
'number': self._get_number(), 'number': self._get_number(context=context),
}) })
obj.make_invoices() obj.make_invoices()
return { return {
@ -618,4 +619,9 @@ class Shop(Model):
res=obj.pay_credit() res=obj.pay_credit()
return res return res
def onchange_branch(self,context={}):
data=context['data']
data['department_id']=None
return data
Shop.register() Shop.register()