remain hd case number
parent
d229e2eba2
commit
096cbcbb13
|
@ -174,7 +174,15 @@ class Visit(Model):
|
|||
vals['fee_partner_id']=partner_id
|
||||
break
|
||||
|
||||
# use exist hd_case (in case set to draft)
|
||||
hd_case_id=None
|
||||
if obj.hd_cases:
|
||||
hd_case=obj.hd_cases[0]
|
||||
hd_case.write(vals)
|
||||
hd_case_id=hd_case.id
|
||||
else:
|
||||
hd_case_id=hd_case_obj.create(vals)
|
||||
|
||||
if context.get("called"): #XXX call outside
|
||||
return hd_case_id
|
||||
|
||||
|
@ -327,11 +335,12 @@ class Visit(Model):
|
|||
def to_draft(self,ids,context={}):
|
||||
obj=self.browse(ids)[0]
|
||||
for hd_case in obj.hd_cases:
|
||||
# XXX
|
||||
hd_case.write({
|
||||
'state': 'draft',
|
||||
})
|
||||
hd_case.delete()
|
||||
hd_case.to_draft()
|
||||
for line in hd_case.lines:
|
||||
line.delete()
|
||||
for ps in hd_case.personals:
|
||||
ps.delete()
|
||||
#hd_case.delete()
|
||||
obj.write({
|
||||
'state': 'draft',
|
||||
})
|
||||
|
|
Loading…
Reference in New Issue