Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found
Select Git revision

Target

Select target project
  • lefilament/cgscop/cgscop_timesheet
  • hsilvant/cgscop_timesheet
2 results
Select Git revision
Show changes
Showing
with 1529 additions and 169 deletions
# © 2019 Le Filament (<http://www.le-filament.com>)
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
from odoo import fields, models
class ResCompanyTmesheet(models.Model):
_inherit = "res.company"
day_duration = fields.Float(
string="Nb Heures/Jour",
default=8,
help="Nombre d'heures max pour imputation",
)
day_working = fields.Boolean(
string="Forfait Jour",
default=False,
help="Si cette option est cochée, un employé peut imputer sans limite"
" de temps sur une journée",
)
overtime_working = fields.Boolean(
string="Heures supplémentaires",
default=False,
help="Si cette option est cochée, un employé peut déclarer des heures supplémentaire"
)
weekend_working = fields.Boolean(
string="Travail le weekend",
default=False,
help="Si cette option est cochée, un employé peut imputer le weekend",
)
use_travel_time = fields.Boolean(
string="Saisie des temps de déplacement",
default=False,
help="Si cette option est cochée, un employé peut saisir ses temps de déplacement"
)
# © 2020 Le Filament (<http://www.le-filament.com>)
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
from odoo import fields, models
class ScopPartnerTimesheet(models.Model):
_inherit = "res.partner"
ur_financial_system_id = fields.Many2one(
comodel_name="ur.financial.system",
string="Dispositif Financier",
ondelete="set null",
)
ur_financial_system_date = fields.Date("Date de fin de dispositif")
ur_regional_convention_id = fields.Many2one(
comodel_name="ur.regional.convention",
string="Convention Régionale",
ondelete="set null",
)
ur_regional_convention_date = fields.Date("Date de fin de convention")
ur_financial_system_nb = fields.Integer(
string="Nb Dispositifs Financiers", compute="_compute_ur_system_nb"
)
ur_regional_convention_nb = fields.Integer(
string="Nb conventions régionales", compute="_compute_ur_system_nb"
)
# ------------------------------------------------------
# Compute Functions
# ------------------------------------------------------
def _compute_ur_system_nb(self):
for partner in self:
# Calcul nombre de dispositifs financiers
financial_system = partner.env["ur.financial.system"].search(
[("ur_id", "=", self.env.user.ur_id.id)]
)
partner.ur_financial_system_nb = len(financial_system)
# Calcul nombre de conventions
regional_convention = partner.env["ur.regional.convention"].search(
[("ur_id", "=", self.env.user.ur_id.id)]
)
partner.ur_regional_convention_nb = len(regional_convention)
# © 2019 Le Filament (<http://www.le-filament.com>) # © 2019 Le Filament (<http://www.le-filament.com>)
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
from odoo import models, fields from odoo import fields, models
class ScopTimesheetCode(models.Model): class ScopTimesheetCode(models.Model):
...@@ -9,16 +9,18 @@ class ScopTimesheetCode(models.Model): ...@@ -9,16 +9,18 @@ class ScopTimesheetCode(models.Model):
_description = "Dispositif financier UR" _description = "Dispositif financier UR"
def _default_ur(self): def _default_ur(self):
return self.env['res.company']._ur_default_get() return self.env["res.company"]._ur_default_get()
name = fields.Char('Nom') name = fields.Char("Nom")
company_id = fields.Many2one( company_id = fields.Many2one(
comodel_name='res.company', comodel_name="res.company",
string='Société', string="Société",
default=lambda self: self.env.user.company_id) default=lambda self: self.env.company,
)
ur_id = fields.Many2one( ur_id = fields.Many2one(
'union.regionale', "union.regionale",
string='Union Régionale', string="Union Régionale",
index=True, index=True,
on_delete='restrict', ondelete="restrict",
default=_default_ur) default=_default_ur,
)
# © 2019 Le Filament (<http://www.le-filament.com>)
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
from datetime import date
from dateutil.relativedelta import relativedelta
from odoo import api, fields, models
def get_years():
year_list = []
for i in range(2019, 2030):
year_list.append((str(i), str(i)))
return year_list
MONTHS = [
("1", "Janv"),
("2", "Fév"),
("3", "Mars"),
("4", "Avr"),
("5", "Mai"),
("6", "Juin"),
("7", "Juil"),
("8", "Août"),
("9", "Sept"),
("10", "Oct"),
("11", "Nov"),
("12", "Dec"),
]
class ScopMonthTimesheet(models.Model):
_name = "ur.month.timesheet"
_description = "Heures theoriques mensuelles"
_order = "date_timesheet"
def _default_ur(self):
return self.env["res.company"]._ur_default_get()
year = fields.Selection(
selection=get_years(), string="Année", default=fields.Date.today().year
)
month = fields.Selection(selection=MONTHS, string="Mois")
date_timesheet = fields.Date(
string="Mois format date",
compute="_compute_date_timesheet",
store=True,
)
company_id = fields.Many2one(
comodel_name="res.company",
string="Société",
default=lambda self: self.env.company,
)
ur_id = fields.Many2one(
"union.regionale",
string="Union Régionale",
index=True,
ondelete="restrict",
default=_default_ur,
)
working_time = fields.Integer("Heures théoriques")
_sql_constraints = [
(
"month_year_uniq",
"UNIQUE (year, month, ur_id)",
"Cette date a déjà été renseignée.",
)
]
@api.depends("year", "month")
def _compute_date_timesheet(self):
for month in self:
date_timesheet = date(int(month.year), int(month.month), 1)
month.date_timesheet = date_timesheet
@api.model
def get_month_values(self):
today = date.today()
first_date = today.replace(day=1) - relativedelta(months=6)
last_date = today.replace(day=1) + relativedelta(months=6)
values = self.search(
[
("date_timesheet", ">=", first_date),
("date_timesheet", "<=", last_date),
("ur_id", "=", self.env.company.ur_id.id),
]
)
return {
"month_values": values.mapped(
lambda m: {
"year": m.year,
"month": self._fields["month"].selection[int(m.month) - 1][1],
"working_time": m.working_time,
"date_timesheet": m.date_timesheet,
}
),
"today": today.replace(day=1),
}
# © 2019 Le Filament (<http://www.le-filament.com>)
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
from odoo import fields, models
class ScopRegionalConvention(models.Model):
_name = "ur.regional.convention"
_description = "Convention Régionale UR"
def _default_ur(self):
return self.env["res.company"]._ur_default_get()
name = fields.Char("Nom")
company_id = fields.Many2one(
comodel_name="res.company",
string="Société",
default=lambda self: self.env.company,
)
ur_id = fields.Many2one(
"union.regionale",
string="Union Régionale",
index=True,
ondelete="restrict",
default=_default_ur,
)
...@@ -3,80 +3,142 @@ ...@@ -3,80 +3,142 @@
<data> <data>
<template id="report_timesheet_document"> <template id="report_timesheet_document">
<t t-call="web.external_layout"> <t t-call="web.external_layout">
<t t-set="o" t-value="o.with_context(lang=lang)" />
<div class="page"> <div class="page">
<h2> <h2>
Feuille de Temps Feuille de Temps <t t-if="o.state == 'draft'"> - Brouillon</t>
</h2> </h2>
<h3>
<t t-esc="o.name" />
</h3>
<div id="informations" class="row mt32 mb32"> <div id="informations" class="row mt32 mb32">
<div class="col-auto mw-100 mb-2" name="employee"> <div class="col-auto mw-100 mb-2" name="employee">
<strong>Employé</strong> <strong>Employé</strong>
<p class="m-0" t-field="o.user_id.name"/> <p class="m-0" t-field="o.employee_id.name" />
</div> </div>
<div class="col-auto mw-100 mb-2"> <div class="col-auto mw-100 mb-2">
<strong>Date de début</strong> <strong>Soumis le</strong>
<p class="m-0" t-field="o.date_start"/> <p class="m-0" t-field="o.submit_date" />
</div> </div>
<div class="col-auto mw-100 mb-2" name="date_end"> <div class="col-auto mw-100 mb-2" name="date_end">
<strong>Date de fin</strong> <strong>Validé le</strong>
<p class="m-0" t-field="o.date_end"/> <p class="m-0" t-field="o.validation_date" />
</div>
<div class="col-auto mw-100 mb-2" name="date_end">
<strong>Total</strong>
<p
class="m-0"
t-field="o.total_hour"
t-options="{'widget': 'duration', 'digital': True, 'unit': 'hour', 'round': 'minute'}"
/>
</div> </div>
</div> </div>
<table class="table table-sm o_main_table" name="invoice_line_table"> <table
class="table table-sm o_main_table"
name="invoice_line_table"
>
<thead> <thead>
<tr> <tr>
<th class="text-left"><span>Date</span></th> <th class="text-left"><span>Date</span></th>
<th class="text-left"><span>Code activité UR</span></th> <th class="text-left"><span>Code activité UR</span></th>
<th class="text-left"><span>Contact</span></th> <th class="text-left"><span>Contact</span></th>
<th class="text-left"><span>Dispositif</span></th> <th class="text-left"><span>Description</span></th>
<th class="text-left"><span
>Dispositif Financier</span></th>
<th class="text-left"><span>Durée</span></th> <th class="text-left"><span>Durée</span></th>
</tr> </tr>
</thead> </thead>
<tbody class="invoice_tbody"> <tbody class="invoice_tbody">
<t t-foreach="o.timesheet_ids" t-as="line"> <t
t-foreach="o.timesheet_line_ids.sorted('date')"
t-as="line"
>
<tr> <tr>
<td><span t-field="line.date" /></td> <td><span t-field="line.date" /></td>
<td><span t-field="line.project_id" /></td> <td><span t-field="line.project_id" /></td>
<td><span t-field="line.partner_id" /></td> <td><span t-field="line.partner_id" /></td>
<td><span t-field="line.ur_financial_system_id"/></td> <td><span t-field="line.name" /></td>
<td class="text-right"><span t-field="line.unit_amount" t-options="{'widget': 'duration', 'digital': True, 'unit': 'hour', 'round': 'minute'}"/></td> <td><span
t-field="line.ur_financial_system_id"
/></td>
<td class="text-right"><span
t-field="line.unit_amount"
t-options="{'widget': 'duration', 'digital': True, 'unit': 'hour', 'round': 'minute'}"
/></td>
</tr> </tr>
</t> </t>
<tr> <tr>
<td /> <td />
<td /> <td />
<td /> <td />
<td />
<td class="text-right"><strong>Total</strong></td> <td class="text-right"><strong>Total</strong></td>
<td class="text-right"><strong t-esc="sum(o.timesheet_ids.mapped('unit_amount'))" t-options="{'widget': 'duration', 'digital': True, 'unit': 'hour', 'round': 'minute'}"/></td> <td class="text-right"><strong
t-esc="o.total_hour"
t-options="{'widget': 'duration', 'digital': True, 'unit': 'hour', 'round': 'minute'}"
/></td>
</tr> </tr>
</tbody> </tbody>
</table> </table>
<div
t-if="o.state == 'draft'"
>Cette feuille de temps a été éditée en brouillon.</div>
<div t-else="">
<table style="float: right;">
<tr>
<td
style="width: 300px; border-bottom: 1px solid #495057; text-align: center;"
>
Visa salarié
</td>
<td
style="width: 300px; border-bottom: 1px solid #495057; text-align: center;"
>
Visa direction
</td>
</tr>
<tr>
<td><br /><br /><br /></td>
<td><br /><br /><br /></td>
</tr>
</table>
</div>
</div> </div>
</t> </t>
</template> </template>
<template id="report_timesheet"> <template id="report_timesheet_sheet">
<t t-call="web.html_container"> <t t-call="web.html_container">
<t t-foreach="docs" t-as="o"> <t t-foreach="docs" t-as="o">
<t t-set="lang" t-value="o.user_id.lang"/> <t t-call="cgscop_timesheet.report_timesheet_document" />
<t t-call="cgscop_timesheet.report_timesheet_document" t-lang="lang"/>
</t> </t>
</t> </t>
</template> </template>
<!-- QWeb Reports --> <!-- Paper format -->
<report <record id="cgscop_paperformat_a4_landscape" model="report.paperformat">
id="cgscop_timesheet_report" <field name="name">A4 Paysage</field>
model="cgscop.timesheet.print" <field name="default" eval="True" />
string="Feuilles de Temps" <field name="format">A4</field>
report_type="qweb-pdf" <field name="orientation">Landscape</field>
name="cgscop_timesheet.report_timesheet" <field name="margin_top">35</field>
file="cgscop_timesheet.report_timesheet" <field name="margin_bottom">20</field>
menu="False" <field name="margin_left">10</field>
/> <field name="margin_right">10</field>
<field name="header_line" eval="False" />
<field name="header_spacing">30</field>
<field name="dpi">90</field>
</record>
<!-- QWeb Reports -->
<record id="cgscop_timesheet_sheet_report" model="ir.actions.report">
<field name="name">CG Scop - Feuille de Temps</field>
<field name="model">cgscop.timesheet.sheet</field>
<field name="report_type">qweb-pdf</field>
<field name="report_name">cgscop_timesheet.report_timesheet_sheet</field>
<field name="report_file">cgscop_timesheet.report_timesheet_sheet</field>
<field name="paperformat_id" ref="cgscop_paperformat_a4_landscape" />
</record>
</data> </data>
</odoo> </odoo>
<?xml version="1.0" encoding="utf-8" ?>
<odoo>
<data>
<template id="report_timesheet_document_act">
<t t-call="web.external_layout">
<div class="page">
<h2>
Feuille de Temps par activité <t
t-if="o.state == 'draft'"
> - Brouillon</t>
</h2>
<h3>
<t t-esc="o.name" />
</h3>
<div id="informations" class="row mt32 mb32">
<div class="col-auto mw-100 mb-2" name="employee">
<strong>Employé</strong>
<p class="m-0" t-field="o.employee_id.name" />
</div>
<div class="col-auto mw-100 mb-2">
<strong>Soumis le</strong>
<p class="m-0" t-field="o.submit_date" />
</div>
<div class="col-auto mw-100 mb-2" name="date_end">
<strong>Validé le</strong>
<p class="m-0" t-field="o.validation_date" />
</div>
<div class="col-auto mw-100 mb-2" name="date_end">
<strong>Total</strong>
<p
class="m-0"
t-field="o.total_hour"
t-options="{'widget': 'duration', 'digital': True, 'unit': 'hour', 'round': 'minute'}"
/>
</div>
</div>
<table
class="table table-sm o_main_table"
name="invoice_line_table"
>
<thead>
<tr>
<th class="text-left"><span>Code activité UR</span></th>
<th class="text-left"><span>Date</span></th>
<th class="text-left"><span>Contact</span></th>
<th class="text-left"><span>Description</span></th>
<th class="text-left"><span
>Dispositif Financier</span></th>
<th class="text-left"><span>Durée</span></th>
</tr>
</thead>
<tbody class="invoice_tbody">
<t t-foreach="o._get_timesheet_line_act()" t-as="line">
<tr>
<td><span><t t-esc="line['project']" /></span></td>
<td><span><t t-esc="line['date']" /></span></td>
<td><span><t t-esc="line['partner']" /></span></td>
<td><span><t t-esc="line['name']" /></span></td>
<td><span>
<t t-if="line['total']==1">
<strong>
<t t-esc="line['ur_financial_system']" />
</strong>
</t>
<t t-if="line['total']==0">
<t t-esc="line['ur_financial_system']" />
</t>
</span></td>
<td class="text-right"><span>
<t t-esc="line['unit_amount']" />
</span></td>
</tr>
</t>
<tr>
<td />
<td />
<td />
<td />
<td class="text-right"><strong>Total</strong></td>
<td class="text-right"><strong
t-esc="o.total_hour"
t-options="{'widget': 'duration', 'digital': True, 'unit': 'hour', 'round': 'minute'}"
/></td>
</tr>
</tbody>
</table>
<div
t-if="o.state == 'draft'"
>Cette feuille de temps a été éditée en brouillon.</div>
<div t-else="">
<table style="float: right;">
<tr>
<td
style="width: 300px; border-bottom: 1px solid #495057; text-align: center;"
>
Visa salarié
</td>
<td
style="width: 300px; border-bottom: 1px solid #495057; text-align: center;"
>
Visa direction
</td>
</tr>
<tr>
<td><br /><br /><br /></td>
<td><br /><br /><br /></td>
</tr>
</table>
</div>
</div>
</t>
</template>
<template id="report_timesheet_sheet_act">
<t t-call="web.html_container">
<t t-foreach="docs" t-as="o">
<t t-call="cgscop_timesheet.report_timesheet_document_act" />
</t>
</t>
</template>
<record id="cgscop_timesheet_sheet_report_act" model="ir.actions.report">
<field name="name">CG Scop - Feuille de Temps par activité</field>
<field name="model">cgscop.timesheet.sheet</field>
<field name="report_type">qweb-pdf</field>
<field
name="report_name"
>cgscop_timesheet.report_timesheet_sheet_act</field>
<field
name="report_file"
>cgscop_timesheet.report_timesheet_sheet_act</field>
<field name="paperformat_id" ref="cgscop_paperformat_a4_landscape" />
</record>
</data>
</odoo>
...@@ -8,3 +8,11 @@ access_project_project_ur_manager,access_project_project_ur,model_project_projec ...@@ -8,3 +8,11 @@ access_project_project_ur_manager,access_project_project_ur,model_project_projec
access_project_project_cg_manager,access_project_project_cg,model_project_project,cgscop_partner.group_cg_administrator,1,1,1,1 access_project_project_cg_manager,access_project_project_cg,model_project_project,cgscop_partner.group_cg_administrator,1,1,1,1
access_account_analytic_account_ur_manager,access_account_analytic_account_ur,analytic.model_account_analytic_account,cgscop_partner.group_ur_list_modif,1,1,1,1 access_account_analytic_account_ur_manager,access_account_analytic_account_ur,analytic.model_account_analytic_account,cgscop_partner.group_ur_list_modif,1,1,1,1
access_account_analytic_account_cg_manager,access_account_analytic_account_cg,analytic.model_account_analytic_account,cgscop_partner.group_cg_administrator,1,1,1,1 access_account_analytic_account_cg_manager,access_account_analytic_account_cg,analytic.model_account_analytic_account,cgscop_partner.group_cg_administrator,1,1,1,1
access_cgscop_timesheet_sheet_user,access_cgscop_timesheet_sheet_user,model_cgscop_timesheet_sheet,hr_timesheet.group_hr_timesheet_user,1,1,1,1
access_ur_regional_convention,access_ur_regional_convention,model_ur_regional_convention,base.group_user,1,0,0,0
access_ur_regional_convention_ur_manager,access_ur_regional_convention_ur,model_ur_regional_convention,cgscop_partner.group_ur_list_modif,1,1,1,1
access_ur_regional_convention_cg_manager,access_ur_regional_convention_cg,model_ur_regional_convention,cgscop_partner.group_cg_administrator,1,1,1,1
access_ur_month_timesheet,access_ur_month_timesheet,model_ur_month_timesheet,base.group_user,1,0,0,0
access_ur_month_timesheet_ur_manager,access_ur_month_timesheet_ur,model_ur_month_timesheet,cgscop_partner.group_ur_list_modif,1,1,1,1
access_ur_month_timesheet_cg_manager,access_ur_month_timesheet_cg,model_ur_month_timesheet,cgscop_partner.group_cg_administrator,1,1,1,1
access_cgscop_timesheet_print_wizard,access_cgscop_timesheet_print_wizard,model_cgscop_timesheet_print_wizard,base.group_user,1,1,1,1
<?xml version="1.0" ?> <?xml version="1.0" ?>
<!-- Copyright 2019 Le Filament <!-- Copyright 2019 Le Filament
License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). --> License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). -->
<odoo> <odoo>
<data noupdate="0"> <data>
<!-- UR Financial System -->
<record id="ur_financial_system_rule_ur" model="ir.rule"> <record id="ur_financial_system_rule_ur" model="ir.rule">
<field name="name">ur financial system rule per ur</field> <field name="name">ur financial system rule per ur</field>
<field name="model_id" ref="model_ur_financial_system" /> <field name="model_id" ref="model_ur_financial_system" />
<field name="domain_force">[('ur_id','=',user.company_id.ur_id.id)]</field> <field name="domain_force">[('company_id','in',company_ids)]</field>
<field name="groups" eval="[(6, 0, [ref('base.group_user')])]" />
<field eval="True" name="global" />
</record>
<!-- UR Regional Convention -->
<record id="ur_regional_convention_rule_ur" model="ir.rule">
<field name="name">ur regional convention rule per ur</field>
<field name="model_id" ref="model_ur_regional_convention" />
<field name="domain_force">[('company_id','in',company_ids)]</field>
<field name="groups" eval="[(6, 0, [ref('base.group_user')])]" />
<field eval="True" name="global" />
</record>
<!-- UR Month Timesheet -->
<record id="ur_month_timesheet_rule_ur" model="ir.rule">
<field name="name">ur month timesheet rule per ur</field>
<field name="model_id" ref="model_ur_month_timesheet" />
<field name="domain_force">[('company_id','in',company_ids)]</field>
<field name="groups" eval="[(6, 0, [ref('base.group_user')])]" /> <field name="groups" eval="[(6, 0, [ref('base.group_user')])]" />
<field eval="True" name="global" /> <field eval="True" name="global" />
</record> </record>
<!-- Project -->
<record id="project_rule_ur" model="ir.rule"> <record id="project_rule_ur" model="ir.rule">
<field name="name">project rule per ur</field> <field name="name">project rule per ur</field>
<field name="model_id" ref="project.model_project_project" /> <field name="model_id" ref="project.model_project_project" />
<field name="domain_force">[('ur_id','=',user.company_id.ur_id.id)]</field> <field name="domain_force">[('company_id','in',company_ids)]</field>
<field name="groups" eval="[(6, 0, [ref('base.group_user')])]" /> <field name="groups" eval="[(6, 0, [ref('base.group_user')])]" />
<field eval="True" name="global" /> <field eval="True" name="global" />
</record> </record>
<record id="project_rule_administrator_ur" model="ir.rule"> <record id="project_rule_administrator_ur" model="ir.rule">
<field name="name">project rule for administrator</field> <field name="name">project rule for administrator</field>
<field name="model_id" ref="project.model_project_project" /> <field name="model_id" ref="project.model_project_project" />
<field name="domain_force">[(1,'=',1)]</field> <field name="domain_force">[(1,'=',1)]</field>
<field name="groups" eval="[(6, 0, [ref('cgscop_partner.group_cg_administrator')])]"/> <field
name="groups"
eval="[(6, 0, [ref('cgscop_partner.group_cg_administrator')])]"
/>
<field eval="True" name="global" /> <field eval="True" name="global" />
</record> </record>
<!-- Analytic Line -->
<record id="analytic_line_ur_rule" model="ir.rule"> <record id="analytic_line_ur_rule" model="ir.rule">
<field name="name">Analytic line UR rule</field> <field name="name">Analytic line UR rule</field>
<field name="model_id" ref="analytic.model_account_analytic_line" /> <field name="model_id" ref="analytic.model_account_analytic_line" />
<field name="groups" eval="[(6, 0, [ref('base.group_user')])]" /> <field name="groups" eval="[(6, 0, [ref('base.group_user')])]" />
<field eval="True" name="global" /> <field eval="True" name="global" />
<field name="domain_force">[('ur_id','=',user.company_id.ur_id.id)]</field> <field name="domain_force">[('ur_id','=',user.current_ur_id.id)]</field>
</record>
<record id="analytic_rule_administrator_ur" model="ir.rule">
<field name="name">Analytic line UR administrator rule</field>
<field name="model_id" ref="analytic.model_account_analytic_line"/>
<field name="domain_force">[(1,'=',1)]</field>
<field name="groups" eval="[(6, 0, [ref('cgscop_partner.group_cg_administrator')])]"/>
<field eval="True" name="global"/>
</record> </record>
<record id="analytic.analytic_line_comp_rule" model="ir.rule"> <record id="analytic.analytic_line_comp_rule" model="ir.rule">
<field name="name">Analytic line multi company rule</field> <field name="name">Analytic line multi company rule</field>
<field name="model_id" ref="model_account_analytic_line" /> <field name="model_id" ref="model_account_analytic_line" />
<field eval="True" name="global" /> <field eval="True" name="global" />
<field name="active" eval="False" /> <field name="active" eval="False" />
</record> </record>
<record id="account.account_analytic_line_rule_billing_user" model="ir.rule">
<field name="name">analytic.analytic.line.billing.user</field>
<field name="model_id" ref="model_account_analytic_line" />
<field name="perm_read" eval="False" />
<field name="perm_write" eval="True" />
<field name="perm_create" eval="True" />
<field name="perm_unlink" eval="True" />
<field name="active" eval="False" />
</record>
<!-- CGScop Timesheet Sheet -->
<record id="timesheet_sheet_rule_ur" model="ir.rule">
<field name="name">Feuilles de temps de mon UR</field>
<field
name="model_id"
ref="cgscop_timesheet.model_cgscop_timesheet_sheet"
/>
<field name="domain_force">[('ur_id','=',user.current_ur_id.id)]</field>
<field name="groups" eval="[(6, 0, [ref('base.group_user')])]" />
<field eval="True" name="global" />
</record>
</data> </data>
</odoo> </odoo>
static/description/icon.png

8.95 KiB | W: 0px | H: 0px

static/description/icon.png

15.5 KiB | W: 0px | H: 0px

static/description/icon.png
static/description/icon.png
static/description/icon.png
static/description/icon.png
  • 2-up
  • Swipe
  • Onion skin
// © 2019 Le Filament (<http://www.le-filament.com>)
// License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
odoo.define("cgscop_timesheet.ur_month_timesheet", function (require) {
"use strict";
var core = require("web.core");
var AbstractAction = require("web.AbstractAction");
var ScopMonthTimesheet = AbstractAction.extend({
template: "ScopMonthTimesheet",
willStart: function () {
var superDef = this._super.apply(this, arguments);
var self = this;
this.values = {};
var def = this._rpc({
model: "ur.month.timesheet",
method: "get_month_values",
args: [],
}).then(function (results) {
self.values = results;
});
return Promise.all([superDef, def]);
},
// Start: function () {},
});
core.action_registry.add("cgscop_timesheet.ur_month_timesheet", ScopMonthTimesheet);
});
<?xml version="1.0" encoding="UTF-8" ?>
<!-- Copyright 2019 Le Filament (<https://www.le-filament.com>)
License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). -->
<templates xml:space="preserve">
<t t-name="ScopMonthTimesheet">
<t t-if="widget.values.month_values">
<table class="table">
<thead>
<tr>
<th t-foreach="widget.values.month_values" t-as="m">
<div
t-att-class="m.date_timesheet == widget.values.today ? 'text-success' : ''"
>
<t t-esc="m.month" /> <t t-esc="m.year" />
</div>
</th>
</tr>
</thead>
<tbody>
<tr>
<td t-foreach="widget.values.month_values" t-as="m">
<div
t-att-class="m.date_timesheet == widget.values.today ? 'text-right text-success' : 'text-right'"
>
<t t-esc="m.working_time" /> h
</div>
</td>
</tr>
</tbody>
</table>
</t>
<t t-else="">
<p>Aucun temps de travail théorique n'a été configuré.</p>
</t>
</t>
</templates>
<?xml version="1.0" ?> <?xml version="1.0" ?>
<!-- Copyright 2019 Le Filament <!-- Copyright 2019 Le Filament
License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). --> License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). -->
<odoo> <odoo>
<template
<template id="cgscop_assets_backend" name="account assets" inherit_id="web.assets_backend"> id="cgscop_assets_backend"
name="account assets"
inherit_id="web.assets_backend"
>
<xpath expr="." position="inside"> <xpath expr="." position="inside">
<link rel="stylesheet" type="text/css" href="/cgscop_timesheet/static/src/css/style.css"/> <link
rel="stylesheet"
type="text/css"
href="/cgscop_timesheet/static/src/css/style.css"
/>
<script
type="text/javascript"
src="/cgscop_timesheet/static/src/js/ur_month_timesheet.js"
/>
</xpath> </xpath>
</template> </template>
......
<?xml version="1.0" ?> <?xml version="1.0" ?>
<!-- Copyright 2019 Le Filament <!-- Copyright 2019 Le Filament
License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). --> License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). -->
<odoo> <odoo>
<data> <data>
<record id="view_cgscop_timesheet_code_tree" model="ir.ui.view"> <record id="view_cgscop_timesheet_code_tree" model="ir.ui.view">
...@@ -9,7 +8,8 @@ ...@@ -9,7 +8,8 @@
<field name="model">cgscop.timesheet.code</field> <field name="model">cgscop.timesheet.code</field>
<field name="arch" type="xml"> <field name="arch" type="xml">
<tree editable='top'> <tree editable='top'>
<field name="name" /> <field name="name" required="1" />
<field name="domain" />
</tree> </tree>
</field> </field>
</record> </record>
...@@ -21,12 +21,14 @@ ...@@ -21,12 +21,14 @@
<field name="help">Affiche et gère les Codes activité Nationaux</field> <field name="help">Affiche et gère les Codes activité Nationaux</field>
</record> </record>
<menuitem id="menu_cgscop_timesheet_code" <menuitem
id="menu_cgscop_timesheet_code"
name="Codes Activité National" name="Codes Activité National"
parent="hr_timesheet.hr_timesheet_menu_configuration" parent="hr_timesheet.hr_timesheet_menu_configuration"
action="action_cgscop_timesheet_code_tree" action="action_cgscop_timesheet_code_tree"
sequence="40" sequence="40"
groups="cgscop_partner.group_cg_administrator"/> groups="cgscop_partner.group_cg_administrator"
/>
</data> </data>
</odoo> </odoo>
<?xml version="1.0" encoding="utf-8" ?>
<odoo>
<data>
<!--
Vues
-->
<!-- Tree view -->
<record id="view_cgscop_timesheet_sheet_tree" model="ir.ui.view">
<field name="name">cgscop.timesheet.sheet.tree</field>
<field name="model">cgscop.timesheet.sheet</field>
<field name="arch" type="xml">
<tree string="Timesheet Reports" decoration-warning="state=='draft'">
<field name="name" />
<field name="employee_id" />
<field name="create_date" />
<field name="validation_date" />
<field name="total_hour" sum="Total" />
<field name="state" />
</tree>
</field>
</record>
<!-- Form view -->
<record id="view_cgscop_timesheet_sheet_form" model="ir.ui.view">
<field name="name">cgscop.timesheet.sheet.form</field>
<field name="model">cgscop.timesheet.sheet</field>
<field name="priority" eval="25" />
<field name="arch" type="xml">
<form>
<field name="company_id" invisible="1" />
<header>
<button
name="action_submit_timesheet"
states="draft"
string="Soumettre"
type="object"
class="oe_highlight"
/>
<button
name="approve_timesheet_sheets"
states="submit"
string="Valider"
type="object"
groups="hr_timesheet.group_timesheet_manager"
class="oe_highlight"
/>
<button
string="Imprimer"
type="action"
name="%(cgscop_timesheet_print_act)d"
class="oe_read_only"
/>
<button
name="reset_timesheet_sheets"
string="Remettre en brouillon"
type="object"
attrs="{'invisible': [('state', '=', 'draft')]}"
groups="hr_timesheet.group_timesheet_manager"
/>
<field
name="state"
widget="statusbar"
statusbar_visible="draft,submit,valid"
/>
</header>
<sheet>
<div class="oe_title">
<label for="name" class="oe_edit_only" />
<h1>
<field
name="name"
attrs="{'readonly': [('can_edit','=', False), ('state','!=', 'draft')]}"
/>
</h1>
</div>
<group>
<group>
<field
name="employee_id"
groups="hr_timesheet.group_timesheet_manager"
options="{'no_open': True, 'no_create': True}"
/>
<field
name="company_id"
groups="base.group_multi_company"
options="{'no_open': True, 'no_create': True}"
/>
</group>
<group>
<field name="create_date" readonly="1" />
<field name="submit_date" readonly="1" />
<field name="validation_date" readonly="1" />
<field name="total_hour" widget="float_time" />
</group>
</group>
<field name="can_edit" invisible="1" />
<field
name="timesheet_line_ids"
widget="many2many"
domain="[('sheet_id', '=', False), ('employee_id', '=', employee_id)]"
options="{'reload_on_button': True}"
attrs="{'readonly': [('can_edit','=', False), ('state','!=', 'draft')]}"
context="{'form_view_ref' : 'hr_timesheet.timesheet_view_form_user'}"
>
<tree editable="top">
<field name="company_id" invisible="1" />
<field name="ur_id" invisible="1" />
<field name="date" />
<field name="employee_id" readonly="1" />
<field name="state" invisible="1" />
<field name="sheet_id" invisible="1" />
<field
name="project_id"
options="{'no_open': True, 'no_create': True}"
/>
<field
name="partner_id"
options="{'no_open': True, 'no_create': True}"
/>
<field name="name" />
<field name="unit_amount" widget="float_time" />
<field
name="ur_financial_system_id"
options="{'no_open': True, 'no_create': True}"
/>
<field
name="justificatifs"
attrs="{'invisible': [('ur_id', '!=', %(cgscop_partner.riga_14243)d)]}"
/>
</tree>
</field>
</sheet>
<div class="oe_chatter">
<field
name="message_follower_ids"
options="{'post_refresh':True}"
groups="base.group_user"
/>
<field name="activity_ids" />
<field name="message_ids" />
</div>
</form>
</field>
</record>
<!-- Search view -->
<record id="view_cgscop_timesheet_sheet_filter" model="ir.ui.view">
<field name="name">cgscop.timesheet.sheet.filter</field>
<field name="model">cgscop.timesheet.sheet</field>
<field name="arch" type="xml">
<search string="Feuille de temps">
<field name="name" />
<field name="state" />
<separator />
<field name="employee_id" />
<filter
string="Mes feuilles de temps"
name="my_reports"
domain="[('employee_id.user_id', '=', uid)]"
/>
<filter
string="Mon équipe"
name="my_team_reports"
domain="[('employee_id.parent_id.user_id', '=', uid)]"
groups="hr_timesheet.group_timesheet_manager"
help="Expenses of Your Team Member"
/>
<separator />
<filter
domain="[('state', '=', 'draft')]"
string="Brouillon"
name="draft"
/>
<filter
domain="[('state', '=', 'submit')]"
string="Soumis"
name="submitted"
/>
<filter
domain="[('state', '=', 'valid')]"
string="Validé"
name="valid"
/>
<group expand="0" string="Group By">
<filter
string="Employé"
name="employee"
domain="[]"
context="{'group_by': 'employee_id'}"
/>
<filter
string="Statut"
domain="[]"
context="{'group_by': 'state'}"
name="state"
/>
</group>
</search>
</field>
</record>
<!--
Actions
-->
<record id="action_cgscop_timesheet_sheet_my_all" model="ir.actions.act_window">
<field name="name">Mes feuilles de temps</field>
<field name="res_model">cgscop.timesheet.sheet</field>
<field name="view_mode">tree,form</field>
<field name="search_view_id" ref="view_cgscop_timesheet_sheet_filter" />
<field name="domain">[('employee_id.user_id', '=', uid)]</field>
<field name="context">{'search_default_my_reports': 1}</field>
</record>
<record
id="action_cgscop_timesheet_sheet_to_approve"
model="ir.actions.act_window"
>
<field name="name">Feuilles de temps à valider</field>
<field name="res_model">cgscop.timesheet.sheet</field>
<field name="view_mode">tree,form</field>
<field name="search_view_id" ref="view_cgscop_timesheet_sheet_filter" />
<field name="domain">[]</field>
<field name="context">{'search_default_submitted': 1}</field>
</record>
<record id="action_cgscop_timesheet_sheet_all" model="ir.actions.act_window">
<field name="name">Toutes les feuilles de temps</field>
<field name="res_model">cgscop.timesheet.sheet</field>
<field name="view_mode">tree,form</field>
<field name="search_view_id" ref="view_cgscop_timesheet_sheet_filter" />
<field name="domain">[('company_id', '=', allowed_company_ids[0])]</field>
<field name="context">{}</field>
</record>
<!--
Menus
-->
<menuitem
id="timesheet_sheet_menu"
parent="hr_timesheet.timesheet_menu_root"
name="Feuilles de temps"
sequence="25"
/>
<menuitem
id="menu_hr_timesheet_my_timesheet"
name="Mes feuilles de temps"
sequence="1"
action="cgscop_timesheet.action_cgscop_timesheet_sheet_my_all"
parent="cgscop_timesheet.timesheet_sheet_menu"
/>
<menuitem
id="menu_hr_timesheet_to_approve"
name="À valider"
sequence="1"
action="cgscop_timesheet.action_cgscop_timesheet_sheet_to_approve"
parent="cgscop_timesheet.timesheet_sheet_menu"
groups="hr_timesheet.group_timesheet_manager"
/>
<menuitem
id="menu_hr_timesheet_all"
name="Toutes les feuilles de temps"
sequence="1"
action="cgscop_timesheet.action_cgscop_timesheet_sheet_all"
parent="cgscop_timesheet.timesheet_sheet_menu"
groups="hr_timesheet.group_timesheet_manager"
/>
</data>
</odoo>
This diff is collapsed.
<?xml version="1.0" ?> <?xml version="1.0" ?>
<!-- Copyright 2019 Le Filament <!-- Copyright 2019 Le Filament
License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). --> License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). -->
<odoo> <odoo>
<data> <data>
...@@ -12,14 +11,27 @@ ...@@ -12,14 +11,27 @@
<field name="arch" type="xml"> <field name="arch" type="xml">
<form string="Project"> <form string="Project">
<sheet string="Project"> <sheet string="Project">
<div class="oe_button_box" name="button_box" groups="base.group_user"> <field name="active" invisible="1" />
<button class="oe_stat_button" name="%(hr_timesheet.act_hr_timesheet_line_by_project)d" type="action" icon="fa-calendar" string="Timesheets" attrs="{'invisible': [('allow_timesheets', '=', False)]}" groups="hr_timesheet.group_hr_timesheet_user"/> <widget
<button name="toggle_active" type="object" name="web_ribbon"
confirm="(Un)archiving a project automatically (un)archives its tasks. Do you want to proceed?" title="Archivé"
class="oe_stat_button" icon="fa-archive"> bg_color="bg-danger"
<field name="active" widget="boolean_button" attrs="{'invisible': [('active', '=', True)]}"
options='{"terminology": "archive"}'/> />
</button> <div
class="oe_button_box"
name="button_box"
groups="base.group_user"
>
<button
class="oe_stat_button"
name="%(hr_timesheet.act_hr_timesheet_line_by_project)d"
type="action"
icon="fa-calendar"
string="Timesheets"
attrs="{'invisible': [('allow_timesheets', '=', False)]}"
groups="hr_timesheet.group_hr_timesheet_user"
/>
</div> </div>
<div class="oe_title"> <div class="oe_title">
<h1> <h1>
...@@ -28,33 +40,73 @@ ...@@ -28,33 +40,73 @@
</div> </div>
<group> <group>
<group> <group>
<field name="partner_id" string="Contact par défaut" help="Contact par défaut auquel est rattaché cette activité. Ce contact sera sélectionné automatiquement dans les feuilles de temps" options="{'no_open': True, 'no_create': True}"/> <field
<field name="ur_id" string="Union Régionale" options="{'no_open': True, 'no_create': True}" required="1" /> name="partner_id"
<field name="company_id" groups="base.group_multi_company" options="{'no_open': True, 'no_create': True}" string="Société" invisible="1" /> string="Contact par défaut"
domain="[('is_company', '=', True), ('ur_id', '=', ur_id)]"
help="Contact par défaut auquel est rattaché cette activité. Ce contact sera sélectionné automatiquement dans les feuilles de temps"
options="{'no_open': True, 'no_create': True}"
/>
<field
name="ur_id"
string="Union Régionale"
options="{'no_open': True, 'no_create': True}"
required="1"
/>
<field
name="company_id"
groups="base.group_multi_company"
options="{'no_open': True, 'no_create': True}"
string="Société"
invisible="1"
/>
</group> </group>
<group> <group>
<field name="cgscop_timesheet_code_id" required="1" placeholder="Code activité National" options="{'no_open': True, 'no_create': True}"/> <field
name="cgscop_timesheet_code_id"
required="1"
placeholder="Code activité National"
options="{'no_open': True, 'no_create': True}"
/>
<field name="creation_invoiced" widget="boolean_toggle" />
<field name="analytic_account_id" invisible="1" />
<field name="privacy_visibility" invisible="1" /> <field name="privacy_visibility" invisible="1" />
<field name="allow_timesheets" invisible="1" /> <field name="allow_timesheets" invisible="1" />
</group> </group>
</group> </group>
<group string="Configuration" name="project_config" groups="base.group_no_one"> <group
string="Configuration"
name="project_config"
groups="base.group_no_one"
>
<group> <group>
<field name="user_id" string="Project Manager" <field
attrs="{'readonly':[('active','=',False)]}" options="{'no_open': True, 'no_create': True}"/> name="user_id"
string="Project Manager"
attrs="{'readonly':[('active','=',False)]}"
options="{'no_open': True, 'no_create': True}"
/>
<field name="sequence" groups="base.group_no_one" /> <field name="sequence" groups="base.group_no_one" />
</group> </group>
<group> <group>
<field name="allow_timesheets" /> <field name="allow_timesheets" />
<field name="privacy_visibility" widget="radio" /> <field name="privacy_visibility" widget="radio" />
<field name="resource_calendar_id" groups="base.group_no_one"/> <field
name="resource_calendar_id"
groups="base.group_no_one"
/>
</group> </group>
</group> </group>
</sheet> </sheet>
<div class="oe_chatter"> <div class="oe_chatter">
<field name="message_follower_ids" widget="mail_followers" help="Follow this project to automatically track the events associated to tasks and issues of this project." groups="base.group_user"/> <field
name="message_follower_ids"
options="{'post_refresh':True}"
groups="base.group_user"
/>
<field name="message_ids" />
</div> </div>
</form> </form>
</field> </field>
...@@ -67,13 +119,24 @@ ...@@ -67,13 +119,24 @@
<field name="arch" type="xml"> <field name="arch" type="xml">
<search string="Search Project"> <search string="Search Project">
<field name="name" string="Code activité UR" /> <field name="name" string="Code activité UR" />
<field name="cgscop_timesheet_code_id" string="Code activité National"/> <field
name="cgscop_timesheet_code_id"
string="Code activité National"
/>
<field name="partner_id" string="Contact par défaut" /> <field name="partner_id" string="Contact par défaut" />
<filter string="Archived" name="inactive" domain="[('active','=',False)]"/> <filter
string="Archived"
name="inactive"
domain="[('active','=',False)]"
/>
<group expand="0" string="Group By"> <group expand="0" string="Group By">
<filter string="Contact par défaut" name="Partner" context="{'group_by': 'partner_id'}"/> <filter
string="Contact par défaut"
name="Partner"
context="{'group_by': 'partner_id'}"
/>
</group> </group>
</search> </search>
</field> </field>
...@@ -88,8 +151,15 @@ ...@@ -88,8 +151,15 @@
<field name="sequence" widget="handle" /> <field name="sequence" widget="handle" />
<field name="active" invisible="1" /> <field name="active" invisible="1" />
<field name="name" /> <field name="name" />
<field name="cgscop_timesheet_code_id" options="{'no_open': True, 'no_create': True}"/> <field
<field name="partner_id" string="Contact" options="{'no_open': True, 'no_create': True}"/> name="cgscop_timesheet_code_id"
options="{'no_open': True, 'no_create': True}"
/>
<field
name="partner_id"
string="Contact"
options="{'no_open': True, 'no_create': True}"
/>
</tree> </tree>
</field> </field>
</record> </record>
...@@ -103,11 +173,19 @@ ...@@ -103,11 +173,19 @@
<field name="user_id" string="Project Manager" /> <field name="user_id" string="Project Manager" />
<templates> <templates>
<t t-name="kanban-box"> <t t-name="kanban-box">
<div t-attf-class="oe_kanban_content oe_kanban_global_click o_kanban_get_form"> <div
t-attf-class="oe_kanban_content oe_kanban_global_click o_kanban_get_form"
>
<div class="row"> <div class="row">
<div class="col-12"> <div class="col-12">
<strong><field name="name" string="Code activité UR"/></strong> <strong><field
<field name="cgscop_timesheet_code_id" string="Code activité CG"/> name="name"
string="Code activité UR"
/></strong>
<field
name="cgscop_timesheet_code_id"
string="Code activité CG"
/>
</div> </div>
</div> </div>
<div class="row"> <div class="row">
...@@ -116,7 +194,14 @@ ...@@ -116,7 +194,14 @@
</div> </div>
<div class="col-4"> <div class="col-4">
<div class="oe_kanban_bottom_right"> <div class="oe_kanban_bottom_right">
<img t-att-src="kanban_image('res.users', 'image_small', record.user_id.raw_value)" t-att-title="record.user_id.value" t-att-alt="record.user_id.value" width="24" height="24" class="oe_kanban_avatar float-right"/> <img
t-att-src="kanban_image('res.users', 'image_small', record.user_id.raw_value)"
t-att-title="record.user_id.value"
t-att-alt="record.user_id.value"
width="24"
height="24"
class="oe_kanban_avatar float-right"
/>
</div> </div>
</div> </div>
</div> </div>
...@@ -130,13 +215,15 @@ ...@@ -130,13 +215,15 @@
<record id="act_cgscop_project_timesheet" model="ir.actions.act_window"> <record id="act_cgscop_project_timesheet" model="ir.actions.act_window">
<field name="name">Codes activités UR</field> <field name="name">Codes activités UR</field>
<field name="res_model">project.project</field> <field name="res_model">project.project</field>
<field name="view_type">form</field>
<field name="domain">[]</field> <field name="domain">[]</field>
<field name="view_mode">tree,kanban,form</field> <field name="view_mode">tree,kanban,form</field>
<field name="view_ids" eval="[(5, 0, 0), <field
name="view_ids"
eval="[(5, 0, 0),
(0, 0, {'view_mode': 'tree', 'view_id': ref('view_cgscop_project_timesheet_tree')}), (0, 0, {'view_mode': 'tree', 'view_id': ref('view_cgscop_project_timesheet_tree')}),
(0, 0, {'view_mode': 'kanban', 'view_id': ref('view_cgscop_project_timesheet_kanban')}), (0, 0, {'view_mode': 'kanban', 'view_id': ref('view_cgscop_project_timesheet_kanban')}),
(0, 0, {'view_mode': 'form', 'view_id': ref('view_cgscop_project_timesheet_form')})]"/> (0, 0, {'view_mode': 'form', 'view_id': ref('view_cgscop_project_timesheet_form')})]"
/>
<field name="search_view_id" ref="view_cgscop_project_timesheet_filter" /> <field name="search_view_id" ref="view_cgscop_project_timesheet_filter" />
<field name="context">{ <field name="context">{
'default_privacy_visibility': 'employees', 'default_privacy_visibility': 'employees',
...@@ -150,7 +237,8 @@ ...@@ -150,7 +237,8 @@
action="act_cgscop_project_timesheet" action="act_cgscop_project_timesheet"
id="menu_action_project_lines_tree" id="menu_action_project_lines_tree"
sequence="35" sequence="35"
groups="cgscop_partner.group_ur_list_modif,cgscop_partner.group_cg_administrator"/> groups="cgscop_partner.group_ur_list_modif,cgscop_partner.group_cg_administrator"
/>
</data> </data>
</odoo> </odoo>
<?xml version="1.0" ?>
<!-- Copyright 2019 Le Filament
License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). -->
<odoo>
<data>
<record id="company_form_with_ur" model="ir.ui.view">
<field name="name">scop.res.company.timesheet.form</field>
<field name="model">res.company</field>
<field name="inherit_id" ref="base.view_company_form" />
<field name="arch" type="xml">
<xpath expr="//notebook/page" position="after">
<page name="company_timesheet" string="Feuilles de temps">
<group>
<group string="Condiguration Imputations">
<field name="day_working" widget="boolean_toggle" />
<field
name="day_duration"
attrs="{'invisible': [('day_working', '=', True)]}"
/>
<field name="overtime_working" widget="boolean_toggle" />
<field name="weekend_working" widget="boolean_toggle" />
<field name="use_travel_time" widget="boolean_toggle" />
</group>
</group>
</page>
</xpath>
</field>
</record>
</data>
</odoo>
<?xml version="1.0" ?> <?xml version="1.0" ?>
<!-- Copyright 2019 Le Filament <!-- Copyright 2019 Le Filament
License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). --> License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). -->
<odoo> <odoo>
<data> <data>
<!-- Tree View Timesheet CG --> <!-- Tree View Timesheet CG -->
<record id="view_cgscop_hr_timesheet_account_inherit" model="ir.ui.view"> <record id="view_partner_cooperative_timesheet_form" model="ir.ui.view">
<field name="name">res.partner.cgscop.timesheet.account.inherit</field> <field name="name">cooperative.timesheet.form</field>
<field name="model">res.partner</field> <field name="model">res.partner</field>
<field name="inherit_id" ref="account.view_partner_property_form"/> <field name="inherit_id" ref="cgscop_partner.scop_contact_view_form" />
<field name="priority" eval="1" />
<field name="arch" type="xml"> <field name="arch" type="xml">
<page name="accounting" position="attributes"> <xpath
<attribute name="invisible">True</attribute> expr="//field[@name='activity_federation_indus_ids']"
</page> position="after"
>
<separator />
<field name="ur_regional_convention_nb" invisible="1" />
<field name="ur_financial_system_nb" invisible="1" />
<field
name="ur_financial_system_id"
options="{'no_open': True, 'no_create': True}"
attrs="{'invisible':[('ur_financial_system_nb', '=', 0)]}"
/>
<field
name="ur_financial_system_date"
attrs="{'invisible':[('ur_financial_system_id','=',False)]}"
/>
<field
name="ur_regional_convention_id"
options="{'no_open': True, 'no_create': True}"
attrs="{'invisible':[('ur_regional_convention_nb', '=', 0)]}"
/>
<field
name="ur_regional_convention_date"
attrs="{'invisible':[('ur_regional_convention_id','=',False)]}"
/>
<separator />
</xpath>
</field> </field>
</record> </record>
......