[cgscop #231] date d'abandon obligatoire si projet abandonné

parent e052d779
......@@ -22,9 +22,11 @@ class ScopPartner(models.Model):
'res.partner.prescriber.canal',
string='Canal de Prescription',
on_delete='restrict')
date_first_rdv = fields.Date("Date du 1er rdv")
date_send_guide = fields.Date("Date d’envoi du guide de faisabilité")
date_abort = fields.Date("Date d'abandon")
staff_existing = fields.Integer("Effectif connu")
staff_planned = fields.Integer("Effectif prévu")
adhesion_comments = fields.Text("Commentaires Adhésion")
......@@ -47,6 +49,17 @@ class ScopPartner(models.Model):
'res.partner',
string="Destinataire du dossier FSE")
# ------------------------------------------------------
# Onchange function
# ------------------------------------------------------
@api.onchange('project_status')
def _onchange_project_status(self):
if self.project_status != '7_abandonne':
self.date_abort = None
# ------------------------------------------------------
# Override parent
# ------------------------------------------------------
@api.multi
def scop_send_to_cg(self):
""" Hérite la fonction d'envoi de l'organisme à la CG
......@@ -59,6 +72,17 @@ class ScopPartner(models.Model):
self.date_transmission_cg = fields.Date.today()
return True
@api.multi
def scop_abandonne(self):
"""
Hérite la fonction d'abandon pour déterminer la date
@return : True
"""
super(ScopPartner, self).scop_abandonne()
self.date_abort = fields.Date.today()
return True
class ResPartnerPrescriberCanal(models.Model):
_name = "res.partner.prescriber.canal"
......
......@@ -43,6 +43,7 @@
<field name="prescriber_canal_id" widget="res_partner_many2one" options="{'no_create': True, 'no_open': True}"/>
<field name="staff_existing"/>
<field name="staff_planned"/>
<field name="date_abort" attrs="{'invisible':[('project_status','!=','7_abandonne')], 'required':[('project_status','=','7_abandonne')]}"/>
</group>
<group string="Dossier UE">
<field name="file_fse_open" widget="boolean_toggle"/>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment