From 1c5af1287bc00e65ee813a253e4983d9edb86cbf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phan=20Sainl=C3=A9ger?= <54352366+stephansainleger@users.noreply.github.com> Date: Tue, 26 Jul 2022 18:30:37 +0200 Subject: [PATCH] [ADD] create ``project_timesheet_funding_wish`` add-on Add timesheet line fields: - ``funding_wish`` to inform about if the user expects a payment for the registered time. - ``treated`` to keep track if the timesheet line funding wish has been taken into account. Task: JOI-13 Signed-off-by: Valentin Lab --- project_timesheet_funding_wish/README.rst | 47 ++++++++++ project_timesheet_funding_wish/__init__.py | 1 + .../__manifest__.py | 88 +++++++++++++++++++ project_timesheet_funding_wish/i18n/README | 1 + project_timesheet_funding_wish/i18n/fr.po | 65 ++++++++++++++ .../models/__init__.py | 1 + .../models/hr_timesheet.py | 16 ++++ .../views/hr_timesheet.xml | 27 ++++++ 8 files changed, 246 insertions(+) create mode 100644 project_timesheet_funding_wish/README.rst create mode 100644 project_timesheet_funding_wish/__init__.py create mode 100644 project_timesheet_funding_wish/__manifest__.py create mode 100644 project_timesheet_funding_wish/i18n/README create mode 100644 project_timesheet_funding_wish/i18n/fr.po create mode 100644 project_timesheet_funding_wish/models/__init__.py create mode 100644 project_timesheet_funding_wish/models/hr_timesheet.py create mode 100644 project_timesheet_funding_wish/views/hr_timesheet.xml diff --git a/project_timesheet_funding_wish/README.rst b/project_timesheet_funding_wish/README.rst new file mode 100644 index 0000000..9a315fe --- /dev/null +++ b/project_timesheet_funding_wish/README.rst @@ -0,0 +1,47 @@ +============================== +project_timesheet_funding_wish +============================== + +Add a funding wish select field to timesheet line. + +Installation +============ + +Use Odoo normal procedure to install add-ons to install +``project_timesheet_funding_wish``. + +Known issues / Roadmap +====================== + +Bug Tracker +=========== + +Bugs are tracked on `our issues website `_. In +case of trouble, please check there if your issue has already been +reported. If you spotted it first, help us smashing it by providing a +detailed and welcomed feedback. + +Credits +======= + +Images +------ +* Elabore: `Icon `_. + +Contributors +------------ +* Stéphan Sainléger +* Valentin Lab +* Nicolas Jeudy + +Funders +------- +The development of this module has been financially supported by: +* Elabore (https://elabore.coop) + + +Maintainer +---------- +This module is maintained by Elabore. + + diff --git a/project_timesheet_funding_wish/__init__.py b/project_timesheet_funding_wish/__init__.py new file mode 100644 index 0000000..9a7e03e --- /dev/null +++ b/project_timesheet_funding_wish/__init__.py @@ -0,0 +1 @@ +from . import models \ No newline at end of file diff --git a/project_timesheet_funding_wish/__manifest__.py b/project_timesheet_funding_wish/__manifest__.py new file mode 100644 index 0000000..eb4058e --- /dev/null +++ b/project_timesheet_funding_wish/__manifest__.py @@ -0,0 +1,88 @@ +# Copyright 2022 Stéphan Sainléger (Elabore) +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). + +{ + "name": "project_timesheet_funding_wish", + "version": "14.0.1.0.0", + "author": "Elabore", + "website": "https://github.com/elabore-coop/project-tools", + "maintainer": "Stéphan Sainléger", + "license": "AGPL-3", + "category": "Tools", + "summary": "Add a funding wish select field to timesheet line.", + "description": """ + :image: https://img.shields.io/badge/licence-AGPL--3-blue.svg + :target: http://www.gnu.org/licenses/agpl-3.0-standalone.html + :alt: License: AGPL-3 +============================== +project_timesheet_funding_wish +============================== + +Add a funding wish select field to timesheet line. + +Installation +============ + +Use Odoo normal procedure to install add-ons to install +``project_timesheet_funding_wish``. + +Known issues / Roadmap +====================== + +Bug Tracker +=========== + +Bugs are tracked on `our issues website `_. In +case of trouble, please check there if your issue has already been +reported. If you spotted it first, help us smashing it by providing a +detailed and welcomed feedback. + +Credits +======= + +Images +------ +* Elabore: `Icon `_. + +Contributors +------------ +* Stéphan Sainléger +* Valentin Lab +* Nicolas Jeudy + +Funders +------- +The development of this module has been financially supported by: +* Elabore (https://elabore.coop) + + +Maintainer +---------- +This module is maintained by Elabore. + +""", + # any module necessary for this one to work correctly + "depends": [ + "base", + "hr_timesheet", + ], + "qweb": [ + # "static/src/xml/*.xml", + ], + "external_dependencies": { + "python": [], + }, + # always loaded + "data": [ + "views/hr_timesheet.xml", + ], + # only loaded in demonstration mode + "demo": [], + "js": [], + "css": [], + "installable": True, + # Install this module automatically if all dependency have been previously + # and independently installed. Used for synergetic or glue modules. + "auto_install": False, + "application": False, +} diff --git a/project_timesheet_funding_wish/i18n/README b/project_timesheet_funding_wish/i18n/README new file mode 100644 index 0000000..62197a1 --- /dev/null +++ b/project_timesheet_funding_wish/i18n/README @@ -0,0 +1 @@ +This directory should contain the *.po for Odoo translation. diff --git a/project_timesheet_funding_wish/i18n/fr.po b/project_timesheet_funding_wish/i18n/fr.po new file mode 100644 index 0000000..bb7d31a --- /dev/null +++ b/project_timesheet_funding_wish/i18n/fr.po @@ -0,0 +1,65 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * project_timesheet_funding_wish +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 14.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2022-07-25 17:02+0000\n" +"PO-Revision-Date: 2022-07-25 17:02+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: project_timesheet_funding_wish +#: model:ir.model,name:project_timesheet_funding_wish.model_account_analytic_line +msgid "Analytic Line" +msgstr "Ligne analytique" + +#. module: project_timesheet_funding_wish +#: model:ir.model.fields,field_description:project_timesheet_funding_wish.field_account_analytic_line__display_name +msgid "Display Name" +msgstr "Nom affiché" + +#. module: project_timesheet_funding_wish +#: model:ir.model.fields.selection,name:project_timesheet_funding_wish.selection__account_analytic_line__funding_wish__free +msgid "Free" +msgstr "Offert" + +#. module: project_timesheet_funding_wish +#: code:addons/project_timesheet_funding_wish/models/hr_timesheet.py:0 +#: model:ir.model.fields,field_description:project_timesheet_funding_wish.field_account_analytic_line__funding_wish +#, python-format +msgid "Funding wish" +msgstr "Type de financement" + +#. module: project_timesheet_funding_wish +#: model:ir.model.fields,field_description:project_timesheet_funding_wish.field_account_analytic_line__id +msgid "ID" +msgstr "" + +#. module: project_timesheet_funding_wish +#: model:ir.model.fields,field_description:project_timesheet_funding_wish.field_account_analytic_line____last_update +msgid "Last Modified on" +msgstr "Dernière modification le" + +#. module: project_timesheet_funding_wish +#: model:ir.model.fields.selection,name:project_timesheet_funding_wish.selection__account_analytic_line__funding_wish__accepted +msgid "Payment accepted" +msgstr "Paiement accepté" + +#. module: project_timesheet_funding_wish +#: model:ir.model.fields.selection,name:project_timesheet_funding_wish.selection__account_analytic_line__funding_wish__expected +msgid "Payment expected" +msgstr "Paiement attendu" + +#. module: project_timesheet_funding_wish +#: code:addons/project_timesheet_funding_wish/models/hr_timesheet.py:0 +#: model:ir.model.fields,field_description:project_timesheet_funding_wish.field_account_analytic_line__treated +#, python-format +msgid "Treated" +msgstr "Traité" diff --git a/project_timesheet_funding_wish/models/__init__.py b/project_timesheet_funding_wish/models/__init__.py new file mode 100644 index 0000000..e9efd25 --- /dev/null +++ b/project_timesheet_funding_wish/models/__init__.py @@ -0,0 +1 @@ +from . import hr_timesheet \ No newline at end of file diff --git a/project_timesheet_funding_wish/models/hr_timesheet.py b/project_timesheet_funding_wish/models/hr_timesheet.py new file mode 100644 index 0000000..1bede13 --- /dev/null +++ b/project_timesheet_funding_wish/models/hr_timesheet.py @@ -0,0 +1,16 @@ +from odoo import _, fields, models + + +class AccountAnalyticLine(models.Model): + _inherit = "account.analytic.line" + + funding_wish = fields.Selection( + [ + ("free", "Free"), + ("accepted", "Payment accepted"), + ("expected", "Payment expected"), + ], + string=_("Funding wish"), + copy=False, + ) + treated = fields.Boolean(string=_("Treated"), copy=False) diff --git a/project_timesheet_funding_wish/views/hr_timesheet.xml b/project_timesheet_funding_wish/views/hr_timesheet.xml new file mode 100644 index 0000000..d34ed0c --- /dev/null +++ b/project_timesheet_funding_wish/views/hr_timesheet.xml @@ -0,0 +1,27 @@ + + + + hr.timesheet.line.tree.funding.view + account.analytic.line + + + + + + + + + + + view.task.form2.inherited.funding + project.task + + + + + + + + + + \ No newline at end of file