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

[MIG] Make module installable in v12

parent dc3b9dfa
Aucune branche associée trouvée
Aucune étiquette associée trouvée
Aucune requête de fusion associée trouvée
......@@ -10,23 +10,26 @@ Le Filament - Projets
This module depends upon *hr_timesheet* and *hr_expense* modules.
This module provides:
- the calculation of imputed hours and costs on the project
- the project estimate (based on a variable of the number of hours per day)
- a progressbar spent / budget
- prospecting hours (new field to set up at the project level and based on the number of hours charged to a task named Prospection)
* the calculation of imputed hours and costs on the project
* the project estimate (based on a variable of the number of hours per day)
* a progressbar spent / budget
* prospecting hours (new field to set up at the project level and based on the number of hours charged to a task named Prospection)
Credits
=======
Contributors ------------
Contributors
------------
* Benjamin Rivier <benjamin@le-filament.com>
* Remi Cazenave <remi@le-filament.com>
* Juliana Poudou <juliana@le-filament.com>
Maintainer ----------
Maintainer
----------
.. image:: https://le-filament.com/img/logo-lefilament.png
:alt: Le Filament
......
{
'name': 'Le Filament - Projets',
'summary': """
Projets Le Filament""",
'version': '10.0.1.0.0',
'summary': "Projects Le Filament",
'version': '12.0.1.0.0',
'license': 'AGPL-3',
'description': """
Module Projet Le Filament
This module depends upon *hr_timesheet* and *hr_expense* modules.
This module provides:
- the calculation of imputed hours and costs on the project
- the project estimate (based on a variable of the number of hours per day)
- a progressbar spent / budget
- prospecting hours (new field to set up at the project level and based on
the number of hours charged to a task named Prospection)
""",
'author': 'LE FILAMENT',
'category': 'Project',
'depends': ['hr_timesheet', 'hr_expense'],
......@@ -31,10 +13,11 @@
],
'website': 'https://le-filament.com',
'data': [
'security/ir.model.access.csv',
'views/assets.xml',
'views/lefilament_projets_view.xml',
'views/account_analytic_view.xml',
'security/ir.model.access.csv',
'views/lefilament_projets_view.xml',
'views/res_config.xml',
],
'qweb': [
],
......
# -*- coding: utf-8 -*-
from . import project
from . import res_company
from . import res_config
......@@ -34,8 +34,7 @@ class FilamentProjet(models.Model):
@api.one
def _taux_horaire(self):
lf_heures_jour = self.env['ir.values'].get_default(
'project.config.settings', 'lf_heures_jour')
lf_heures_jour = self.env.user.company_id.lf_heures_jour
self.lf_taux_horaire = self.lf_tarif_jour / lf_heures_jour
@api.one
......@@ -95,8 +94,7 @@ class FilamentProjet(models.Model):
@api.one
def _total_heures(self):
lf_heures_jour = self.env['ir.values'].get_default(
'project.config.settings', 'lf_heures_jour')
lf_heures_jour = self.env.user.company_id.lf_heures_jour
if self.lf_tarif_jour != 0.0:
self.lf_heures_projet = (self.lf_heures_budget
/ self.lf_tarif_jour) * lf_heures_jour
......
# -*- coding: utf-8 -*-
# © 2019 Le Filament (<https://www.le-filament.com>)
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
from odoo import fields, models
class ResCompany(models.Model):
_inherit = 'res.company'
lf_heures_jour = fields.Float(
'Hours / Day',
help="Time base for calculating the number of hours sold per project \
(default 7h)",
default=7.0)
# -*- coding: utf-8 -*-
# © 2017 Le Filament (<https://www.le-filament.com>)
# © 2019 Le Filament (<https://www.le-filament.com>)
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
from odoo import api, fields, models
class ProjectLFConfiguration(models.TransientModel):
_name = 'project.config.settings'
_inherit = 'project.config.settings'
_name = 'res.config.settings'
_inherit = 'res.config.settings'
lf_heures_jour = fields.Float(
'Hours / Day',
help="Time base for calculating the number of hours sold per project \
(default 7h)",
default=7.0)
@api.multi
def set_default_lf_heures_jour(self):
return self.env['ir.values'].sudo().set_default(
'project.config.settings', 'lf_heures_jour', self.lf_heures_jour)
@api.multi
def get_default_lf_heures_jour(self, field):
lf_heures_jour = self.env['ir.values'].get_default(
'project.config.settings', 'lf_heures_jour')
return {'lf_heures_jour': lf_heures_jour if lf_heures_jour else 7.0}
default=7.0,
related="company_id.lf_heures_jour",
readonly=False)
......@@ -9,7 +9,7 @@
<field name="model">project.project</field>
<field name="inherit_id" ref="project.edit_project"/>
<field name="arch" type="xml">
<xpath expr="//field[@name='use_tasks']" position="before">
<xpath expr="//label[@for='label_tasks']" position="before">
<div>
<field name="use_prospection" class="oe_inline"/>
<label for="use_prospection" class="oe_inline"/>
......@@ -88,7 +88,7 @@
</tbody>
</table>
<div class="project-progress">
<field name="lf_heures_restantes" widget="progress" options="{'current_value': 'lf_heures_passees', 'max_value': 'lf_heures_projet', 'editable': false, 'edit_max_value': false, }" />
<field name="lf_heures_restantes" widget="progressbar" options="{'current_value': 'lf_heures_passees', 'max_value': 'lf_heures_projet', 'editable': false, 'edit_max_value': false, }" />
</div>
<table class="budget_table">
<tbody>
......@@ -113,7 +113,7 @@
<table class="budget_table">
<tbody>
<tr>
<td><a t-if="record.use_tasks.raw_value" name="%(project.act_project_project_2_project_task_all)d" type="action">Tasks</a></td>
<td><a name="%(project.act_project_project_2_project_task_all)d" type="action">Tasks</a></td>
<td><a type="open">Project</a></td>
</tr>
</tbody>
......@@ -126,15 +126,5 @@
</field>
</record>
<record id="view_lf_project_config_settings" model="ir.ui.view">
<field name="name">project lf settings</field>
<field name="model">project.config.settings</field>
<field name="inherit_id" ref="project.view_config_settings"/>
<field name="arch" type="xml">
<xpath expr="//field[@name='module_rating_project']" position="after">
<field name="lf_heures_jour" class="oe_inline oe_text_right" />
</xpath>
</field>
</record>
</data>
</odoo>
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<record id="lefilament_projets_config_settings" model="ir.ui.view">
<field name="name">Le Filament Projets Settings</field>
<field name="model">res.config.settings</field>
<field name="inherit_id" ref="project.res_config_settings_view_form"/>
<field name="arch" type="xml">
<div id="use_collaborative_pad" position="before">
<div class="col-12 col-lg-6 o_setting_box" id="lf_projects_setting">
<div class="o_setting_left_pane">
</div>
<div class="o_setting_right_pane">
<div class="text-muted">
Time base for calculating the number of hours sold per project (default 7h)
</div>
<div class="content-group" >
<div class="row mt16">
<field name="lf_heures_jour"/>
</div>
</div>
</div>
</div>
</div>
</field>
</record>
</odoo>
\ 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