diff --git a/hr_payroll_document/README.rst b/hr_payroll_document/README.rst new file mode 100644 index 00000000..86c136c1 --- /dev/null +++ b/hr_payroll_document/README.rst @@ -0,0 +1,88 @@ +===================== +HR - Payroll Document +===================== + +.. + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + !! This file is generated by oca-gen-addon-readme !! + !! changes will be overwritten. !! + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + !! source digest: sha256:3698f5f5e529d5d32ae80cdc1ab30660ad4e5d39b6d98f8dace97a0b233743c5 + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +.. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png + :target: https://odoo-community.org/page/development-status + :alt: Beta +.. |badge2| image:: https://img.shields.io/badge/licence-AGPL--3-blue.png + :target: http://www.gnu.org/licenses/agpl-3.0-standalone.html + :alt: License: AGPL-3 +.. |badge3| image:: https://img.shields.io/badge/github-OCA%2Fpayroll-lightgray.png?logo=github + :target: https://github.com/OCA/payroll/tree/17.0/hr_payroll_document + :alt: OCA/payroll +.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png + :target: https://translation.odoo-community.org/projects/payroll-17-0/payroll-17-0-hr_payroll_document + :alt: Translate me on Weblate +.. |badge5| image:: https://img.shields.io/badge/runboat-Try%20me-875A7B.png + :target: https://runboat.odoo-community.org/builds?repo=OCA/payroll&target_branch=17.0 + :alt: Try me on Runboat + +|badge1| |badge2| |badge3| |badge4| |badge5| + +This module have a wizard view to manage the different payrolls of +employees which is identified by the identification_id attribute. + +**Table of contents** + +.. contents:: + :local: + +Bug Tracker +=========== + +Bugs are tracked on `GitHub Issues `_. +In case of trouble, please check there if your issue has already been reported. +If you spotted it first, help us to smash it by providing a detailed and welcomed +`feedback `_. + +Do not contact contributors directly about support or help with technical issues. + +Credits +======= + +Authors +------- + +* APSL + +Contributors +------------ + +- `APSL-Nagarro `__: + + - Antoni Marroig + - Miquel Alzanillas + +Maintainers +----------- + +This module is maintained by the OCA. + +.. image:: https://odoo-community.org/logo.png + :alt: Odoo Community Association + :target: https://odoo-community.org + +OCA, or the Odoo Community Association, is a nonprofit organization whose +mission is to support the collaborative development of Odoo features and +promote its widespread use. + +.. |maintainer-peluko00| image:: https://github.com/peluko00.png?size=40px + :target: https://github.com/peluko00 + :alt: peluko00 + +Current `maintainer `__: + +|maintainer-peluko00| + +This module is part of the `OCA/payroll `_ project on GitHub. + +You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute. diff --git a/hr_payroll_document/__init__.py b/hr_payroll_document/__init__.py new file mode 100644 index 00000000..134df274 --- /dev/null +++ b/hr_payroll_document/__init__.py @@ -0,0 +1,2 @@ +from . import wizard +from . import models diff --git a/hr_payroll_document/__manifest__.py b/hr_payroll_document/__manifest__.py new file mode 100644 index 00000000..10be31f8 --- /dev/null +++ b/hr_payroll_document/__manifest__.py @@ -0,0 +1,18 @@ +{ + "name": "HR - Payroll Document", + "summary": "Manage payroll for each employee", + "author": "APSL, Odoo Community Association (OCA)", + "website": "https://github.com/OCA/payroll", + "license": "AGPL-3", + "category": "Payrolls", + "version": "17.0.1.0.0", + "depends": ["hr", "base_vat"], + "maintainers": ["peluko00"], + "external_dependencies": {"python": ["pypdf"]}, + "data": [ + "wizard/payroll_management_wizard.xml", + "security/ir.model.access.csv", + "data/email_payroll_employee.xml", + "views/hr_employee_views.xml", + ], +} diff --git a/hr_payroll_document/data/email_payroll_employee.xml b/hr_payroll_document/data/email_payroll_employee.xml new file mode 100644 index 00000000..d3cb24cb --- /dev/null +++ b/hr_payroll_document/data/email_payroll_employee.xml @@ -0,0 +1,20 @@ + + + + Payroll Employee + + {{object.company_id.email}} + {{object.work_email}} + Payroll {{ctx.get('subject')}} + + + + + +
{{object.company_id.name}}

Payroll

Hello ,


We send you the payroll with the subject .



+

+ + ]]> +
+
+
diff --git a/hr_payroll_document/i18n/ca_ES.po b/hr_payroll_document/i18n/ca_ES.po new file mode 100644 index 00000000..bc51c52a --- /dev/null +++ b/hr_payroll_document/i18n/ca_ES.po @@ -0,0 +1,281 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * hr_payroll_document +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 16.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2023-12-14 10:27+0000\n" +"PO-Revision-Date: 2023-12-14 10:27+0000\n" +"Last-Translator: \n" +"Language-Team: \n" +"Language: \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Plural-Forms: \n" + +#. module: hr_payroll_document +#: model:mail.template,body_html:hr_payroll_document.payroll_employee_email_template +msgid "" +"\n" +" \n" +" \n" +" \n" +" \n" +"

\n" +" \n" +" \n" +" " + +#. module: hr_payroll_document +#: model:ir.model,name:hr_payroll_document.model_ir_attachment +#: model:ir.model.fields,field_description:hr_payroll_document.field_ir_attachment__payrol_rel +msgid "Attachment" +msgstr "Adjunt" + +#. module: hr_payroll_document +#: model:ir.model.fields,field_description:hr_payroll_document.field_ir_attachment_payroll_custom__attachment_id +msgid "Attachment File" +msgstr "Fitxer Adjunt" + +#. module: hr_payroll_document +#: model_terms:ir.ui.view,arch_db:hr_payroll_document.payrolls_management_wizard_form +msgid "Close" +msgstr "Tancar" + +#. module: hr_payroll_document +#: model:ir.model.fields,field_description:hr_payroll_document.field_ir_attachment_payroll_custom__create_date +msgid "Create Date" +msgstr "Data de creació" + +#. module: hr_payroll_document +#: model:ir.model.fields,field_description:hr_payroll_document.field_ir_attachment_payroll_custom__create_uid +#: model:ir.model.fields,field_description:hr_payroll_document.field_payroll_management_wizard__create_uid +msgid "Created by" +msgstr "Creat per" + +#. module: hr_payroll_document +#: model:ir.model.fields,field_description:hr_payroll_document.field_payroll_management_wizard__create_date +msgid "Created on" +msgstr "Creat el" + +#. module: hr_payroll_document +#: model:ir.model.fields,field_description:hr_payroll_document.field_ir_attachment_payroll_custom__display_name +#: model:ir.model.fields,field_description:hr_payroll_document.field_payroll_management_wizard__display_name +msgid "Display Name" +msgstr "Nom a mostrar" + +#. module: hr_payroll_document +#: model:ir.model,name:hr_payroll_document.model_hr_employee +#: model:ir.model.fields,field_description:hr_payroll_document.field_ir_attachment_payroll_custom__employee +msgid "Employee" +msgstr "Empleat" + +#. module: hr_payroll_document +#. odoo-python +#: code:addons/hr_payroll_document/tests/test_hr_payroll_document.py:0 +#: code:addons/hr_payroll_document/wizard/payroll_management_wizard.py:0 +#, python-format +msgid "Employees not found" +msgstr "Empleats no trobats" + +#. module: hr_payroll_document +#: model:ir.model.fields,help:hr_payroll_document.field_payroll_management_wizard__subject +msgid "Enter the title of the payroll whether it is the month, week, day, etc." +msgstr "Introduïu el títol de la nòmina ja sigui el mes, setmana, dia, etc." + +#. module: hr_payroll_document +#: model:ir.model.fields,field_description:hr_payroll_document.field_ir_attachment_payroll_custom__id +#: model:ir.model.fields,field_description:hr_payroll_document.field_payroll_management_wizard__id +msgid "ID" +msgstr "" + +#. module: hr_payroll_document +#. odoo-python +#: code:addons/hr_payroll_document/tests/test_hr_payroll_document.py:0 +#: code:addons/hr_payroll_document/wizard/payroll_management_wizard.py:0 +#, python-format +msgid "IDs whose employee has not been found: " +msgstr "IDs dels empleats que no s'han trobat: " + +#. module: hr_payroll_document +#: model:ir.model.fields,field_description:hr_payroll_document.field_ir_attachment_payroll_custom__identification_id +msgid "Identification ID" +msgstr "Identificació ID" + +#. module: hr_payroll_document +#: model:ir.model.fields,field_description:hr_payroll_document.field_ir_attachment_payroll_custom____last_update +#: model:ir.model.fields,field_description:hr_payroll_document.field_payroll_management_wizard____last_update +msgid "Last Modified on" +msgstr "Darrera modificació el" + +#. module: hr_payroll_document +#: model:ir.model.fields,field_description:hr_payroll_document.field_ir_attachment_payroll_custom__write_uid +#: model:ir.model.fields,field_description:hr_payroll_document.field_payroll_management_wizard__write_uid +msgid "Last Updated by" +msgstr "Darrera actualització per" + +#. module: hr_payroll_document +#: model:ir.model.fields,field_description:hr_payroll_document.field_ir_attachment_payroll_custom__write_date +#: model:ir.model.fields,field_description:hr_payroll_document.field_payroll_management_wizard__write_date +msgid "Last Updated on" +msgstr "Darrera actualització el" + +#. module: hr_payroll_document +#. odoo-python +#: code:addons/hr_payroll_document/wizard/payroll_management_wizard.py:0 +#, python-format +msgid "Missing pdf file signature" +msgstr "Els fitxers han de ser de tipus pdf" + +#. module: hr_payroll_document +#. odoo-python +#: code:addons/hr_payroll_document/wizard/payroll_management_wizard.py:0 +#, python-format +msgid "Payroll" +msgstr "Nòmina" + +#. module: hr_payroll_document +#. odoo-python +#: code:addons/hr_payroll_document/wizard/payroll_management_wizard.py:0 +#, python-format +msgid "Payroll " +msgstr "Nòmina " + +#. module: hr_payroll_document +#: model:mail.template,name:hr_payroll_document.payroll_employee_email_template +msgid "Payroll Employee" +msgstr "Nòmina Empleat" + +#. module: hr_payroll_document +#: model:ir.model,name:hr_payroll_document.model_payroll_management_wizard +msgid "Payroll Management" +msgstr "Gestió Nòmines" + +#. module: hr_payroll_document +#: model:ir.model,name:hr_payroll_document.model_ir_attachment_payroll_custom +msgid "Payroll attachment" +msgstr "Adjunt Nòmina" + +#. module: hr_payroll_document +#: model:mail.template,subject:hr_payroll_document.payroll_employee_email_template +msgid "Payroll {{ctx.get('subject')}}" +msgstr "Nòmina {{ctx.get('month')}}" + +#. module: hr_payroll_document +#: model:ir.model.fields,field_description:hr_payroll_document.field_payroll_management_wizard__payrolls +msgid "Payrolls" +msgstr "Nòmines" + +#. module: hr_payroll_document +#: model:ir.actions.act_window,name:hr_payroll_document.payrolls_management_wizard_action +#: model:ir.ui.menu,name:hr_payroll_document.payrolls_management_wizard_menu_action +msgid "Payrolls Management" +msgstr "Gestió Nòmines" + +#. module: hr_payroll_document +#. odoo-python +#: code:addons/hr_payroll_document/tests/test_hr_payroll_document.py:0 +#: code:addons/hr_payroll_document/wizard/payroll_management_wizard.py:0 +#, python-format +msgid "Payrolls sent" +msgstr "Nòmines enviades" + +#. module: hr_payroll_document +#. odoo-python +#: code:addons/hr_payroll_document/tests/test_hr_payroll_document.py:0 +#: code:addons/hr_payroll_document/wizard/payroll_management_wizard.py:0 +#, python-format +msgid "Payrolls sent to employees correctly" +msgstr "Nòmines envides als empleats correctament" + +#. module: hr_payroll_document +#: model_terms:ir.ui.view,arch_db:hr_payroll_document.payrolls_management_wizard_form +msgid "Send" +msgstr "Enviar" + +#. module: hr_payroll_document +#: model:ir.model.fields,field_description:hr_payroll_document.field_ir_attachment_payroll_custom__subject +#: model:ir.model.fields,field_description:hr_payroll_document.field_payroll_management_wizard__subject +msgid "Subject" +msgstr "Assumpte" + +#. module: hr_payroll_document +#. odoo-python +#: code:addons/hr_payroll_document/models/hr_employee.py:0 +#, python-format +msgid "The field identification ID is not valid" +msgstr "El camp identificatiu ID no és vàlid" + +#. module: hr_payroll_document +#. odoo-python +#: code:addons/hr_payroll_document/wizard/payroll_management_wizard.py:0 +#, python-format +msgid "You must to filled country field of company" +msgstr "Falta emplenar el camp de país de l'empresa" diff --git a/hr_payroll_document/i18n/es.po b/hr_payroll_document/i18n/es.po new file mode 100644 index 00000000..7820196c --- /dev/null +++ b/hr_payroll_document/i18n/es.po @@ -0,0 +1,258 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * hr_payroll_document +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 17.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2024-05-21 15:13+0000\n" +"PO-Revision-Date: 2024-05-21 15:13+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: hr_payroll_document +#: model:mail.template,body_html:hr_payroll_document.payroll_employee_email_template +msgid "" +"\n" +" \n" +" \n" +" \n" +"
\"{{object.company_id.name}}\"

Payroll

Hello ,

We send you the payroll with the subject .



\"{{object.company_id.name}}\"

Nòmina

Hola ,


Et remetem " +"la teva nòmina del mes de .



\"{{object.company_id.name}}\"

Payroll

Hello ,


We send you the payroll with the subject .



\n" +"

\n" +" \n" +" \n" +" " +msgstr "" +"\n" +" \n" +" \n" +" \n" +"
\"{{object.company_id.name}}\"

Nómina

Hola ,


Te enviamos la nómina con el asunto .



\n" +"

\n" +" \n" +" \n" +" " + +#. module: hr_payroll_document +#: model:ir.model,name:hr_payroll_document.model_ir_attachment +#: model:ir.model.fields,field_description:hr_payroll_document.field_ir_attachment__payrol_rel +#: model:ir.model.fields,field_description:hr_payroll_document.field_product_document__payrol_rel +msgid "Attachment" +msgstr "Archivo adjunto" + +#. module: hr_payroll_document +#: model:ir.model.fields,field_description:hr_payroll_document.field_ir_attachment_payroll_custom__attachment_id +msgid "Attachment File" +msgstr "Fichero Adjunto" + +#. module: hr_payroll_document +#: model_terms:ir.ui.view,arch_db:hr_payroll_document.payrolls_management_wizard_form +msgid "Close" +msgstr "Cerrar" + +#. module: hr_payroll_document +#: model:ir.model.fields,field_description:hr_payroll_document.field_ir_attachment_payroll_custom__create_date +msgid "Create Date" +msgstr "Fecha de creación" + +#. module: hr_payroll_document +#: model:ir.model.fields,field_description:hr_payroll_document.field_ir_attachment_payroll_custom__create_uid +#: model:ir.model.fields,field_description:hr_payroll_document.field_payroll_management_wizard__create_uid +msgid "Created by" +msgstr "Creado por" + +#. module: hr_payroll_document +#: model:ir.model.fields,field_description:hr_payroll_document.field_payroll_management_wizard__create_date +msgid "Created on" +msgstr "Creado el" + +#. module: hr_payroll_document +#: model:ir.model.fields,field_description:hr_payroll_document.field_ir_attachment_payroll_custom__display_name +#: model:ir.model.fields,field_description:hr_payroll_document.field_payroll_management_wizard__display_name +msgid "Display Name" +msgstr "Nombre para mostrar" + +#. module: hr_payroll_document +#: model:ir.model.fields,field_description:hr_payroll_document.field_ir_attachment__document_type +#: model:ir.model.fields,field_description:hr_payroll_document.field_product_document__document_type +msgid "Document Type" +msgstr "Tipo de documento" + +#. module: hr_payroll_document +#: model_terms:ir.ui.view,arch_db:hr_payroll_document.view_payroll_tree +msgid "Download" +msgstr "Descargar" + +#. module: hr_payroll_document +#: model:ir.model,name:hr_payroll_document.model_hr_employee +#: model:ir.model.fields,field_description:hr_payroll_document.field_ir_attachment_payroll_custom__employee +#: model_terms:ir.ui.view,arch_db:hr_payroll_document.view_payroll_filter +msgid "Employee" +msgstr "Empleado" + +#. module: hr_payroll_document +#. odoo-python +#: code:addons/hr_payroll_document/tests/test_hr_payroll_document.py:0 +#: code:addons/hr_payroll_document/wizard/payroll_management_wizard.py:0 +#, python-format +msgid "Employees not found" +msgstr "Empleados no encontrados" + +#. module: hr_payroll_document +#: model:ir.model.fields,help:hr_payroll_document.field_payroll_management_wizard__subject +msgid "" +"Enter the title of the payroll whether it is the month, week, day, etc." +msgstr "Introduzca el título de la nómina ya sea el mes, semana, día , etc.." + +#. module: hr_payroll_document +#: model_terms:ir.ui.view,arch_db:hr_payroll_document.view_payroll_filter +msgid "Group By" +msgstr "" + +#. module: hr_payroll_document +#: model:ir.model.fields,field_description:hr_payroll_document.field_ir_attachment_payroll_custom__id +#: model:ir.model.fields,field_description:hr_payroll_document.field_payroll_management_wizard__id +msgid "ID" +msgstr "" + +#. module: hr_payroll_document +#. odoo-python +#: code:addons/hr_payroll_document/tests/test_hr_payroll_document.py:0 +#: code:addons/hr_payroll_document/wizard/payroll_management_wizard.py:0 +#, python-format +msgid "IDs whose employee has not been found: " +msgstr "IDs de los empleados que no se han encontrado: " + +#. module: hr_payroll_document +#: model:ir.model.fields,field_description:hr_payroll_document.field_ir_attachment_payroll_custom__identification_id +#: model_terms:ir.ui.view,arch_db:hr_payroll_document.view_payroll_filter +msgid "Identification ID" +msgstr "Identificación ID" + +#. module: hr_payroll_document +#: model:ir.model.fields,field_description:hr_payroll_document.field_ir_attachment_payroll_custom__write_uid +#: model:ir.model.fields,field_description:hr_payroll_document.field_payroll_management_wizard__write_uid +msgid "Last Updated by" +msgstr "Última actualización por" + +#. module: hr_payroll_document +#: model:ir.model.fields,field_description:hr_payroll_document.field_ir_attachment_payroll_custom__write_date +#: model:ir.model.fields,field_description:hr_payroll_document.field_payroll_management_wizard__write_date +msgid "Last Updated on" +msgstr "Última actualización el" + +#. module: hr_payroll_document +#. odoo-python +#: code:addons/hr_payroll_document/wizard/payroll_management_wizard.py:0 +#, python-format +msgid "Missing pdf file signature" +msgstr "Los archivos tienen que ser de tipo pdf" + +#. module: hr_payroll_document +#. odoo-python +#: code:addons/hr_payroll_document/wizard/payroll_management_wizard.py:0 +#: model:ir.model.fields.selection,name:hr_payroll_document.selection__ir_attachment__document_type__payroll +#, python-format +msgid "Payroll" +msgstr "Nómina" + +#. module: hr_payroll_document +#. odoo-python +#: code:addons/hr_payroll_document/wizard/payroll_management_wizard.py:0 +#, python-format +msgid "Payroll " +msgstr "Nómina " + +#. module: hr_payroll_document +#: model:ir.model.fields,field_description:hr_payroll_document.field_hr_employee__payroll_count +msgid "Payroll Count" +msgstr "Recuento de Nóminas" + +#. module: hr_payroll_document +#: model:mail.template,name:hr_payroll_document.payroll_employee_email_template +msgid "Payroll Employee" +msgstr "Nómina Empleado" + +#. module: hr_payroll_document +#: model:ir.model,name:hr_payroll_document.model_payroll_management_wizard +msgid "Payroll Management" +msgstr "Gestión Nóminas" + +#. module: hr_payroll_document +#: model:ir.model,name:hr_payroll_document.model_ir_attachment_payroll_custom +msgid "Payroll attachment" +msgstr "Adjunto Nómina" + +#. module: hr_payroll_document +#: model:mail.template,subject:hr_payroll_document.payroll_employee_email_template +msgid "Payroll {{ctx.get('subject')}}" +msgstr "Nómina {{ctx.get('subject')}}" + +#. module: hr_payroll_document +#: model:ir.actions.act_window,name:hr_payroll_document.payrolls_view_action +#: model:ir.model.fields,field_description:hr_payroll_document.field_payroll_management_wizard__payrolls +#: model:ir.ui.menu,name:hr_payroll_document.payrolls_menu_action +#: model_terms:ir.ui.view,arch_db:hr_payroll_document.hr_employee_view_tree_payroll +#: model_terms:ir.ui.view,arch_db:hr_payroll_document.res_users_view_form_profile_inherit +#: model_terms:ir.ui.view,arch_db:hr_payroll_document.view_payroll_filter +#: model_terms:ir.ui.view,arch_db:hr_payroll_document.view_payroll_tree +msgid "Payrolls" +msgstr "Nóminas" + +#. module: hr_payroll_document +#: model:ir.actions.act_window,name:hr_payroll_document.payrolls_management_wizard_action +#: model:ir.ui.menu,name:hr_payroll_document.payrolls_management_wizard_menu_action +msgid "Payrolls Management" +msgstr "Gestión Nóminas" + +#. module: hr_payroll_document +#. odoo-python +#: code:addons/hr_payroll_document/tests/test_hr_payroll_document.py:0 +#: code:addons/hr_payroll_document/wizard/payroll_management_wizard.py:0 +#, python-format +msgid "Payrolls sent" +msgstr "Nóminas enviadas" + +#. module: hr_payroll_document +#. odoo-python +#: code:addons/hr_payroll_document/tests/test_hr_payroll_document.py:0 +#: code:addons/hr_payroll_document/wizard/payroll_management_wizard.py:0 +#, python-format +msgid "Payrolls sent to employees correctly" +msgstr "Nóminas enviadas a los empleados correctamente" + +#. module: hr_payroll_document +#: model_terms:ir.ui.view,arch_db:hr_payroll_document.payrolls_management_wizard_form +msgid "Send" +msgstr "Enviar" + +#. module: hr_payroll_document +#: model:ir.model.fields,field_description:hr_payroll_document.field_ir_attachment_payroll_custom__subject +#: model:ir.model.fields,field_description:hr_payroll_document.field_payroll_management_wizard__subject +#: model_terms:ir.ui.view,arch_db:hr_payroll_document.view_payroll_filter +msgid "Subject" +msgstr "Asunto" + +#. module: hr_payroll_document +#. odoo-python +#: code:addons/hr_payroll_document/models/hr_employee.py:0 +#, python-format +msgid "The field identification ID is not valid" +msgstr "El campo identificativo ID no es válido" + +#. module: hr_payroll_document +#: model:ir.model,name:hr_payroll_document.model_res_users +msgid "User" +msgstr "Usuario" + +#. module: hr_payroll_document +#. odoo-python +#: code:addons/hr_payroll_document/wizard/payroll_management_wizard.py:0 +#, python-format +msgid "You must to filled country field of company" +msgstr "Falta rellenar el campo del país de la empresa" diff --git a/hr_payroll_document/i18n/hr_payroll_document.pot b/hr_payroll_document/i18n/hr_payroll_document.pot new file mode 100644 index 00000000..26374500 --- /dev/null +++ b/hr_payroll_document/i18n/hr_payroll_document.pot @@ -0,0 +1,220 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * hr_payroll_document +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 16.0\n" +"Report-Msgid-Bugs-To: \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: hr_payroll_document +#: model:mail.template,body_html:hr_payroll_document.payroll_employee_email_template +msgid "" +"\n" +" \n" +" \n" +" \n" +"
\"{{object.company_id.name}}\"

Payroll

Hello ,


We send you the payroll with the subject .



\n" +"

\n" +" \n" +" \n" +" " +msgstr "" + +#. module: hr_payroll_document +#: model:ir.model,name:hr_payroll_document.model_ir_attachment +#: model:ir.model.fields,field_description:hr_payroll_document.field_ir_attachment__payrol_rel +msgid "Attachment" +msgstr "" + +#. module: hr_payroll_document +#: model:ir.model.fields,field_description:hr_payroll_document.field_ir_attachment_payroll_custom__attachment_id +msgid "Attachment File" +msgstr "" + +#. module: hr_payroll_document +#: model_terms:ir.ui.view,arch_db:hr_payroll_document.payrolls_management_wizard_form +msgid "Close" +msgstr "" + +#. module: hr_payroll_document +#: model:ir.model.fields,field_description:hr_payroll_document.field_ir_attachment_payroll_custom__create_date +msgid "Create Date" +msgstr "" + +#. module: hr_payroll_document +#: model:ir.model.fields,field_description:hr_payroll_document.field_ir_attachment_payroll_custom__create_uid +#: model:ir.model.fields,field_description:hr_payroll_document.field_payroll_management_wizard__create_uid +msgid "Created by" +msgstr "" + +#. module: hr_payroll_document +#: model:ir.model.fields,field_description:hr_payroll_document.field_payroll_management_wizard__create_date +msgid "Created on" +msgstr "" + +#. module: hr_payroll_document +#: model:ir.model.fields,field_description:hr_payroll_document.field_ir_attachment_payroll_custom__display_name +#: model:ir.model.fields,field_description:hr_payroll_document.field_payroll_management_wizard__display_name +msgid "Display Name" +msgstr "" + +#. module: hr_payroll_document +#: model:ir.model,name:hr_payroll_document.model_hr_employee +#: model:ir.model.fields,field_description:hr_payroll_document.field_ir_attachment_payroll_custom__employee +msgid "Employee" +msgstr "" + +#. module: hr_payroll_document +#. odoo-python +#: code:addons/hr_payroll_document/tests/test_hr_payroll_document.py:0 +#: code:addons/hr_payroll_document/wizard/payroll_management_wizard.py:0 +#, python-format +msgid "Employees not found" +msgstr "" + +#. module: hr_payroll_document +#: model:ir.model.fields,help:hr_payroll_document.field_payroll_management_wizard__subject +msgid "" +"Enter the title of the payroll whether it is the month, week, day, etc." +msgstr "" + +#. module: hr_payroll_document +#: model:ir.model.fields,field_description:hr_payroll_document.field_ir_attachment_payroll_custom__id +#: model:ir.model.fields,field_description:hr_payroll_document.field_payroll_management_wizard__id +msgid "ID" +msgstr "" + +#. module: hr_payroll_document +#. odoo-python +#: code:addons/hr_payroll_document/tests/test_hr_payroll_document.py:0 +#: code:addons/hr_payroll_document/wizard/payroll_management_wizard.py:0 +#, python-format +msgid "IDs whose employee has not been found: " +msgstr "" + +#. module: hr_payroll_document +#: model:ir.model.fields,field_description:hr_payroll_document.field_ir_attachment_payroll_custom__identification_id +msgid "Identification ID" +msgstr "" + +#. module: hr_payroll_document +#: model:ir.model.fields,field_description:hr_payroll_document.field_ir_attachment_payroll_custom____last_update +#: model:ir.model.fields,field_description:hr_payroll_document.field_payroll_management_wizard____last_update +msgid "Last Modified on" +msgstr "" + +#. module: hr_payroll_document +#: model:ir.model.fields,field_description:hr_payroll_document.field_ir_attachment_payroll_custom__write_uid +#: model:ir.model.fields,field_description:hr_payroll_document.field_payroll_management_wizard__write_uid +msgid "Last Updated by" +msgstr "" + +#. module: hr_payroll_document +#: model:ir.model.fields,field_description:hr_payroll_document.field_ir_attachment_payroll_custom__write_date +#: model:ir.model.fields,field_description:hr_payroll_document.field_payroll_management_wizard__write_date +msgid "Last Updated on" +msgstr "" + +#. module: hr_payroll_document +#. odoo-python +#: code:addons/hr_payroll_document/wizard/payroll_management_wizard.py:0 +#, python-format +msgid "Missing pdf file signature" +msgstr "" + +#. module: hr_payroll_document +#. odoo-python +#: code:addons/hr_payroll_document/wizard/payroll_management_wizard.py:0 +#, python-format +msgid "Payroll" +msgstr "" + +#. module: hr_payroll_document +#. odoo-python +#: code:addons/hr_payroll_document/wizard/payroll_management_wizard.py:0 +#, python-format +msgid "Payroll " +msgstr "" + +#. module: hr_payroll_document +#: model:mail.template,name:hr_payroll_document.payroll_employee_email_template +msgid "Payroll Employee" +msgstr "" + +#. module: hr_payroll_document +#: model:ir.model,name:hr_payroll_document.model_payroll_management_wizard +msgid "Payroll Management" +msgstr "" + +#. module: hr_payroll_document +#: model:ir.model,name:hr_payroll_document.model_ir_attachment_payroll_custom +msgid "Payroll attachment" +msgstr "" + +#. module: hr_payroll_document +#: model:mail.template,subject:hr_payroll_document.payroll_employee_email_template +msgid "Payroll {{ctx.get('subject')}}" +msgstr "" + +#. module: hr_payroll_document +#: model:ir.model.fields,field_description:hr_payroll_document.field_payroll_management_wizard__payrolls +msgid "Payrolls" +msgstr "" + +#. module: hr_payroll_document +#: model:ir.actions.act_window,name:hr_payroll_document.payrolls_management_wizard_action +#: model:ir.ui.menu,name:hr_payroll_document.payrolls_management_wizard_menu_action +msgid "Payrolls Management" +msgstr "" + +#. module: hr_payroll_document +#. odoo-python +#: code:addons/hr_payroll_document/tests/test_hr_payroll_document.py:0 +#: code:addons/hr_payroll_document/tests/test_hr_payroll_document.py:0 +#: code:addons/hr_payroll_document/tests/test_hr_payroll_document.py:0 +#: code:addons/hr_payroll_document/wizard/payroll_management_wizard.py:0 +#: code:addons/hr_payroll_document/wizard/payroll_management_wizard.py:0 +#: code:addons/hr_payroll_document/wizard/payroll_management_wizard.py:0 +#, python-format +msgid "Payrolls sent" +msgstr "" + +#. module: hr_payroll_document +#. odoo-python +#: code:addons/hr_payroll_document/tests/test_hr_payroll_document.py:0 +#: code:addons/hr_payroll_document/wizard/payroll_management_wizard.py:0 +#, python-format +msgid "Payrolls sent to employees correctly" +msgstr "" + +#. module: hr_payroll_document +#: model_terms:ir.ui.view,arch_db:hr_payroll_document.payrolls_management_wizard_form +msgid "Send" +msgstr "" + +#. module: hr_payroll_document +#: model:ir.model.fields,field_description:hr_payroll_document.field_ir_attachment_payroll_custom__subject +#: model:ir.model.fields,field_description:hr_payroll_document.field_payroll_management_wizard__subject +msgid "Subject" +msgstr "" + +#. module: hr_payroll_document +#. odoo-python +#: code:addons/hr_payroll_document/models/hr_employee.py:0 +#, python-format +msgid "The field identification ID is not valid" +msgstr "" + +#. module: hr_payroll_document +#. odoo-python +#: code:addons/hr_payroll_document/wizard/payroll_management_wizard.py:0 +#, python-format +msgid "You must to filled country field of company" +msgstr "" diff --git a/hr_payroll_document/i18n/it.po b/hr_payroll_document/i18n/it.po new file mode 100644 index 00000000..aee0a92d --- /dev/null +++ b/hr_payroll_document/i18n/it.po @@ -0,0 +1,260 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * hr_payroll_document +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 16.0\n" +"Report-Msgid-Bugs-To: \n" +"PO-Revision-Date: 2024-03-04 15:34+0000\n" +"Last-Translator: mymage \n" +"Language-Team: none\n" +"Language: it\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Plural-Forms: nplurals=2; plural=n != 1;\n" +"X-Generator: Weblate 4.17\n" + +#. module: hr_payroll_document +#: model:mail.template,body_html:hr_payroll_document.payroll_employee_email_template +msgid "" +"\n" +" \n" +" \n" +" \n" +"
\"{{object.company_id.name}}\"

Payroll

Hello ,


We send you the payroll with the subject .



\n" +"

\n" +" \n" +" \n" +" " +msgstr "" +"\n" +" \n" +" \n" +" \n" +"
\""

Stipendio

Hello ,


Abbiamo inviato la " +"retribuzione con soggetto.



" +"
\n" +"

\n" +" \n" +" \n" +" " + +#. module: hr_payroll_document +#: model:ir.model,name:hr_payroll_document.model_ir_attachment +#: model:ir.model.fields,field_description:hr_payroll_document.field_ir_attachment__payrol_rel +msgid "Attachment" +msgstr "Allegato" + +#. module: hr_payroll_document +#: model:ir.model.fields,field_description:hr_payroll_document.field_ir_attachment_payroll_custom__attachment_id +msgid "Attachment File" +msgstr "File allegato" + +#. module: hr_payroll_document +#: model_terms:ir.ui.view,arch_db:hr_payroll_document.payrolls_management_wizard_form +msgid "Close" +msgstr "Chiudi" + +#. module: hr_payroll_document +#: model:ir.model.fields,field_description:hr_payroll_document.field_ir_attachment_payroll_custom__create_date +msgid "Create Date" +msgstr "Data creazione" + +#. module: hr_payroll_document +#: model:ir.model.fields,field_description:hr_payroll_document.field_ir_attachment_payroll_custom__create_uid +#: model:ir.model.fields,field_description:hr_payroll_document.field_payroll_management_wizard__create_uid +msgid "Created by" +msgstr "Creato da" + +#. module: hr_payroll_document +#: model:ir.model.fields,field_description:hr_payroll_document.field_payroll_management_wizard__create_date +msgid "Created on" +msgstr "Creato il" + +#. module: hr_payroll_document +#: model:ir.model.fields,field_description:hr_payroll_document.field_ir_attachment_payroll_custom__display_name +#: model:ir.model.fields,field_description:hr_payroll_document.field_payroll_management_wizard__display_name +msgid "Display Name" +msgstr "Nome visualizzato" + +#. module: hr_payroll_document +#: model:ir.model,name:hr_payroll_document.model_hr_employee +#: model:ir.model.fields,field_description:hr_payroll_document.field_ir_attachment_payroll_custom__employee +msgid "Employee" +msgstr "Dipendente" + +#. module: hr_payroll_document +#. odoo-python +#: code:addons/hr_payroll_document/tests/test_hr_payroll_document.py:0 +#: code:addons/hr_payroll_document/wizard/payroll_management_wizard.py:0 +#, python-format +msgid "Employees not found" +msgstr "Dipendenti non trovati" + +#. module: hr_payroll_document +#: model:ir.model.fields,help:hr_payroll_document.field_payroll_management_wizard__subject +msgid "" +"Enter the title of the payroll whether it is the month, week, day, etc." +msgstr "" +"Inserire il titolo della retribuzione se è il mese, settimana, giorno, ecc." + +#. module: hr_payroll_document +#: model:ir.model.fields,field_description:hr_payroll_document.field_ir_attachment_payroll_custom__id +#: model:ir.model.fields,field_description:hr_payroll_document.field_payroll_management_wizard__id +msgid "ID" +msgstr "ID" + +#. module: hr_payroll_document +#. odoo-python +#: code:addons/hr_payroll_document/tests/test_hr_payroll_document.py:0 +#: code:addons/hr_payroll_document/wizard/payroll_management_wizard.py:0 +#, python-format +msgid "IDs whose employee has not been found: " +msgstr "ID il cui dipendente non è stato trovato: " + +#. module: hr_payroll_document +#: model:ir.model.fields,field_description:hr_payroll_document.field_ir_attachment_payroll_custom__identification_id +msgid "Identification ID" +msgstr "ID identificazione" + +#. module: hr_payroll_document +#: model:ir.model.fields,field_description:hr_payroll_document.field_ir_attachment_payroll_custom____last_update +#: model:ir.model.fields,field_description:hr_payroll_document.field_payroll_management_wizard____last_update +msgid "Last Modified on" +msgstr "Ultima modifica il" + +#. module: hr_payroll_document +#: model:ir.model.fields,field_description:hr_payroll_document.field_ir_attachment_payroll_custom__write_uid +#: model:ir.model.fields,field_description:hr_payroll_document.field_payroll_management_wizard__write_uid +msgid "Last Updated by" +msgstr "Ultimo aggiornamento di" + +#. module: hr_payroll_document +#: model:ir.model.fields,field_description:hr_payroll_document.field_ir_attachment_payroll_custom__write_date +#: model:ir.model.fields,field_description:hr_payroll_document.field_payroll_management_wizard__write_date +msgid "Last Updated on" +msgstr "Ultimo aggiornamento il" + +#. module: hr_payroll_document +#. odoo-python +#: code:addons/hr_payroll_document/wizard/payroll_management_wizard.py:0 +#, python-format +msgid "Missing pdf file signature" +msgstr "Firma PDF mancante" + +#. module: hr_payroll_document +#. odoo-python +#: code:addons/hr_payroll_document/wizard/payroll_management_wizard.py:0 +#, python-format +msgid "Payroll" +msgstr "Retribuzione" + +#. module: hr_payroll_document +#. odoo-python +#: code:addons/hr_payroll_document/wizard/payroll_management_wizard.py:0 +#, python-format +msgid "Payroll " +msgstr "Retribuzione " + +#. module: hr_payroll_document +#: model:mail.template,name:hr_payroll_document.payroll_employee_email_template +msgid "Payroll Employee" +msgstr "Retribuzione dipendente" + +#. module: hr_payroll_document +#: model:ir.model,name:hr_payroll_document.model_payroll_management_wizard +msgid "Payroll Management" +msgstr "Gestione retribuzione" + +#. module: hr_payroll_document +#: model:ir.model,name:hr_payroll_document.model_ir_attachment_payroll_custom +msgid "Payroll attachment" +msgstr "Allegato retribuzione" + +#. module: hr_payroll_document +#: model:mail.template,subject:hr_payroll_document.payroll_employee_email_template +msgid "Payroll {{ctx.get('subject')}}" +msgstr "Retribuzione {{ctx.get('subject')}}" + +#. module: hr_payroll_document +#: model:ir.model.fields,field_description:hr_payroll_document.field_payroll_management_wizard__payrolls +msgid "Payrolls" +msgstr "Retribuzioni" + +#. module: hr_payroll_document +#: model:ir.actions.act_window,name:hr_payroll_document.payrolls_management_wizard_action +#: model:ir.ui.menu,name:hr_payroll_document.payrolls_management_wizard_menu_action +msgid "Payrolls Management" +msgstr "Gestione retribuzioni" + +#. module: hr_payroll_document +#. odoo-python +#: code:addons/hr_payroll_document/tests/test_hr_payroll_document.py:0 +#: code:addons/hr_payroll_document/tests/test_hr_payroll_document.py:0 +#: code:addons/hr_payroll_document/tests/test_hr_payroll_document.py:0 +#: code:addons/hr_payroll_document/wizard/payroll_management_wizard.py:0 +#: code:addons/hr_payroll_document/wizard/payroll_management_wizard.py:0 +#: code:addons/hr_payroll_document/wizard/payroll_management_wizard.py:0 +#, python-format +msgid "Payrolls sent" +msgstr "Retribuzioni inviate" + +#. module: hr_payroll_document +#. odoo-python +#: code:addons/hr_payroll_document/tests/test_hr_payroll_document.py:0 +#: code:addons/hr_payroll_document/wizard/payroll_management_wizard.py:0 +#, python-format +msgid "Payrolls sent to employees correctly" +msgstr "Retribuzioni inviate correttamente ai dipendenti" + +#. module: hr_payroll_document +#: model_terms:ir.ui.view,arch_db:hr_payroll_document.payrolls_management_wizard_form +msgid "Send" +msgstr "Invia" + +#. module: hr_payroll_document +#: model:ir.model.fields,field_description:hr_payroll_document.field_ir_attachment_payroll_custom__subject +#: model:ir.model.fields,field_description:hr_payroll_document.field_payroll_management_wizard__subject +msgid "Subject" +msgstr "Oggetto" + +#. module: hr_payroll_document +#. odoo-python +#: code:addons/hr_payroll_document/models/hr_employee.py:0 +#, python-format +msgid "The field identification ID is not valid" +msgstr "L'ID identificazione file non è corretto" + +#. module: hr_payroll_document +#. odoo-python +#: code:addons/hr_payroll_document/wizard/payroll_management_wizard.py:0 +#, python-format +msgid "You must to filled country field of company" +msgstr "Serve compilare il campo nazione dell'azienda" diff --git a/hr_payroll_document/models/__init__.py b/hr_payroll_document/models/__init__.py new file mode 100644 index 00000000..b4048b8c --- /dev/null +++ b/hr_payroll_document/models/__init__.py @@ -0,0 +1,4 @@ +from . import ir_attachment_payroll_custom +from . import ir_attachment +from . import hr_employee +from . import res_users diff --git a/hr_payroll_document/models/hr_employee.py b/hr_payroll_document/models/hr_employee.py new file mode 100644 index 00000000..74c9cdc6 --- /dev/null +++ b/hr_payroll_document/models/hr_employee.py @@ -0,0 +1,44 @@ +from odoo import _, fields, models +from odoo.exceptions import ValidationError + + +class Employee(models.Model): + _inherit = "hr.employee" + + payroll_count = fields.Integer( + compute="_compute_payroll_count", + ) + + def _compute_payroll_count(self): + self.payroll_count = len( + self.env["ir.attachment"].search( + [ + ("document_type", "=", "payroll"), + ("res_model", "=", self._name), + ("res_id", "in", self.ids), + ] + ) + ) + + def action_get_payroll_tree_view(self): + action = self.env.ref("base.action_attachment").sudo().read()[0] + action["context"] = { + "default_res_model": self._name, + "default_res_id": self.ids[0], + } + action["domain"] = str( + [ + ("document_type", "=", "payroll"), + ("res_model", "=", self._name), + ("res_id", "in", self.ids), + ] + ) + return action + + def write(self, vals): + res = super().write(vals) + if "identification_id" in vals and not self.env["res.partner"].simple_vat_check( + self.env.company.country_id.code, vals["identification_id"] + ): + raise ValidationError(_("The field identification ID is not valid")) + return res diff --git a/hr_payroll_document/models/ir_attachment.py b/hr_payroll_document/models/ir_attachment.py new file mode 100644 index 00000000..d5173677 --- /dev/null +++ b/hr_payroll_document/models/ir_attachment.py @@ -0,0 +1,14 @@ +from odoo import fields, models + + +class Attachment(models.Model): + _inherit = "ir.attachment" + + payrol_rel = fields.Many2many( + "payroll.management.wizard", + "payrolls", + "attachment_id3", + "document_id", + string="Attachment", + ) + document_type = fields.Selection([("payroll", "Payroll")]) diff --git a/hr_payroll_document/models/ir_attachment_payroll_custom.py b/hr_payroll_document/models/ir_attachment_payroll_custom.py new file mode 100644 index 00000000..1a75d7b3 --- /dev/null +++ b/hr_payroll_document/models/ir_attachment_payroll_custom.py @@ -0,0 +1,23 @@ +from odoo import fields, models + + +class IRAttachmentPayrollCustom(models.Model): + _name = "ir.attachment.payroll.custom" + _description = "Payroll attachment" + + attachment_id = fields.Many2one( + comodel_name="ir.attachment", + string="Attachment File", + prefetch=False, + ondelete="cascade", + ) + employee = fields.Char() + identification_id = fields.Char("Identification ID") + create_date = fields.Date(default=fields.Date.context_today) + subject = fields.Char() + + def download(self): + return { + "type": "ir.actions.act_url", + "url": "web/content/" + str(self.attachment_id.id) + "/?download=True", + } diff --git a/hr_payroll_document/models/res_users.py b/hr_payroll_document/models/res_users.py new file mode 100644 index 00000000..f85626c4 --- /dev/null +++ b/hr_payroll_document/models/res_users.py @@ -0,0 +1,20 @@ +from odoo import models + + +class ResUsers(models.Model): + _inherit = "res.users" + + def action_get_attachment_tree_view(self): + action = self.env.ref("base.action_attachment").sudo().read()[0] + action["context"] = { + "default_res_model": self._name, + "default_res_id": self.employee_id.id, + } + action["domain"] = str( + [ + ("document_type", "=", "payroll"), + ("res_model", "=", self.employee_id._name), + ("res_id", "in", [self.employee_id.id]), + ] + ) + return action diff --git a/hr_payroll_document/pyproject.toml b/hr_payroll_document/pyproject.toml new file mode 100644 index 00000000..4231d0cc --- /dev/null +++ b/hr_payroll_document/pyproject.toml @@ -0,0 +1,3 @@ +[build-system] +requires = ["whool"] +build-backend = "whool.buildapi" diff --git a/hr_payroll_document/readme/CONTRIBUTORS.md b/hr_payroll_document/readme/CONTRIBUTORS.md new file mode 100644 index 00000000..4098d204 --- /dev/null +++ b/hr_payroll_document/readme/CONTRIBUTORS.md @@ -0,0 +1,3 @@ +- [APSL-Nagarro](https://www.apsl.tech): + - Antoni Marroig \<\> + - Miquel Alzanillas \<\> diff --git a/hr_payroll_document/readme/DESCRIPTION.md b/hr_payroll_document/readme/DESCRIPTION.md new file mode 100644 index 00000000..a4011cb5 --- /dev/null +++ b/hr_payroll_document/readme/DESCRIPTION.md @@ -0,0 +1 @@ +This module have a wizard view to manage the different payrolls of employees which is identified by the identification_id attribute. diff --git a/hr_payroll_document/security/ir.model.access.csv b/hr_payroll_document/security/ir.model.access.csv new file mode 100644 index 00000000..bd91389a --- /dev/null +++ b/hr_payroll_document/security/ir.model.access.csv @@ -0,0 +1,3 @@ +id,name,model_id:id,group_id:id,perm_read,perm_write,perm_create,perm_unlink +payroll_management_wizard,payroll.management.wizard,model_payroll_management_wizard,hr.group_hr_manager,1,1,1,1 +ir_attachment_payroll_custom,ir.attachment.payroll.custom,model_ir_attachment_payroll_custom,hr.group_hr_manager,1,1,1,1 diff --git a/hr_payroll_document/static/description/icon.png b/hr_payroll_document/static/description/icon.png new file mode 100644 index 00000000..3a0328b5 Binary files /dev/null and b/hr_payroll_document/static/description/icon.png differ diff --git a/hr_payroll_document/static/description/index.html b/hr_payroll_document/static/description/index.html new file mode 100644 index 00000000..b8f972c4 --- /dev/null +++ b/hr_payroll_document/static/description/index.html @@ -0,0 +1,430 @@ + + + + + +HR - Payroll Document + + + +
+

HR - Payroll Document

+ + +

Beta License: AGPL-3 OCA/payroll Translate me on Weblate Try me on Runboat

+

This module have a wizard view to manage the different payrolls of +employees which is identified by the identification_id attribute.

+

Table of contents

+ +
+

Bug Tracker

+

Bugs are tracked on GitHub Issues. +In case of trouble, please check there if your issue has already been reported. +If you spotted it first, help us to smash it by providing a detailed and welcomed +feedback.

+

Do not contact contributors directly about support or help with technical issues.

+
+
+

Credits

+
+

Authors

+
    +
  • APSL
  • +
+
+
+

Contributors

+ +
+
+

Maintainers

+

This module is maintained by the OCA.

+ +Odoo Community Association + +

OCA, or the Odoo Community Association, is a nonprofit organization whose +mission is to support the collaborative development of Odoo features and +promote its widespread use.

+

Current maintainer:

+

peluko00

+

This module is part of the OCA/payroll project on GitHub.

+

You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.

+
+
+
+ + diff --git a/hr_payroll_document/tests/__init__.py b/hr_payroll_document/tests/__init__.py new file mode 100644 index 00000000..75f54441 --- /dev/null +++ b/hr_payroll_document/tests/__init__.py @@ -0,0 +1 @@ +from . import test_hr_payroll_document diff --git a/hr_payroll_document/tests/test.docx b/hr_payroll_document/tests/test.docx new file mode 100644 index 00000000..8a2af5ab Binary files /dev/null and b/hr_payroll_document/tests/test.docx differ diff --git a/hr_payroll_document/tests/test.pdf b/hr_payroll_document/tests/test.pdf new file mode 100644 index 00000000..8138280c Binary files /dev/null and b/hr_payroll_document/tests/test.pdf differ diff --git a/hr_payroll_document/tests/test_hr_payroll_document.py b/hr_payroll_document/tests/test_hr_payroll_document.py new file mode 100644 index 00000000..0d92c00d --- /dev/null +++ b/hr_payroll_document/tests/test_hr_payroll_document.py @@ -0,0 +1,109 @@ +import base64 + +from odoo import _ +from odoo.exceptions import UserError, ValidationError +from odoo.tests import common +from odoo.tools.misc import file_path + +from odoo.addons.mail.tests.common import mail_new_test_user + + +class TestHRPayrollDocument(common.TransactionCase): + @classmethod + def setUpClass(cls): + super().setUpClass() + cls.env.user.tz = "Europe/Brussels" + cls.user_admin = cls.env.ref("base.user_admin") + + # Fix Company without country + cls.env.company.country_id = False + + # Test users to use through the various tests + cls.user_employee = mail_new_test_user( + cls.env, login="david", groups="base.group_user" + ) + cls.user_employee_id = cls.user_employee.id + + # Hr Data + cls.employee_emp = cls.env["hr.employee"].create( + { + "name": "David Employee", + "user_id": cls.user_employee_id, + "company_id": 1, + "identification_id": "30831011V", + } + ) + + with open(file_path("hr_payroll_document/tests/test.pdf"), "rb") as pdf_file: + encoded_string = base64.b64encode(pdf_file.read()) + ir_values = { + "name": "test", + "type": "binary", + "datas": encoded_string, + "store_fname": encoded_string, + "res_model": "payroll.management.wizard", + "res_id": 1, + } + cls.attachment = cls.env["ir.attachment"].create(ir_values) + cls.subject = "January" + cls.wizard = cls.env["payroll.management.wizard"].create( + {"payrolls": [cls.attachment.id], "subject": cls.subject} + ) + + def fill_company_id(self): + self.env.company.country_id = self.env["res.country"].search( + [("name", "=", "Spain")] + ) + + def test_extension_error(self): + with open(file_path("hr_payroll_document/tests/test.docx"), "rb") as pdf_file: + encoded_string = base64.b64encode(pdf_file.read()) + ir_values = { + "name": "test", + "type": "binary", + "datas": encoded_string, + "store_fname": encoded_string, + "res_model": "payroll.management.wizard", + "res_id": 1, + } + self.attachment = self.env["ir.attachment"].create(ir_values) + self.subject = "January" + self.wizard = self.env["payroll.management.wizard"].create( + {"payrolls": [self.attachment.id], "subject": self.subject} + ) + with self.assertRaises(ValidationError): + self.wizard.send_payrolls() + + def test_company_id_required(self): + with self.assertRaises(UserError): + self.wizard.send_payrolls() + + def test_employee_vat_not_valid(self): + self.fill_company_id() + with self.assertRaises(ValidationError): + employees = self.env["hr.employee"].search([]) + for employee in employees: + if not employee.identification_id: + employee.identification_id = "XXXXXXX" + + def test_one_employee_not_found(self): + self.fill_company_id() + self.env["hr.employee"].search([("id", "=", 1)]).identification_id = "37936636E" + self.assertEqual( + self.wizard.send_payrolls()["params"]["title"], _("Employees not found") + ) + self.assertEqual( + self.wizard.send_payrolls()["params"]["message"], + _("IDs whose employee has not been found: ") + "51000278D", + ) + + def test_send_payrolls_correctly(self): + self.fill_company_id() + self.env["hr.employee"].search([("id", "=", 1)]).identification_id = "51000278D" + self.assertEqual( + self.wizard.send_payrolls()["params"]["title"], _("Payrolls sent") + ) + self.assertEqual( + self.wizard.send_payrolls()["params"]["message"], + _("Payrolls sent to employees correctly"), + ) diff --git a/hr_payroll_document/views/hr_employee_views.xml b/hr_payroll_document/views/hr_employee_views.xml new file mode 100644 index 00000000..ee687b3c --- /dev/null +++ b/hr_payroll_document/views/hr_employee_views.xml @@ -0,0 +1,107 @@ + + + + payroll.view.tree + ir.attachment.payroll.custom + + + + + + + + + + + + + + hr.res_user.view.form.inherit.document + res.users + + +
+ +
+
+
+
diff --git a/hr_payroll_document/wizard/__init__.py b/hr_payroll_document/wizard/__init__.py new file mode 100644 index 00000000..72e4cc53 --- /dev/null +++ b/hr_payroll_document/wizard/__init__.py @@ -0,0 +1 @@ +from . import payroll_management_wizard diff --git a/hr_payroll_document/wizard/payroll_management_wizard.py b/hr_payroll_document/wizard/payroll_management_wizard.py new file mode 100644 index 00000000..585584fa --- /dev/null +++ b/hr_payroll_document/wizard/payroll_management_wizard.py @@ -0,0 +1,156 @@ +import base64 +from base64 import b64decode + +from pypdf import PdfReader, PdfWriter + +from odoo import _, fields, models +from odoo.exceptions import UserError, ValidationError + + +class PayrollManagamentWizard(models.TransientModel): + _name = "payroll.management.wizard" + _description = "Payroll Management" + + subject = fields.Char( + help="Enter the title of the payroll whether it is the month, week, day, etc.", + required=True, + ) + payrolls = fields.Many2many( + "ir.attachment", "payrol_rel", "doc_id", "attach_id3", copy=False, required=True + ) + + def send_payrolls(self): + not_found = set() + self.merge_pdfs() + reader = PdfReader("/tmp/merged-pdf.pdf") + employees = set() + + # Validate if company have country + if not self.env.company.country_id: + raise UserError(_("You must to filled country field of company")) + + # Find all IDs of the employees + for page in reader.pages: + for value in page.extract_text().split(): + if self.validate_id(value) and value != self.env.company.vat: + employee = self.env["hr.employee"].search( + [("identification_id", "=", value)] + ) + if employee: + employees.add(employee) + else: + not_found.add(value) + + for employee in list(employees): + pdfWriter = PdfWriter() + for page in reader.pages: + if employee.identification_id in page.extract_text(): + # Save pdf with payrolls of employee + pdfWriter.add_page(page) + + path = "/tmp/" + _("Payroll ") + employee.name + ".pdf" + + # Encrypt the payroll file with the identification identifier + # of the employee + pdfWriter.encrypt(employee.identification_id, algorithm="AES-256") + + f = open(path, "wb") + pdfWriter.write(f) + f.close() + + # Send payroll to the employee + self.send_mail(employee, path) + + action = self.env["ir.actions.actions"]._for_xml_id( + "hr_payroll_document.payrolls_view_action" + ) + action["views"] = [ + [self.env.ref("hr_payroll_document.view_payroll_tree").id, "list"] + ] + if not_found: + return { + "type": "ir.actions.client", + "tag": "display_notification", + "params": { + "title": _("Employees not found"), + "message": _("IDs whose employee has not been found: ") + + ", ".join(list(not_found)), + "sticky": True, + "type": "warning", + "next": action, + }, + } + + return { + "type": "ir.actions.client", + "tag": "display_notification", + "params": { + "title": _("Payrolls sent"), + "message": _("Payrolls sent to employees correctly"), + "sticky": False, + "type": "success", + "next": action, + }, + } + + def merge_pdfs(self): + # Merge the pdfs together + pdfs = [] + for file in self.payrolls: + b64 = file.datas + btes = b64decode(b64, validate=True) + if btes[0:4] != b"%PDF": + raise ValidationError(_("Missing pdf file signature")) + f = open("/tmp/" + file.name, "wb") + f.write(btes) + f.close() + pdfs.append(f.name) + + merger = PdfWriter() + + for pdf in pdfs: + merger.append(pdf) + + merger.write("/tmp/merged-pdf.pdf") + merger.close() + + def send_mail(self, employee, path): + # Open Payrolls of employee and encode content + with open(path, "rb") as pdf_file: + encoded_string = base64.b64encode(pdf_file.read()) + + # Attach file to email + ir_values = { + "name": _("Payroll") + "_" + self.subject + "_" + employee.name, + "type": "binary", + "datas": encoded_string, + "store_fname": encoded_string, + "res_model": "hr.employee", + "res_id": employee.id, + "document_type": "payroll", + } + + # Save payroll attachment to all employee payrolls attachments + self.env["ir.attachment.payroll.custom"].create( + { + "attachment_id": self.env["ir.attachment"].create(ir_values).id, + "employee": employee.name, + "subject": self.subject, + "identification_id": employee.identification_id, + } + ) + + # Send mail + mail_template = self.env.ref( + "hr_payroll_document.payroll_employee_email_template" + ) + data_id = [(6, 0, [self.env["ir.attachment"].create(ir_values).id])] + mail_template.attachment_ids = data_id + mail_template.with_context(**{"subject": self.subject}).send_mail( + employee.id, force_send=True + ) + + def validate_id(self, number): + return self.env["res.partner"].simple_vat_check( + self.env.company.country_id.code, number + ) diff --git a/hr_payroll_document/wizard/payroll_management_wizard.xml b/hr_payroll_document/wizard/payroll_management_wizard.xml new file mode 100644 index 00000000..6a42e383 --- /dev/null +++ b/hr_payroll_document/wizard/payroll_management_wizard.xml @@ -0,0 +1,43 @@ + + + + payroll.management.wizard.form + payroll.management.wizard + +
+ + + + + +
+
+
+
+
+
+ + Payrolls Management + payroll.management.wizard + + form + new + + + +
diff --git a/payroll/README.rst b/payroll/README.rst index 9a868d87..893fd43e 100644 --- a/payroll/README.rst +++ b/payroll/README.rst @@ -30,7 +30,9 @@ Payroll Manage your employee payroll records. -This module is a backport from Odoo SA and as such, it is not included in the OCA CLA. That means we do not have a copy of the copyright on it like all other OCA modules. +This module is a backport from Odoo SA and as such, it is not included +in the OCA CLA. That means we do not have a copy of the copyright on it +like all other OCA modules. **Table of contents** @@ -51,21 +53,21 @@ Credits ======= Authors -~~~~~~~ +------- * Odoo SA Contributors -~~~~~~~~~~~~ +------------ -* Odoo SA -* David James -* Hilar AK -* Nimarosa (Nicolas Rodriguez) -* Henrik Norlin (@appstogrow) +- Odoo SA +- David James +- Hilar AK +- Nimarosa (Nicolas Rodriguez) +- Henrik Norlin (@appstogrow) Maintainers -~~~~~~~~~~~ +----------- This module is maintained by the OCA. diff --git a/payroll/readme/CONTRIBUTORS.md b/payroll/readme/CONTRIBUTORS.md new file mode 100644 index 00000000..0bc8d15e --- /dev/null +++ b/payroll/readme/CONTRIBUTORS.md @@ -0,0 +1,5 @@ +- Odoo SA \<\> +- David James \<\> +- Hilar AK \<\> +- Nimarosa (Nicolas Rodriguez) \<\> +- Henrik Norlin (@appstogrow) diff --git a/payroll/readme/CONTRIBUTORS.rst b/payroll/readme/CONTRIBUTORS.rst deleted file mode 100644 index 8a0b8ac8..00000000 --- a/payroll/readme/CONTRIBUTORS.rst +++ /dev/null @@ -1,5 +0,0 @@ -* Odoo SA -* David James -* Hilar AK -* Nimarosa (Nicolas Rodriguez) -* Henrik Norlin (@appstogrow) diff --git a/payroll/readme/DESCRIPTION.md b/payroll/readme/DESCRIPTION.md new file mode 100644 index 00000000..4fc60e5e --- /dev/null +++ b/payroll/readme/DESCRIPTION.md @@ -0,0 +1,5 @@ +Manage your employee payroll records. + +This module is a backport from Odoo SA and as such, it is not included +in the OCA CLA. That means we do not have a copy of the copyright on it +like all other OCA modules. diff --git a/payroll/readme/DESCRIPTION.rst b/payroll/readme/DESCRIPTION.rst deleted file mode 100644 index ce96b5f2..00000000 --- a/payroll/readme/DESCRIPTION.rst +++ /dev/null @@ -1,3 +0,0 @@ -Manage your employee payroll records. - -This module is a backport from Odoo SA and as such, it is not included in the OCA CLA. That means we do not have a copy of the copyright on it like all other OCA modules. diff --git a/payroll/static/description/index.html b/payroll/static/description/index.html index a4e1ef3f..0209c821 100644 --- a/payroll/static/description/index.html +++ b/payroll/static/description/index.html @@ -8,10 +8,11 @@ /* :Author: David Goodger (goodger@python.org) -:Id: $Id: html4css1.css 8954 2022-01-20 10:10:25Z milde $ +:Id: $Id: html4css1.css 9511 2024-01-13 09:50:07Z milde $ :Copyright: This stylesheet has been placed in the public domain. Default cascading style sheet for the HTML output of Docutils. +Despite the name, some widely supported CSS2 features are used. See https://docutils.sourceforge.io/docs/howto/html-stylesheets.html for how to customize this style sheet. @@ -274,7 +275,7 @@ margin-left: 2em ; margin-right: 2em } -pre.code .ln { color: grey; } /* line numbers */ +pre.code .ln { color: gray; } /* line numbers */ pre.code, code { background-color: #eeeeee } pre.code .comment, code .comment { color: #5C6576 } pre.code .keyword, code .keyword { color: #3B0D06; font-weight: bold } @@ -300,7 +301,7 @@ span.pre { white-space: pre } -span.problematic { +span.problematic, pre.problematic { color: red } span.section-subtitle { @@ -370,7 +371,9 @@

Payroll

!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->

Beta License: LGPL-3 OCA/payroll Translate me on Weblate Try me on Runboat

Manage your employee payroll records.

-

This module is a backport from Odoo SA and as such, it is not included in the OCA CLA. That means we do not have a copy of the copyright on it like all other OCA modules.

+

This module is a backport from Odoo SA and as such, it is not included +in the OCA CLA. That means we do not have a copy of the copyright on it +like all other OCA modules.

Table of contents

    @@ -412,7 +415,9 @@

    Contributors

    Maintainers

    This module is maintained by the OCA.

    -Odoo Community Association + +Odoo Community Association +

    OCA, or the Odoo Community Association, is a nonprofit organization whose mission is to support the collaborative development of Odoo features and promote its widespread use.

    diff --git a/requirements.txt b/requirements.txt new file mode 100644 index 00000000..1ab56ace --- /dev/null +++ b/requirements.txt @@ -0,0 +1,2 @@ +# generated from manifests external_dependencies +pypdf