From 66e447c664f5043d6d1098e04ae2bbdd02a38e33 Mon Sep 17 00:00:00 2001 From: "watcha.h" Date: Tue, 11 Aug 2015 12:30:58 +0700 Subject: [PATCH] gen number invoice --- netforce_clinic/models/hd_case.py | 3 ++- netforce_clinic/models/hd_case_payment.py | 2 -- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/netforce_clinic/models/hd_case.py b/netforce_clinic/models/hd_case.py index 787d705..0b3c44d 100644 --- a/netforce_clinic/models/hd_case.py +++ b/netforce_clinic/models/hd_case.py @@ -294,7 +294,7 @@ class HDCase(Model): def _get_number_invoice_noclaim(self,context={}): while 1: - seq_id=get_model("sequence").find_sequence(type="clinic_invoice_noclaim") + seq_id=get_model("sequence").find_sequence(type="clinic_invoice_noclaim",name=None,context=context) num=get_model("sequence").get_next_number(seq_id,context=context) if not num: return None @@ -695,6 +695,7 @@ class HDCase(Model): partner=patient.partner_id if not partner: raise Exception("No contact for this patient %s"%obj.partner.name) + context['branch_id']=obj.branch_id.id number=self._get_number_invoice_noclaim(context=context) vals={ 'number': number, diff --git a/netforce_clinic/models/hd_case_payment.py b/netforce_clinic/models/hd_case_payment.py index d226259..ce18120 100644 --- a/netforce_clinic/models/hd_case_payment.py +++ b/netforce_clinic/models/hd_case_payment.py @@ -45,7 +45,6 @@ class HDCasePayment(Model): hd_case.post_invoices() if obj.pay_amount: hd_case.make_payment(context=context) - #hd_case.do_expense() inv_remain_amount=0 for inv in hd_case.invoices: @@ -82,7 +81,6 @@ class HDCasePayment(Model): hd_case.make_invoices(context=context) hd_case.post_invoices() hd_case.create_cycle_item() - #hd_case.do_expense() hd_case.write({ 'state': 'waiting_payment', 'req_fee': 0, # force to hide button pay!