Skip to content
Extraits de code Groupes Projets
Valider a1b71899 rédigé par Benj's avatar Benj
Parcourir les fichiers

commit initial

parent
Branches
Aucune étiquette associée trouvée
Aucune requête de fusion associée trouvée
from . import lefilament_projets
\ No newline at end of file
Fichier ajouté
{
'name': 'Le Filament - Projets',
'version': '9.0.1.0',
'description': """
MODULE PROJET LE FILAMENT
Etend l'application Projet :
- Crée un champ financier sur le projet
- Ajoute le taux horaire
- Calcule le temps max
""",
'author': 'LE FILAMENT',
'category': 'LE FILAMENT',
'depends': ['base','project'],
'contributors': [
'Benjamin Rivier <benjamin@le-filament.com>',
],
'website': 'http://www.le-filament.com',
'data': [
'views/lefilament_projets_view.xml',
],
}
\ No newline at end of file
# -*- coding: utf-8 -*-
from datetime import datetime, date
import time
from openerp import tools
from openerp import models, fields, api, osv
class SapovalPartners(models.Model):
_name = 'project.project'
_inherit = 'project.project'
lf_total_budget = fields.Float('Budget Projet',)
lf_tarif_jour = fields.Float('Tarif Jour',)
lf_taux_horaire = fields.Float('Taux Horaire', compute='_taux_horaire')
lf_heures_projet = fields.Float('Heures allouées', compute='_total_heures')
lf_heures_passees = fields.Float('Heures passées', compute='_total_heures_passees')
@api.one
def _taux_horaire(self):
self.lf_taux_horaire = self.lf_tarif_jour / 7.5
@api.one
def _total_heures(self):
if (self.lf_tarif_jour != 0.0):
self.lf_heures_projet = (self.lf_total_budget / self.lf_tarif_jour) * 7.5
else:
self.lf_heures_projet = 0.0
@api.one
def _total_heures_passees(self):
res = 0.0
#task = self.pool.get('project.task')
# task_ids = task.search(cr, uid, [('project_id', '=', id)], context=context)
for record in self.task_ids:
res = res + record.effective_hours
self.lf_heures_passees = res
\ No newline at end of file
Fichier ajouté
static/description/icon.png

5,7 ko

<?xml version="1.0" encoding="utf-8"?>
<openerp>
<data>
<!-- Project Form -->
<record id="view_form_lefilament_project_form_inherited" model="ir.ui.view">
<field name="name">Le Filament Projets</field>
<field name="model">project.project</field>
<field name="inherit_id" ref="project.edit_project"/>
<field name="arch" type="xml">
<xpath expr="//notebook" position="before">
<group>
<group>
<field name="lf_total_budget" widget="monetary" options="{'currency_field': 'company_currency'}"/>
<field name="lf_tarif_jour" widget="monetary" options="{'currency_field': 'company_currency'}"/>
</group>
<group>
<field name="lf_taux_horaire" widget="monetary" options="{'currency_field': 'company_currency'}"/>
<field name="lf_heures_projet" />
</group>
</group>
</xpath>
</field>
</record>
<!-- Tree View Projects -->
<record id="lefilament_project_tree_view" model="ir.ui.view">
<field name="name">Le Filament Projets Tree View</field>
<field name="model">project.project</field>
<field name="view_type">tree</field>
<field name="inherit_id" ref="project.view_project"/>
<field eval="0" name="sequence"/>
<field name="arch" type="xml">
<xpath expr="//field[@name='state']" position="after">
<field name="lf_heures_projet" />
<field name="lf_total_budget" />
</xpath>
</field>
</record>
<record id="crm_case_kanban_view_leads_inherit" model="ir.ui.view" >
<field name="name">Le Filament Projets Kanban</field>
<field name="model">project.project</field>
<field name="inherit_id" ref="project.view_project_kanban"/>
<field name="arch" type="xml">
<xpath expr="//div[@class='o_kanban_primary_left']" position="after">
<field name="lf_total_budget"> euros</field><br />
<field name="lf_heures_projet" > heures prévues</field><br />
<field name="lf_heures_passees" > heures passées</field>
</xpath>
</field>
</record>
</data>
</openerp>
\ No newline at end of file
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