2014-10-23 08:21:29 +00:00
|
|
|
from netforce.model import Model, fields, get_model
|
|
|
|
|
|
|
|
class AccountPayment(Model):
|
|
|
|
_inherit="account.payment"
|
|
|
|
|
|
|
|
def run_report(self,ids,context={}):
|
|
|
|
obj=self.browse(ids)[0]
|
|
|
|
hd_case_id=obj.related_id.id
|
|
|
|
hd_case=get_model("clinic.hd.case").browse(hd_case_id)
|
|
|
|
# TODO
|
|
|
|
# set payment_id on hd case
|
|
|
|
# send to action print form payment
|
|
|
|
hd_case.write({
|
|
|
|
'payment_id': obj.id,
|
|
|
|
})
|
|
|
|
return {
|
|
|
|
'next': {
|
|
|
|
'name': 'report_clinic_payment_form',
|
|
|
|
'refer_id': hd_case_id,
|
|
|
|
'payment_id': obj.id,
|
|
|
|
},
|
|
|
|
}
|
|
|
|
|
2014-12-21 18:00:54 +00:00
|
|
|
def import_payment(self,ids,context={}):
|
|
|
|
if not ids:
|
|
|
|
raise Exception("Please save payment before import")
|
|
|
|
print("xx ", ids)
|
|
|
|
return {
|
|
|
|
'next': {
|
|
|
|
'name': 'clinic_import_uc',
|
|
|
|
'refer_id': ids[0], #XXX
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2014-10-23 08:21:29 +00:00
|
|
|
AccountPayment.register()
|