...
 
Commits (2)
......@@ -8,6 +8,7 @@ class ScopPartner(models.Model):
_inherit = "res.partner"
# Processus d'adhésion
project_number = fields.Char('N° Projet')
percent_realisation = fields.Selection(
[(0, 0),
(20, 20),
......@@ -21,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")
......@@ -46,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
......@@ -58,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"
......
......@@ -4,6 +4,12 @@
<odoo>
<data>
<!-- ******************************
*** Inherited Views
****************************** -->
<!--
Inherited Scop Partner Kanban
-->
<record id="view_partner_cooperative_adhesion_kanban" model="ir.ui.view">
<field name="name">cooperative.kanban.adhesion</field>
<field name="model">res.partner</field>
......@@ -31,11 +37,13 @@
<page name="adhesion_processus1" string="Processus d'Adhésion" attrs="{'invisible': [('project_status','=','6_suivi')]}">
<group col="3">
<group string="Général">
<field name="project_number"/>
<field name="percent_realisation" widget="priority" />
<field name="date_realisation"/>
<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"/>
......@@ -159,4 +167,4 @@
</record>
</data>
</odoo>
\ No newline at end of file
</odoo>