link pm from hd case
parent
e6dbec5eef
commit
5cf9be65a1
|
@ -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()
|
||||
|
|
Loading…
Reference in New Issue