can not access patient depend on deparment
parent
661f25bf1a
commit
3ebf0d47de
|
@ -102,6 +102,7 @@ class CreateInvoicePayment(Model):
|
||||||
currency=settings.currency_id
|
currency=settings.currency_id
|
||||||
if not currency:
|
if not currency:
|
||||||
raise Exception("Missing setting.currency")
|
raise Exception("Missing setting.currency")
|
||||||
|
#FIXME process only selected invoice
|
||||||
for inv in obj.invoices:
|
for inv in obj.invoices:
|
||||||
vals['invoice_lines'].append(('create',{
|
vals['invoice_lines'].append(('create',{
|
||||||
'invoice_id': inv.id,
|
'invoice_id': inv.id,
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
from netforce.model import Model, fields, get_model
|
from netforce.model import Model, fields, get_model
|
||||||
|
from netforce.access import set_active_user, get_active_user
|
||||||
|
|
||||||
class ReportCycleSetting(Model):
|
class ReportCycleSetting(Model):
|
||||||
_name="clinic.report.cycle.setting"
|
_name="clinic.report.cycle.setting"
|
||||||
|
@ -61,6 +62,8 @@ class ReportCycleSetting(Model):
|
||||||
if cycle_id:
|
if cycle_id:
|
||||||
dom.append(['cycle_id','=',cycle_id])
|
dom.append(['cycle_id','=',cycle_id])
|
||||||
pcs=get_model("clinic.patient.cycle").search_browse(dom)
|
pcs=get_model("clinic.patient.cycle").search_browse(dom)
|
||||||
|
user_id=get_active_user()
|
||||||
|
set_active_user(1)
|
||||||
if not pcs:
|
if not pcs:
|
||||||
# Create patient cycle with that department
|
# Create patient cycle with that department
|
||||||
for pt in get_model("clinic.patient").search_browse([['department_id','=',department_id]]):
|
for pt in get_model("clinic.patient").search_browse([['department_id','=',department_id]]):
|
||||||
|
@ -151,6 +154,7 @@ class ReportCycleSetting(Model):
|
||||||
nlines.append(line)
|
nlines.append(line)
|
||||||
no+=1
|
no+=1
|
||||||
|
|
||||||
|
set_active_user(user_id)
|
||||||
data={
|
data={
|
||||||
'lines': nlines,
|
'lines': nlines,
|
||||||
'department_id': department_id,
|
'department_id': department_id,
|
||||||
|
|
Loading…
Reference in New Issue