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