fix runing number
parent
e7b7d18ed6
commit
8980bc9f3a
|
@ -45,8 +45,8 @@
|
||||||
<item string="Sickbed" action="clinic_sickbed"/>
|
<item string="Sickbed" action="clinic_sickbed"/>
|
||||||
</item>
|
</item>
|
||||||
<item string="Reporting" perm="clinic_report">
|
<item string="Reporting" perm="clinic_report">
|
||||||
<item string="Report Claim Expense" action="clinic_report_claim"/>
|
<item string="Claim Expense" action="clinic_report_claim"/>
|
||||||
<item string="Report RD Shop" action="clinic_report_shop"/>
|
<item string="RD Shop Summary" action="clinic_report_shop"/>
|
||||||
<item string="Cycle Item Summary" action="clinic_report_cycle_item"/>
|
<item string="Cycle Item Summary" action="clinic_report_cycle_item"/>
|
||||||
<item string="HD Case Summary" action="clinic_report_hd_case_summary"/>
|
<item string="HD Case Summary" action="clinic_report_hd_case_summary"/>
|
||||||
<!--<item string="Medical Detail" action="clinic_report_medical_detail"/>-->
|
<!--<item string="Medical Detail" action="clinic_report_medical_detail"/>-->
|
||||||
|
|
|
@ -265,7 +265,6 @@ class HDCase(Model):
|
||||||
|
|
||||||
def _get_number(self,context={}):
|
def _get_number(self,context={}):
|
||||||
while 1:
|
while 1:
|
||||||
#seq_id=get_model("sequence").find_sequence(name="Clinic HD Case")
|
|
||||||
seq_id=get_model("sequence").find_sequence(type="clinic_hdcase")
|
seq_id=get_model("sequence").find_sequence(type="clinic_hdcase")
|
||||||
num=get_model("sequence").get_next_number(seq_id,context=context)
|
num=get_model("sequence").get_next_number(seq_id,context=context)
|
||||||
if not num:
|
if not num:
|
||||||
|
@ -278,7 +277,7 @@ class HDCase(Model):
|
||||||
return num
|
return num
|
||||||
get_model("sequence").increment_number(seq_id,context=context)
|
get_model("sequence").increment_number(seq_id,context=context)
|
||||||
|
|
||||||
def _get_invoice_noclaim_number(self,context={}):
|
def _get_number_invoice_noclaim(self,context={}):
|
||||||
while 1:
|
while 1:
|
||||||
seq_id=get_model("sequence").find_sequence(type="clinic_invoice_noclaim")
|
seq_id=get_model("sequence").find_sequence(type="clinic_invoice_noclaim")
|
||||||
num=get_model("sequence").get_next_number(seq_id,context=context)
|
num=get_model("sequence").get_next_number(seq_id,context=context)
|
||||||
|
@ -654,7 +653,7 @@ class HDCase(Model):
|
||||||
"type": "out",
|
"type": "out",
|
||||||
"inv_type": "invoice",
|
"inv_type": "invoice",
|
||||||
"tax_type": "tax_in",
|
"tax_type": "tax_in",
|
||||||
'date': obj.date, #XXX
|
'date': obj.date,
|
||||||
'due_date': due_date,
|
'due_date': due_date,
|
||||||
"ref": '%s (%s)'%(patient.name or '',patient.number or ''),
|
"ref": '%s (%s)'%(patient.name or '',patient.number or ''),
|
||||||
'department_id': obj.department_id.id,
|
'department_id': obj.department_id.id,
|
||||||
|
@ -669,13 +668,16 @@ class HDCase(Model):
|
||||||
vals['lines']=rmb_lines
|
vals['lines']=rmb_lines
|
||||||
if patient_partner:
|
if patient_partner:
|
||||||
vals['patient_partner_id']=patient_partner.id,
|
vals['patient_partner_id']=patient_partner.id,
|
||||||
get_model("account.invoice").create(vals,context)
|
#XXX
|
||||||
|
if obj.branch_id:
|
||||||
|
context['branch_id']=obj.branch_id.id
|
||||||
|
get_model("account.invoice").create(vals,context=context)
|
||||||
|
|
||||||
if normb_lines and is_credit:
|
if normb_lines and is_credit:
|
||||||
partner=patient.partner_id
|
partner=patient.partner_id
|
||||||
if not partner:
|
if not partner:
|
||||||
raise Exception("No contact for this patient %s"%obj.partner.name)
|
raise Exception("No contact for this patient %s"%obj.partner.name)
|
||||||
number=self._get_invoice_noclaim_number(context=context)
|
number=self._get_number_invoice_noclaim(context=context)
|
||||||
vals={
|
vals={
|
||||||
'number': number,
|
'number': number,
|
||||||
"type": "out",
|
"type": "out",
|
||||||
|
|
Loading…
Reference in New Issue