Skip to content
Extraits de code Groupes Projets
Valider c0cf3e26 rédigé par Benjamin - Le Filament's avatar Benjamin - Le Filament
Parcourir les fichiers

[cgscop #74] financement obligatoire dans la saisie de l'agenda si liste des financements non vide

parent 6436e7c2
Aucune branche associée trouvée
Aucune étiquette associée trouvée
Aucune requête de fusion associée trouvée
...@@ -46,9 +46,23 @@ class CGScopCalendar(models.Model): ...@@ -46,9 +46,23 @@ class CGScopCalendar(models.Model):
index=True, index=True,
on_delete='restrict', on_delete='restrict',
default=_default_ur) default=_default_ur)
ur_financial_system_nb = fields.Integer(
string="Nb Dispositifs Financiers",
compute="_compute_ur_financial_system_nb")
# ------------------------------------------------------ # ------------------------------------------------------
# onchange # Compute
# ------------------------------------------------------
@api.depends('ur_id')
def _compute_ur_financial_system_nb(self):
for event in self:
financial_system = event.env['ur.financial.system'].search([
('ur_id', '=', event.ur_id.id)])
event.ur_financial_system_nb = len(
financial_system)
# ------------------------------------------------------
# Onchange
# ------------------------------------------------------ # ------------------------------------------------------
@api.onchange('project_id') @api.onchange('project_id')
def _onchange_project_id(self): def _onchange_project_id(self):
......
...@@ -90,7 +90,8 @@ ...@@ -90,7 +90,8 @@
<field name="allday" attrs="{'readonly': [('id', '!=', False), ('recurrency','=',True)]}" force_save="1"/> <field name="allday" attrs="{'readonly': [('id', '!=', False), ('recurrency','=',True)]}" force_save="1"/>
<field name="type" /> <field name="type" />
<field name="location" /> <field name="location" />
<field name="ur_financial_system_id" options="{'no_open': True, 'no_create': True}" /> <field name="ur_financial_system_nb" invisible="1"/>
<field name="ur_financial_system_id" options="{'no_open': True, 'no_create': True}" attrs="{'required':[('ur_financial_system_nb', '>', 0)]}"/>
</group> </group>
</group> </group>
<group string="Informations complémentaires" name="event_extra_info"> <group string="Informations complémentaires" name="event_extra_info">
...@@ -166,9 +167,11 @@ ...@@ -166,9 +167,11 @@
</calendar> </calendar>
<field name="partner_ids" position="before"> <field name="partner_ids" position="before">
<field name="ur_id" invisible="1"/> <field name="ur_id" invisible="1"/>
<field name="coop_id" options="{'no_open': True, 'no_create': True}"/>
</field> </field>
<field name="partner_ids" position="attributes"> <field name="partner_ids" position="attributes">
<attribute name="domain">[('user_ids', '!=', False), ('ur_id', '=', ur_id)]</attribute> <attribute name="domain">[('user_ids', '!=', False), ('ur_id', '=', ur_id)]</attribute>
<field name="type" options="{'no_open': True, 'no_create': True}"/>
</field> </field>
</field> </field>
</record> </record>
...@@ -184,9 +187,6 @@ ...@@ -184,9 +187,6 @@
<field name="coop_id"/> <field name="coop_id"/>
</field> </field>
<filter name="mymeetings" position="after"> <filter name="mymeetings" position="after">
<separator/>
<filter string="Transformé en feuille de temps" name="timesheet" domain="[('is_transfered', '=', True)]"/>
<filter string="Non Transformé" name="not_timesheet" domain="[('is_transfered', '=', False)]"/>
<separator/> <separator/>
<filter string="UR" name="ur" domain="[('type', '=', 'ur')]"/> <filter string="UR" name="ur" domain="[('type', '=', 'ur')]"/>
<filter string="Hors UR" name="not_ur" domain="[('type', '=', 'outside')]"/> <filter string="Hors UR" name="not_ur" domain="[('type', '=', 'outside')]"/>
...@@ -195,21 +195,5 @@ ...@@ -195,21 +195,5 @@
</field> </field>
</record> </record>
<record id="cgscop_view_calendar_event_calendar" model="ir.ui.view">
<field name="name">calendar.event.calendar</field>
<field name="model">calendar.event</field>
<field name="inherit_id" ref="calendar.view_calendar_event_calendar"/>
<field name="arch" type="xml">
<data>
<field name="partner_ids" position="before">
<field name="coop_id" options="{'no_open': True, 'no_create': True}"/>
</field>
<field name="partner_ids" position="after">
<field name="type" options="{'no_open': True, 'no_create': True}"/>
</field>
</data>
</field>
</record>
</data> </data>
</odoo> </odoo>
0% Chargement en cours ou .
You are about to add 0 people to the discussion. Proceed with caution.
Veuillez vous inscrire ou vous pour commenter