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
<?xml version="1.0" ?>
<!-- Copyright 2019 Le Filament
License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). -->
<odoo>
<data>
<record id="view_ur_month_timesheet_tree" model="ir.ui.view">
<field name="name">ur.month.timesheet.tree</field>
<field name="model">ur.month.timesheet</field>
<field name="arch" type="xml">
<tree editable='top'>
<field name="year" required="1" />
<field name="month" required="1" />
<field name="working_time" required="1" />
<field
name="ur_id"
options="{'no_open': True, 'no_create': True}"
readonly="1"
/>
<field
name="company_id"
groups="base.group_no_one"
options="{'no_open': True, 'no_create': True}"
/>
</tree>
</field>
</record>
<record id="action_ur_month_timesheet" model="ir.actions.act_window">
<field name="name">Temps de travail mensuel</field>
<field name="res_model">ur.month.timesheet</field>
<field name="view_mode">tree</field>
</record>
<record id="action_ur_month_timesheet_show" model="ir.actions.client">
<field name="name">Temps de travail théorique</field>
<field name="tag">cgscop_timesheet.ur_month_timesheet</field>
<field name="target">new</field>
<field name="binding_model_id" ref="model_ur_month_timesheet" />
<field name="binding_type">action</field>
</record>
<menuitem
id="menu_ur_month_timesheet"
name="Temps de travail mensuel"
parent="hr_timesheet.hr_timesheet_menu_configuration"
action="action_ur_month_timesheet"
sequence="50"
groups="cgscop_partner.group_ur_list_modif"
/>
<menuitem
id="menu_ur_month_timesheet_show"
parent="hr_timesheet.menu_hr_time_tracking"
action="action_ur_month_timesheet_show"
sequence="50"
/>
</data>
</odoo>
<?xml version="1.0"?>
<?xml version="1.0" ?>
<!-- Copyright 2019 Le Filament
License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). -->
<odoo>
<data>
<record id="view_ur_regional_convention_tree" model="ir.ui.view">
......@@ -10,8 +9,15 @@
<field name="arch" type="xml">
<tree editable='top'>
<field name="name" />
<field name="ur_id" options="{'no_open': True, 'no_create': True}"/>
<field name="company_id" groups="base.group_no_one" options="{'no_open': True, 'no_create': True}"/>
<field
name="ur_id"
options="{'no_open': True, 'no_create': True}"
/>
<field
name="company_id"
groups="base.group_no_one"
options="{'no_open': True, 'no_create': True}"
/>
</tree>
</field>
</record>
......@@ -22,12 +28,14 @@
<field name="view_mode">tree</field>
</record>
<menuitem id="menu_ur_regional_convention"
<menuitem
id="menu_ur_regional_convention"
name="Conventions Régionales"
parent="hr_timesheet.hr_timesheet_menu_configuration"
action="action_ur_regional_convention"
sequence="50"
groups="cgscop_partner.group_ur_list_modif"/>
groups="cgscop_partner.group_ur_list_modif"
/>
</data>
</odoo>
\ No newline at end of file
</odoo>
# © 2020 Le Filament (<https://www.le-filament.com>)
# © 2020 Confédération Générale des Scop (<https://www.les-scop.coop>)
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
from . import cgscop_timesheet_print_wizard
# © 2020 Le Filament (<https://www.le-filament.com>)
# © 2020 Confédération Générale des Scop (<https://www.les-scop.coop>)
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
from odoo import api, fields, models
class CgscopTimesheetPrintWizard(models.TransientModel):
_name = "cgscop_timesheet.print.wizard"
_description = "Wizard de sélection de l'impression"
@api.model
def _default_timesheet_id(self):
return self.env.context.get("active_id")
timesheet_id = fields.Many2one(
comodel_name="cgscop.timesheet.sheet",
string="Fdt",
default=_default_timesheet_id,
)
print_type = fields.Selection(
string="Type de sortie",
selection=[("0", "Tri par date"), ("1", "Tri par code activité")],
required=True,
default="0",
)
# ------------------------------------------------------
# Validation du wizard
# ------------------------------------------------------
def valid_wizard(self):
report_name = "cgscop_timesheet.cgscop_timesheet_sheet_report"
if self.print_type == "0":
report_name = "cgscop_timesheet.cgscop_timesheet_sheet_report"
elif self.print_type == "1":
report_name = "cgscop_timesheet.cgscop_timesheet_sheet_report_act"
return self.env.ref(report_name).report_action(self.timesheet_id)
<?xml version="1.0" encoding="UTF-8" ?>
<odoo>
<!-- WIZARD FORM -->
<record model="ir.ui.view" id="cgscop_timesheet_print_wizard">
<field name="name">cgscop_timesheet_print_wizard</field>
<field name="model">cgscop_timesheet.print.wizard</field>
<field name="arch" type="xml">
<form string="Sélection du format de sortie">
<group>
<field name="print_type" widget="radio" />
</group>
<footer>
<button
class="btn btn-sm btn-primary"
name="valid_wizard"
string="Impression"
type="object"
/>
<button
class="btn btn-sm btn-default"
special="cancel"
string="Retour"
/>
</footer>
</form>
</field>
</record>
<record model="ir.actions.act_window" id="cgscop_timesheet_print_act">
<field name="name">Sélection du format de sortie</field>
<field name="type">ir.actions.act_window</field>
<field name="res_model">cgscop_timesheet.print.wizard</field>
<field name="view_mode">form</field>
<field name="view_id" ref="cgscop_timesheet_print_wizard" />
<field name="target">new</field>
</record>
</odoo>