link pm from hd case

conv_bal
watcha.h 2014-10-22 17:13:43 +07:00
parent e6dbec5eef
commit 5cf9be65a1
1 changed files with 11 additions and 4 deletions

View File

@ -300,7 +300,8 @@ class HDcase(Model):
context['type']='out'
context['inv_type']='invoice'
if obj.lines and obj.amount:
fee_lines=[]
if obj.lines:
vals={
"type": "out",
"inv_type": "invoice",
@ -317,7 +318,6 @@ class HDcase(Model):
if not partner:
raise Exception("No contact for patient %s"%obj.patient_id.name)
vals["partner_id"]=partner.id
fee_lines=[]
for line in obj.lines:
if line.product_id:
account_id=line.product_id.sale_account_id.id or account_receivable_id
@ -337,7 +337,8 @@ class HDcase(Model):
else:
vals['lines'].append(('create',inv_line))
inv_id=get_model("account.invoice").create(vals,context)
if obj.amount: ## not pay yet
inv_id=get_model("account.invoice").create(vals,context)
# create picking
obj.make_pickings()
@ -571,6 +572,12 @@ class HDcase(Model):
def view_payment(self,ids,context={}):
print("clinic_view_payment")
pass
return {
'next': {
'name': 'payment',
'mode': 'form',
'active_id': ids[0],
},
}
HDcase.register()