diff --git a/netforce_clinic/layouts/clinic_user_form.xml b/netforce_clinic/layouts/clinic_user_form.xml index 367bf31..20f36fc 100644 --- a/netforce_clinic/layouts/clinic_user_form.xml +++ b/netforce_clinic/layouts/clinic_user_form.xml @@ -1,5 +1,6 @@ + diff --git a/netforce_clinic/models/base_user.py b/netforce_clinic/models/base_user.py index 37c0014..ea454c4 100644 --- a/netforce_clinic/models/base_user.py +++ b/netforce_clinic/models/base_user.py @@ -5,7 +5,7 @@ class User(Model): _fields={ 'department_profile_id': fields.Many2One("clinic.department.profile","Department Profile"), 'department_id': fields.Many2One("clinic.department","Current Department"), - 'department_include': fields.Selection([['yes','Yes'],['no','No']],"Include"), + 'old_profile_id': fields.Many2One('profile', "Old Profile"), } User.register() diff --git a/netforce_clinic/models/select_company.py b/netforce_clinic/models/select_company.py index 9a7edeb..145c601 100644 --- a/netforce_clinic/models/select_company.py +++ b/netforce_clinic/models/select_company.py @@ -165,6 +165,9 @@ class SelectCompany(Model): else: context['profile_id']=obj.check_profile(context=context) pf_id=obj.share_profile(context=context) + old_pf_id=user.old_profile_id.id + if old_pf_id: + pf_id=old_pf_id user.write({ 'department_id': None, #all include department 'profile_id': pf_id,