Compare commits
2 Commits
16.0-migra
...
16.0-progr
Author | SHA1 | Date | |
---|---|---|---|
|
643c532939 | ||
|
e69fcf224b |
@@ -172,7 +172,7 @@
|
|||||||
</record>
|
</record>
|
||||||
|
|
||||||
<record id="study_questionnaire_subject_type_PRACTITIONER" model="study.questionnaire.subject.type">
|
<record id="study_questionnaire_subject_type_PRACTITIONER" model="study.questionnaire.subject.type">
|
||||||
<field name="name">Praticien</field>
|
<field name="name">Praticient</field>
|
||||||
<field name="value">PRACTITIONER</field>
|
<field name="value">PRACTITIONER</field>
|
||||||
</record>
|
</record>
|
||||||
|
|
||||||
|
@@ -34,17 +34,3 @@ class StudyParticipant(models.Model):
|
|||||||
updated = fields.Datetime("Date mise à jour")
|
updated = fields.Datetime("Date mise à jour")
|
||||||
|
|
||||||
active = fields.Boolean("Actif", default=True)
|
active = fields.Boolean("Actif", default=True)
|
||||||
|
|
||||||
@api.depends("write_date")
|
|
||||||
def _compute_updated(self):
|
|
||||||
for record in self:
|
|
||||||
## XXXb0g : the following two lines are to be removed when all records will have been updated during migration
|
|
||||||
if record.updated:
|
|
||||||
continue
|
|
||||||
record.updated = record.write_date
|
|
||||||
|
|
||||||
@api.depends("create_date")
|
|
||||||
def _compute_created(self):
|
|
||||||
for record in self:
|
|
||||||
if not record.created:
|
|
||||||
record.created = record.create_date
|
|
||||||
|
@@ -36,20 +36,17 @@ class StudyQuestionnaire(models.Model):
|
|||||||
created = fields.Datetime("Created", compute="_compute_created", readonly=True)
|
created = fields.Datetime("Created", compute="_compute_created", readonly=True)
|
||||||
date = fields.Datetime("Date", compute="_compute_updated", readonly=True)
|
date = fields.Datetime("Date", compute="_compute_updated", readonly=True)
|
||||||
|
|
||||||
@api.depends("write_date")
|
|
||||||
def _compute_updated(self):
|
|
||||||
for record in self:
|
|
||||||
## XXXb0g : the following two lines are to be removed when all records will have been updated during migration
|
|
||||||
if record.updated:
|
|
||||||
continue
|
|
||||||
record.updated = record.write_date
|
|
||||||
|
|
||||||
@api.depends("create_date")
|
@api.depends("create_date")
|
||||||
def _compute_created(self):
|
def _compute_created(self):
|
||||||
for record in self:
|
for record in self:
|
||||||
if not record.created:
|
if not record.created:
|
||||||
record.created = record.create_date
|
record.created = record.create_date
|
||||||
|
|
||||||
|
@api.depends("write_date")
|
||||||
|
def _compute_updated(self):
|
||||||
|
for record in self:
|
||||||
|
record.date = record.write_date
|
||||||
|
|
||||||
active = fields.Boolean("Actif", default=True)
|
active = fields.Boolean("Actif", default=True)
|
||||||
|
|
||||||
def copy(self, default=None):
|
def copy(self, default=None):
|
||||||
|
@@ -34,17 +34,3 @@ class StudyQuestionnaireResponse(models.Model):
|
|||||||
updated = fields.Datetime("Date mise à jour")
|
updated = fields.Datetime("Date mise à jour")
|
||||||
|
|
||||||
active = fields.Boolean("Actif", default=True)
|
active = fields.Boolean("Actif", default=True)
|
||||||
|
|
||||||
@api.depends("write_date")
|
|
||||||
def _compute_updated(self):
|
|
||||||
for record in self:
|
|
||||||
## XXXb0g : the following two lines are to be removed when all records will have been updated during migration
|
|
||||||
if record.updated:
|
|
||||||
continue
|
|
||||||
record.updated = record.write_date
|
|
||||||
|
|
||||||
@api.depends("create_date")
|
|
||||||
def _compute_created(self):
|
|
||||||
for record in self:
|
|
||||||
if not record.created:
|
|
||||||
record.created = record.create_date
|
|
||||||
|
@@ -19,7 +19,7 @@ class StudyStudy(models.Model):
|
|||||||
"study.progress.status",
|
"study.progress.status",
|
||||||
string="Avancement de l'étude",
|
string="Avancement de l'étude",
|
||||||
domain="[('study_id', '=', id)]",
|
domain="[('study_id', '=', id)]",
|
||||||
compute="_compute_progress_status_id",
|
compute="_compute_progress_status_id"
|
||||||
)
|
)
|
||||||
progress_status = fields.One2many(
|
progress_status = fields.One2many(
|
||||||
"study.progress.status", "study_id", "All progress status"
|
"study.progress.status", "study_id", "All progress status"
|
||||||
@@ -95,30 +95,22 @@ class StudyStudy(models.Model):
|
|||||||
@api.depends("write_date")
|
@api.depends("write_date")
|
||||||
def _compute_updated(self):
|
def _compute_updated(self):
|
||||||
for record in self:
|
for record in self:
|
||||||
## XXXb0g : the following two lines are to be removed when all records will have been updated during migration
|
|
||||||
if record.updated:
|
|
||||||
continue
|
|
||||||
_logger.info(f"Record ID: {record.id}, write_date: {record.write_date}")
|
_logger.info(f"Record ID: {record.id}, write_date: {record.write_date}")
|
||||||
record.updated = record.write_date
|
record.updated = record.write_date
|
||||||
|
|
||||||
@api.depends("progress_status")
|
@api.depends("progress_status")
|
||||||
def _compute_progress_status_id(self):
|
def _compute_progress_status_id(self):
|
||||||
for record in self:
|
for record in self:
|
||||||
unfinished_progress_status = record.progress_status.filtered(
|
unfinished_progress_status = record.progress_status.filtered(lambda x: x.actual == True)
|
||||||
lambda x: x.actual == True
|
record.progress_status_id = unfinished_progress_status.id if len(unfinished_progress_status) == 1 else None
|
||||||
)
|
|
||||||
record.progress_status_id = (
|
|
||||||
unfinished_progress_status.id
|
|
||||||
if len(unfinished_progress_status) == 1
|
|
||||||
else None
|
|
||||||
)
|
|
||||||
|
|
||||||
def copy(self, default=None):
|
def copy(self, default=None):
|
||||||
default = dict(default or {}, identifier_primary_id=None)
|
default = dict(default or {}, identifier_primary_id=None)
|
||||||
return super().copy(default)
|
return super().copy(default)
|
||||||
|
|
||||||
@api.depends("title", "name")
|
|
||||||
def name_get(self):
|
@api.depends("title", "name")
|
||||||
|
def name_get(self):
|
||||||
result = []
|
result = []
|
||||||
for study in self:
|
for study in self:
|
||||||
if not study.name:
|
if not study.name:
|
||||||
|
@@ -57,8 +57,8 @@
|
|||||||
</group>
|
</group>
|
||||||
<group name="technique" string="Technique">
|
<group name="technique" string="Technique">
|
||||||
<group name="technique_left">
|
<group name="technique_left">
|
||||||
<field name="created" />
|
<field name="create_date" />
|
||||||
<field name="date" />
|
<field name="write_date" />
|
||||||
</group>
|
</group>
|
||||||
<group name="technique_right">
|
<group name="technique_right">
|
||||||
</group>
|
</group>
|
||||||
|
@@ -61,8 +61,8 @@
|
|||||||
</group>
|
</group>
|
||||||
<group name="technique" string="Technique">
|
<group name="technique" string="Technique">
|
||||||
<group name="technique_left">
|
<group name="technique_left">
|
||||||
<field name="created" />
|
<field name="create_date" />
|
||||||
<field name="date" />
|
<field name="write_date" />
|
||||||
</group>
|
</group>
|
||||||
<group name="technique_right">
|
<group name="technique_right">
|
||||||
</group>
|
</group>
|
||||||
|
@@ -46,7 +46,7 @@
|
|||||||
<group name="study_status_left">
|
<group name="study_status_left">
|
||||||
<field name="period_start" />
|
<field name="period_start" />
|
||||||
<field name="period_end" />
|
<field name="period_end" />
|
||||||
<field name="progress_status_id" />
|
<field name="progress_status_id" options="{'no_open': True}" />
|
||||||
</group>
|
</group>
|
||||||
<group name="study_status_right">
|
<group name="study_status_right">
|
||||||
|
|
||||||
@@ -131,19 +131,11 @@
|
|||||||
<field name="model">study.study</field>
|
<field name="model">study.study</field>
|
||||||
<field name="arch" type="xml">
|
<field name="arch" type="xml">
|
||||||
<search string="Études">
|
<search string="Études">
|
||||||
<field name="active" string="Actif" />
|
|
||||||
<field name="description" string="Description" />
|
|
||||||
<field name="identifier_author" string="ID Plateforme" />
|
|
||||||
<field name="identifier_primary_id" string="Seintinelles ID"/>
|
|
||||||
<field name="keywords" string="Mots-clés" />
|
|
||||||
<field name="name" string="Acronyme" />
|
|
||||||
<field name="period_end" string="Date de fin" />
|
|
||||||
<field name="period_start" string="Date de début" />
|
|
||||||
<field name="phase" string="Phase" />
|
|
||||||
<field name="progress_status_id" string="Statut" />
|
|
||||||
<field name="region" string="Région" />
|
|
||||||
<field name="title" string="Nom de l'étude" />
|
<field name="title" string="Nom de l'étude" />
|
||||||
<field name="version" string="Version" />
|
<field name="name" string="Acronyme" />
|
||||||
|
<field name="identifier_primary_id" string="Seintinelles ID"/>
|
||||||
|
<field name="period_start" string="Date de début" />
|
||||||
|
<field name="period_end" string="Date de fin" />
|
||||||
</search>
|
</search>
|
||||||
</field>
|
</field>
|
||||||
</record>
|
</record>
|
||||||
|
Reference in New Issue
Block a user