diff --git a/sale_timesheet_custom_fields/__init__.py b/sale_timesheet_custom_fields/__init__.py new file mode 100644 index 0000000..0650744 --- /dev/null +++ b/sale_timesheet_custom_fields/__init__.py @@ -0,0 +1 @@ +from . import models diff --git a/sale_timesheet_custom_fields/__manifest__.py b/sale_timesheet_custom_fields/__manifest__.py new file mode 100644 index 0000000..be39abe --- /dev/null +++ b/sale_timesheet_custom_fields/__manifest__.py @@ -0,0 +1,19 @@ +# Copyright 2024 Onestein () +# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). + +{ + "name": "Timesheet Custom Fields", + "version": "16.0.1.0.0", + "summary": "Adds custom fields and related filters", + "author": "Onestein", + "license": "AGPL-3", + "website": "https://www.onestein.nl", + "category": "Human Resources", + "depends": [ + "sale_timesheet", + ], + "data": [ + "views/hr_timesheet_views.xml", + ], + "installable": True, +} diff --git a/sale_timesheet_custom_fields/i18n/nl.po b/sale_timesheet_custom_fields/i18n/nl.po new file mode 100644 index 0000000..f8f48bf --- /dev/null +++ b/sale_timesheet_custom_fields/i18n/nl.po @@ -0,0 +1,42 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * sale_timesheet_custom_fields +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 16.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2024-03-26 12:39+0000\n" +"PO-Revision-Date: 2024-03-26 12:39+0000\n" +"Last-Translator: \n" +"Language-Team: \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Plural-Forms: \n" + +#. module: sale_timesheet_custom_fields +#: model_terms:ir.ui.view,arch_db:sale_timesheet_custom_fields.hr_timesheet_line_search +msgid "Day" +msgstr "Dag" + +#. module: sale_timesheet_custom_fields +#: model_terms:ir.ui.view,arch_db:sale_timesheet_custom_fields.hr_timesheet_line_search +msgid "Group By" +msgstr "Groepeer op" + +#. module: sale_timesheet_custom_fields +#: model:ir.model.fields,field_description:sale_timesheet_custom_fields.field_account_analytic_line__project_user_id +#: model_terms:ir.ui.view,arch_db:sale_timesheet_custom_fields.hr_timesheet_line_search +msgid "Project Manager" +msgstr "Projectleider" + +#. module: sale_timesheet_custom_fields +#: model_terms:ir.ui.view,arch_db:sale_timesheet_custom_fields.hr_timesheet_line_search +msgid "Week" +msgstr "" + +#. module: sale_timesheet_custom_fields +#: model:ir.model.fields,field_description:sale_timesheet_custom_fields.field_account_analytic_line__week_number +msgid "Week Number" +msgstr "Weeknummer" diff --git a/sale_timesheet_custom_fields/models/__init__.py b/sale_timesheet_custom_fields/models/__init__.py new file mode 100644 index 0000000..82e300b --- /dev/null +++ b/sale_timesheet_custom_fields/models/__init__.py @@ -0,0 +1,3 @@ +# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). + +from . import account_analytic_line diff --git a/sale_timesheet_custom_fields/models/account_analytic_line.py b/sale_timesheet_custom_fields/models/account_analytic_line.py new file mode 100644 index 0000000..769fda0 --- /dev/null +++ b/sale_timesheet_custom_fields/models/account_analytic_line.py @@ -0,0 +1,19 @@ +# Copyright 2024 Onestein () +# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). + +from odoo import api, fields, models + + +class AccountAnalyticLine(models.Model): + _inherit = "account.analytic.line" + + @api.depends("date") + def _compute_week_number(self): + for line in self: + week_number = line.date.isocalendar() + line.week_number = "W%s %s" % (str(week_number[1]), (str(week_number[0]))) + + project_user_id = fields.Many2one( + "res.users", related="project_id.user_id", store=True + ) + week_number = fields.Char(compute="_compute_week_number", store=True) diff --git a/sale_timesheet_custom_fields/views/hr_timesheet_views.xml b/sale_timesheet_custom_fields/views/hr_timesheet_views.xml new file mode 100644 index 0000000..c261de2 --- /dev/null +++ b/sale_timesheet_custom_fields/views/hr_timesheet_views.xml @@ -0,0 +1,28 @@ + + + + account.analytic.line.tree + account.analytic.line + + + + + + + + + + account.analytic.line + + + + + + + + + + + + +