diff --git a/hr_commission_oca/README.rst b/hr_commission_oca/README.rst new file mode 100644 index 000000000..ea5579386 --- /dev/null +++ b/hr_commission_oca/README.rst @@ -0,0 +1,100 @@ +.. image:: https://odoo-community.org/readme-banner-image + :target: https://odoo-community.org/get-involved?utm_source=readme + :alt: Odoo Community Association + +================== +HR commissions OCA +================== + +.. + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + !! This file is generated by oca-gen-addon-readme !! + !! changes will be overwritten. !! + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + !! source digest: sha256:b36e2256947013011931cc80fc440a6e2db7010c4aa5abaeafd242af366fa22d + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +.. |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/license-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%2Fcommission-lightgray.png?logo=github + :target: https://github.com/OCA/commission/tree/19.0/hr_commission_oca + :alt: OCA/commission +.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png + :target: https://translation.odoo-community.org/projects/commission-19-0/commission-19-0-hr_commission_oca + :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/commission&target_branch=19.0 + :alt: Try me on Runboat + +|badge1| |badge2| |badge3| |badge4| |badge5| + +This module links sale_commission with hr module. For now, it only adds +another type of agent whose commissions are not invoiced in the +corresponding wizard. + +It also computes the Boolean field "employee" in ResPartner to be +updated according to the ResPartner-HrEmployee relation that was +created. + +**Table of contents** + +.. contents:: + :local: + +Known issues / Roadmap +====================== + +- Add demo data. +- Link settlements with wages. + +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 +------- + +* Tecnativa + +Contributors +------------ + +- `Tecnativa `__ + + - Pedro M. Baeza + - João Marques + - Ernesto García + - David Bañón Gil + +- Rattapong C. +- Mina S. Wahib minaw368@gmail.com + +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. + +This module is part of the `OCA/commission `_ project on GitHub. + +You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute. diff --git a/hr_commission_oca/__init__.py b/hr_commission_oca/__init__.py new file mode 100644 index 000000000..0650744f6 --- /dev/null +++ b/hr_commission_oca/__init__.py @@ -0,0 +1 @@ +from . import models diff --git a/hr_commission_oca/__manifest__.py b/hr_commission_oca/__manifest__.py new file mode 100644 index 000000000..3a9d9dc14 --- /dev/null +++ b/hr_commission_oca/__manifest__.py @@ -0,0 +1,18 @@ +# Copyright 2015-2020 Tecnativa - Pedro M. Baeza +# Copyright 2021 Tecnativa - Jo??o Marques +# License AGPL-3 - See https://www.gnu.org/licenses/agpl-3.0.html + +{ + "name": "HR commissions OCA", + "version": "19.0.1.0.0", + "author": "Tecnativa, Odoo Community Association (OCA)", + "website": "https://github.com/OCA/commission", + "category": "Commissions", + "depends": ["account_commission_oca", "hr"], + "license": "AGPL-3", + "data": [ + "views/res_partner_view.xml", + "views/sale_commission_settlement_views.xml", + ], + "installable": True, +} diff --git a/hr_commission_oca/i18n/ca.po b/hr_commission_oca/i18n/ca.po new file mode 100644 index 000000000..8a3ed72d1 --- /dev/null +++ b/hr_commission_oca/i18n/ca.po @@ -0,0 +1,80 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * hr_commission +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 13.0\n" +"Report-Msgid-Bugs-To: \n" +"PO-Revision-Date: 2021-05-31 18:48+0000\n" +"Last-Translator: jabelchi \n" +"Language-Team: none\n" +"Language: ca\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.3.2\n" + +#. module: hr_commission_oca +#: model:ir.model.fields,help:hr_commission_oca.field_res_partner__employee +#: model:ir.model.fields,help:hr_commission_oca.field_res_users__employee +msgid "Check this box if this contact is an Employee." +msgstr "Marqueu aquesta casella si aquest contacte ??s un empleat." + +#. module: hr_commission_oca +#: model:ir.model,name:hr_commission_oca.model_res_partner +msgid "Contact" +msgstr "Contacte" + +#. module: hr_commission_oca +#: model:ir.model,name:hr_commission_oca.model_hr_employee +#: model:ir.model.fields,field_description:hr_commission_oca.field_res_partner__employee +#: model:ir.model.fields,field_description:hr_commission_oca.field_res_users__employee +msgid "Employee" +msgstr "Empleat" + +#. module: hr_commission_oca +#: model_terms:ir.ui.view,arch_db:hr_commission_oca.view_settlement_form +msgid "Mark as invoiced" +msgstr "Marcar com a facturat" + +#. module: hr_commission_oca +#: model:ir.model.fields,field_description:hr_commission_oca.field_res_partner__employee_id +msgid "Related Employee" +msgstr "Empleat relacionat" + +#. module: hr_commission_oca +#: model:ir.model.fields.selection,name:hr_commission_oca.selection__res_partner__agent_type__salesman +msgid "Salesman (employee)" +msgstr "Venedor (empleat)" + +#. module: hr_commission_oca +#: model:ir.model,name:hr_commission_oca.model_commission_settlement +msgid "Settlement" +msgstr "Liquidaci??" + +#. module: hr_commission_oca +#. odoo-python +#: code:addons/hr_commission_oca/models/res_partner.py:0 +msgid "" +"There must one (and only one) employee linked to this partner. To do this, " +"go to 'Employees' and create an Employee with a 'Related User' under 'HR " +"Settings'." +msgstr "" +"Cal que hi hagi un (i s??lament un) empleat enlla??at a aquest partner. Per " +"a fer-ho, anar a 'Empleats' i crear un empleat amb un 'usuari relacionat' a " +"la pestanya 'configuraci?? RH'." + +#. module: hr_commission_oca +#: model:ir.model.fields,field_description:hr_commission_oca.field_res_partner__agent_type +#: model:ir.model.fields,field_description:hr_commission_oca.field_res_users__agent_type +msgid "Type" +msgstr "Tipus" + +#. module: hr_commission_oca +#. odoo-python +#: code:addons/hr_commission_oca/models/hr_employee.py:0 +msgid "You can't remove the user, as it's linked to a commission agent." +msgstr "" +"No podeu eliminar l'usuari, ja que est?? vinculat a un agent de comissions." diff --git a/hr_commission_oca/i18n/ca_ES.po b/hr_commission_oca/i18n/ca_ES.po new file mode 100644 index 000000000..7a4101b79 --- /dev/null +++ b/hr_commission_oca/i18n/ca_ES.po @@ -0,0 +1,74 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * hr_commission +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 13.0\n" +"Report-Msgid-Bugs-To: \n" +"Last-Translator: Automatically generated\n" +"Language-Team: none\n" +"Language: ca_ES\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" + +#. module: hr_commission_oca +#: model:ir.model.fields,help:hr_commission_oca.field_res_partner__employee +#: model:ir.model.fields,help:hr_commission_oca.field_res_users__employee +msgid "Check this box if this contact is an Employee." +msgstr "" + +#. module: hr_commission_oca +#: model:ir.model,name:hr_commission_oca.model_res_partner +msgid "Contact" +msgstr "" + +#. module: hr_commission_oca +#: model:ir.model,name:hr_commission_oca.model_hr_employee +#: model:ir.model.fields,field_description:hr_commission_oca.field_res_partner__employee +#: model:ir.model.fields,field_description:hr_commission_oca.field_res_users__employee +msgid "Employee" +msgstr "" + +#. module: hr_commission_oca +#: model_terms:ir.ui.view,arch_db:hr_commission_oca.view_settlement_form +msgid "Mark as invoiced" +msgstr "" + +#. module: hr_commission_oca +#: model:ir.model.fields,field_description:hr_commission_oca.field_res_partner__employee_id +msgid "Related Employee" +msgstr "" + +#. module: hr_commission_oca +#: model:ir.model.fields.selection,name:hr_commission_oca.selection__res_partner__agent_type__salesman +msgid "Salesman (employee)" +msgstr "" + +#. module: hr_commission_oca +#: model:ir.model,name:hr_commission_oca.model_commission_settlement +msgid "Settlement" +msgstr "" + +#. module: hr_commission_oca +#. odoo-python +#: code:addons/hr_commission_oca/models/res_partner.py:0 +msgid "" +"There must one (and only one) employee linked to this partner. To do this, " +"go to 'Employees' and create an Employee with a 'Related User' under 'HR " +"Settings'." +msgstr "" + +#. module: hr_commission_oca +#: model:ir.model.fields,field_description:hr_commission_oca.field_res_partner__agent_type +#: model:ir.model.fields,field_description:hr_commission_oca.field_res_users__agent_type +msgid "Type" +msgstr "" + +#. module: hr_commission_oca +#. odoo-python +#: code:addons/hr_commission_oca/models/hr_employee.py:0 +msgid "You can't remove the user, as it's linked to a commission agent." +msgstr "" diff --git a/hr_commission_oca/i18n/es.po b/hr_commission_oca/i18n/es.po new file mode 100644 index 000000000..1c2de5e07 --- /dev/null +++ b/hr_commission_oca/i18n/es.po @@ -0,0 +1,94 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * hr_commission +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 11.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2018-08-07 11:26+0000\n" +"PO-Revision-Date: 2023-10-10 22:39+0000\n" +"Last-Translator: Ivorra78 \n" +"Language-Team: \n" +"Language: es\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_commission_oca +#: model:ir.model.fields,help:hr_commission_oca.field_res_partner__employee +#: model:ir.model.fields,help:hr_commission_oca.field_res_users__employee +msgid "Check this box if this contact is an Employee." +msgstr "Seleccione esta casilla si el contacto es un Empleado." + +#. module: hr_commission_oca +#: model:ir.model,name:hr_commission_oca.model_res_partner +msgid "Contact" +msgstr "Contacto" + +#. module: hr_commission_oca +#: model:ir.model,name:hr_commission_oca.model_hr_employee +#: model:ir.model.fields,field_description:hr_commission_oca.field_res_partner__employee +#: model:ir.model.fields,field_description:hr_commission_oca.field_res_users__employee +msgid "Employee" +msgstr "Empleado" + +#. module: hr_commission_oca +#: model_terms:ir.ui.view,arch_db:hr_commission_oca.view_settlement_form +msgid "Mark as invoiced" +msgstr "Marcar como facturado" + +#. module: hr_commission_oca +#: model:ir.model.fields,field_description:hr_commission_oca.field_res_partner__employee_id +msgid "Related Employee" +msgstr "Empleado relacionado" + +#. module: hr_commission_oca +#: model:ir.model.fields.selection,name:hr_commission_oca.selection__res_partner__agent_type__salesman +msgid "Salesman (employee)" +msgstr "Comercial (empleado)" + +#. module: hr_commission_oca +#: model:ir.model,name:hr_commission_oca.model_commission_settlement +msgid "Settlement" +msgstr "Liquidaci??n" + +#. module: hr_commission_oca +#. odoo-python +#: code:addons/hr_commission_oca/models/res_partner.py:0 +msgid "" +"There must one (and only one) employee linked to this partner. To do this, " +"go to 'Employees' and create an Employee with a 'Related User' under 'HR " +"Settings'." +msgstr "" +"Debe haber un (y s??lo un) empleado vinculado a este socio. Para ello, vaya " +"a 'Empleados' y cree un Empleado con un 'Usuario vinculado' en 'Configuraci??" +"n de RRHH'." + +#. module: hr_commission_oca +#: model:ir.model.fields,field_description:hr_commission_oca.field_res_partner__agent_type +#: model:ir.model.fields,field_description:hr_commission_oca.field_res_users__agent_type +msgid "Type" +msgstr "Tipo" + +#. module: hr_commission_oca +#. odoo-python +#: code:addons/hr_commission_oca/models/hr_employee.py:0 +msgid "You can't remove the user, as it's linked to a commission agent." +msgstr "No puede eliminar el usuario, ya que est?? enlazado a un comisionista." + +#~ msgid "Employee." +#~ msgstr "Empleado." + +#~ msgid "External agent" +#~ msgstr "Agente externo" + +#, python-format +#~ msgid "" +#~ "There must one (and only one) employee linked to this partner. To do " +#~ "this, go to 'Human Resources' and check 'Employees'" +#~ msgstr "" +#~ "Debe haber un (y s??lo un) empleado enlazado a esta empresa. Para hacer " +#~ "esto, vaya a 'Recursos humanos' y compruebe la secci??n 'Empleados'" diff --git a/hr_commission_oca/i18n/hr_commission.pot b/hr_commission_oca/i18n/hr_commission.pot new file mode 100644 index 000000000..be2200054 --- /dev/null +++ b/hr_commission_oca/i18n/hr_commission.pot @@ -0,0 +1,75 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * hr_commission +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 17.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_commission +#: model:ir.model.fields,help:hr_commission.field_res_partner__employee +#: model:ir.model.fields,help:hr_commission.field_res_users__employee +msgid "Check this box if this contact is an Employee." +msgstr "" + +#. module: hr_commission +#: model:ir.model,name:hr_commission.model_res_partner +msgid "Contact" +msgstr "" + +#. module: hr_commission +#: model:ir.model,name:hr_commission.model_hr_employee +#: model:ir.model.fields,field_description:hr_commission.field_res_partner__employee +#: model:ir.model.fields,field_description:hr_commission.field_res_users__employee +msgid "Employee" +msgstr "" + +#. module: hr_commission +#: model_terms:ir.ui.view,arch_db:hr_commission.view_settlement_form +msgid "Mark as invoiced" +msgstr "" + +#. module: hr_commission +#: model:ir.model.fields,field_description:hr_commission.field_res_partner__employee_id +msgid "Related Employee" +msgstr "" + +#. module: hr_commission +#: model:ir.model.fields.selection,name:hr_commission.selection__res_partner__agent_type__salesman +msgid "Salesman (employee)" +msgstr "" + +#. module: hr_commission +#: model:ir.model,name:hr_commission.model_commission_settlement +msgid "Settlement" +msgstr "" + +#. module: hr_commission +#. odoo-python +#: code:addons/hr_commission/models/res_partner.py:0 +#, python-format +msgid "" +"There must one (and only one) employee linked to this partner. To do this, " +"go to 'Employees' and create an Employee with a 'Related User' under 'HR " +"Settings'." +msgstr "" + +#. module: hr_commission +#: model:ir.model.fields,field_description:hr_commission.field_res_partner__agent_type +#: model:ir.model.fields,field_description:hr_commission.field_res_users__agent_type +msgid "Type" +msgstr "" + +#. module: hr_commission +#. odoo-python +#: code:addons/hr_commission/models/hr_employee.py:0 +#, python-format +msgid "You can't remove the user, as it's linked to a commission agent." +msgstr "" diff --git a/hr_commission_oca/i18n/hr_commission_oca.pot b/hr_commission_oca/i18n/hr_commission_oca.pot new file mode 100644 index 000000000..50f9786e4 --- /dev/null +++ b/hr_commission_oca/i18n/hr_commission_oca.pot @@ -0,0 +1,73 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * hr_commission_oca +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 18.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_commission_oca +#: model:ir.model.fields,help:hr_commission_oca.field_res_partner__employee +#: model:ir.model.fields,help:hr_commission_oca.field_res_users__employee +msgid "Check this box if this contact is an Employee." +msgstr "" + +#. module: hr_commission_oca +#: model:ir.model,name:hr_commission_oca.model_res_partner +msgid "Contact" +msgstr "" + +#. module: hr_commission_oca +#: model:ir.model,name:hr_commission_oca.model_hr_employee +#: model:ir.model.fields,field_description:hr_commission_oca.field_res_partner__employee +#: model:ir.model.fields,field_description:hr_commission_oca.field_res_users__employee +msgid "Employee" +msgstr "" + +#. module: hr_commission_oca +#: model_terms:ir.ui.view,arch_db:hr_commission_oca.view_settlement_form +msgid "Mark as invoiced" +msgstr "" + +#. module: hr_commission_oca +#: model:ir.model.fields,field_description:hr_commission_oca.field_res_partner__employee_id +msgid "Related Employee" +msgstr "" + +#. module: hr_commission_oca +#: model:ir.model.fields.selection,name:hr_commission_oca.selection__res_partner__agent_type__salesman +msgid "Salesman (employee)" +msgstr "" + +#. module: hr_commission_oca +#: model:ir.model,name:hr_commission_oca.model_commission_settlement +msgid "Settlement" +msgstr "" + +#. module: hr_commission_oca +#. odoo-python +#: code:addons/hr_commission_oca/models/res_partner.py:0 +msgid "" +"There must one (and only one) employee linked to this partner. To do this, " +"go to 'Employees' and create an Employee with a 'Related User' under 'HR " +"Settings'." +msgstr "" + +#. module: hr_commission_oca +#: model:ir.model.fields,field_description:hr_commission_oca.field_res_partner__agent_type +#: model:ir.model.fields,field_description:hr_commission_oca.field_res_users__agent_type +msgid "Type" +msgstr "" + +#. module: hr_commission_oca +#. odoo-python +#: code:addons/hr_commission_oca/models/hr_employee.py:0 +msgid "You can't remove the user, as it's linked to a commission agent." +msgstr "" diff --git a/hr_commission_oca/i18n/it.po b/hr_commission_oca/i18n/it.po new file mode 100644 index 000000000..eaa1a766e --- /dev/null +++ b/hr_commission_oca/i18n/it.po @@ -0,0 +1,81 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * hr_commission +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 16.0\n" +"Report-Msgid-Bugs-To: \n" +"PO-Revision-Date: 2024-10-24 09:06+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 5.6.2\n" + +#. module: hr_commission_oca +#: model:ir.model.fields,help:hr_commission_oca.field_res_partner__employee +#: model:ir.model.fields,help:hr_commission_oca.field_res_users__employee +msgid "Check this box if this contact is an Employee." +msgstr "Seleziona questa casella se questo contatto è un dipendente." + +#. module: hr_commission_oca +#: model:ir.model,name:hr_commission_oca.model_res_partner +msgid "Contact" +msgstr "Contatto" + +#. module: hr_commission_oca +#: model:ir.model,name:hr_commission_oca.model_hr_employee +#: model:ir.model.fields,field_description:hr_commission_oca.field_res_partner__employee +#: model:ir.model.fields,field_description:hr_commission_oca.field_res_users__employee +msgid "Employee" +msgstr "Dipendente" + +#. module: hr_commission_oca +#: model_terms:ir.ui.view,arch_db:hr_commission_oca.view_settlement_form +msgid "Mark as invoiced" +msgstr "Segna come fatturato" + +#. module: hr_commission_oca +#: model:ir.model.fields,field_description:hr_commission_oca.field_res_partner__employee_id +msgid "Related Employee" +msgstr "Dipendente collegato" + +#. module: hr_commission_oca +#: model:ir.model.fields.selection,name:hr_commission_oca.selection__res_partner__agent_type__salesman +msgid "Salesman (employee)" +msgstr "Venditore (dipendente)" + +#. module: hr_commission_oca +#: model:ir.model,name:hr_commission_oca.model_commission_settlement +msgid "Settlement" +msgstr "Liquidazione" + +#. module: hr_commission_oca +#. odoo-python +#: code:addons/hr_commission_oca/models/res_partner.py:0 +msgid "" +"There must one (and only one) employee linked to this partner. To do this, " +"go to 'Employees' and create an Employee with a 'Related User' under 'HR " +"Settings'." +msgstr "" +"Ci deve essere un (e uno soltanto) dipendente collegato a questo partner. " +"Per far questo, accedere a 'Dipendenti' e creare un dipendente con un " +"'Utente collegato' in 'Impostazioni RU'." + +#. module: hr_commission_oca +#: model:ir.model.fields,field_description:hr_commission_oca.field_res_partner__agent_type +#: model:ir.model.fields,field_description:hr_commission_oca.field_res_users__agent_type +msgid "Type" +msgstr "Tipo" + +#. module: hr_commission_oca +#. odoo-python +#: code:addons/hr_commission_oca/models/hr_employee.py:0 +msgid "You can't remove the user, as it's linked to a commission agent." +msgstr "" +"Non si pu?? rimuovere l'utente, perch???? ?? collegato ad un agente " +"commissione." diff --git a/hr_commission_oca/i18n/pt_BR.po b/hr_commission_oca/i18n/pt_BR.po new file mode 100644 index 000000000..5e4f1973d --- /dev/null +++ b/hr_commission_oca/i18n/pt_BR.po @@ -0,0 +1,95 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * hr_commission +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 12.0\n" +"Report-Msgid-Bugs-To: \n" +"PO-Revision-Date: 2023-10-30 00:46+0000\n" +"Last-Translator: Adriano Prado \n" +"Language-Team: none\n" +"Language: pt_BR\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_commission_oca +#: model:ir.model.fields,help:hr_commission_oca.field_res_partner__employee +#: model:ir.model.fields,help:hr_commission_oca.field_res_users__employee +msgid "Check this box if this contact is an Employee." +msgstr "Marque esta caixa se este contato for um Funcion??rio." + +#. module: hr_commission_oca +#: model:ir.model,name:hr_commission_oca.model_res_partner +msgid "Contact" +msgstr "Contato" + +#. module: hr_commission_oca +#: model:ir.model,name:hr_commission_oca.model_hr_employee +#: model:ir.model.fields,field_description:hr_commission_oca.field_res_partner__employee +#: model:ir.model.fields,field_description:hr_commission_oca.field_res_users__employee +msgid "Employee" +msgstr "Funcionario" + +#. module: hr_commission_oca +#: model_terms:ir.ui.view,arch_db:hr_commission_oca.view_settlement_form +msgid "Mark as invoiced" +msgstr "Marcar como faturado" + +#. module: hr_commission_oca +#: model:ir.model.fields,field_description:hr_commission_oca.field_res_partner__employee_id +msgid "Related Employee" +msgstr "Funcion??rio Relacionado" + +#. module: hr_commission_oca +#: model:ir.model.fields.selection,name:hr_commission_oca.selection__res_partner__agent_type__salesman +msgid "Salesman (employee)" +msgstr "Vendedor (funcion??rio)" + +#. module: hr_commission_oca +#: model:ir.model,name:hr_commission_oca.model_commission_settlement +msgid "Settlement" +msgstr "Liquida????o" + +#. module: hr_commission_oca +#. odoo-python +#: code:addons/hr_commission_oca/models/res_partner.py:0 +msgid "" +"There must one (and only one) employee linked to this partner. To do this, " +"go to 'Employees' and create an Employee with a 'Related User' under 'HR " +"Settings'." +msgstr "" +"Deve haver um (e apenas um) funcion??rio vinculado a este parceiro. Para " +"fazer isso, v?? em ???Funcion??rios??? e crie um Funcion??rio com um ???Usu??" +"rio Relacionado??? em ???Configura????es de RH???." + +#. module: hr_commission_oca +#: model:ir.model.fields,field_description:hr_commission_oca.field_res_partner__agent_type +#: model:ir.model.fields,field_description:hr_commission_oca.field_res_users__agent_type +msgid "Type" +msgstr "Tipo" + +#. module: hr_commission_oca +#. odoo-python +#: code:addons/hr_commission_oca/models/hr_employee.py:0 +msgid "You can't remove the user, as it's linked to a commission agent." +msgstr "" +"Voc?? n??o pode remover o usu??rio, pois est?? ligado a um representante " +"comissionado." + +#~ msgid "Employee." +#~ msgstr "Funcionario." + +#~ msgid "External agent" +#~ msgstr "Agente externo" + +#, python-format +#~ msgid "" +#~ "There must one (and only one) employee linked to this partner. To do " +#~ "this, go to 'Human Resources' and check 'Employees'" +#~ msgstr "" +#~ "Deve haver um (e apenas um) funcion??rio ligado a este parceiro. Para " +#~ "fazer isso, v?? para 'Recursos Humanos' e verifique 'Funcion??rios'" diff --git a/hr_commission_oca/i18n/pt_PT.po b/hr_commission_oca/i18n/pt_PT.po new file mode 100644 index 000000000..1edf6bead --- /dev/null +++ b/hr_commission_oca/i18n/pt_PT.po @@ -0,0 +1,81 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * hr_commission +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 17.0\n" +"Report-Msgid-Bugs-To: \n" +"PO-Revision-Date: 2024-06-04 23:42+0000\n" +"Last-Translator: Pedro Castro Silva \n" +"Language-Team: none\n" +"Language: pt_PT\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_commission_oca +#: model:ir.model.fields,help:hr_commission_oca.field_res_partner__employee +#: model:ir.model.fields,help:hr_commission_oca.field_res_users__employee +msgid "Check this box if this contact is an Employee." +msgstr "Selecione esta opção se o contacto for um funcionário." + +#. module: hr_commission_oca +#: model:ir.model,name:hr_commission_oca.model_res_partner +msgid "Contact" +msgstr "Contacto" + +#. module: hr_commission_oca +#: model:ir.model,name:hr_commission_oca.model_hr_employee +#: model:ir.model.fields,field_description:hr_commission_oca.field_res_partner__employee +#: model:ir.model.fields,field_description:hr_commission_oca.field_res_users__employee +msgid "Employee" +msgstr "Funcionário" + +#. module: hr_commission_oca +#: model_terms:ir.ui.view,arch_db:hr_commission_oca.view_settlement_form +msgid "Mark as invoiced" +msgstr "Marcar como faturado" + +#. module: hr_commission_oca +#: model:ir.model.fields,field_description:hr_commission_oca.field_res_partner__employee_id +msgid "Related Employee" +msgstr "Funcionário Relacionado" + +#. module: hr_commission_oca +#: model:ir.model.fields.selection,name:hr_commission_oca.selection__res_partner__agent_type__salesman +msgid "Salesman (employee)" +msgstr "Vendedor (funcionário)" + +#. module: hr_commission_oca +#: model:ir.model,name:hr_commission_oca.model_commission_settlement +msgid "Settlement" +msgstr "Liquidação" + +#. module: hr_commission_oca +#. odoo-python +#: code:addons/hr_commission_oca/models/res_partner.py:0 +msgid "" +"There must one (and only one) employee linked to this partner. To do this, " +"go to 'Employees' and create an Employee with a 'Related User' under 'HR " +"Settings'." +msgstr "" +"Deve haver um (e apenas um) funcionário vinculado a este parceiro. Para " +"isso, vá a ‘Funcionários’ e crie um Funcionário com um ‘Utilizador " +"Relacionado’ em ‘Configurações de RH’." + +#. module: hr_commission_oca +#: model:ir.model.fields,field_description:hr_commission_oca.field_res_partner__agent_type +#: model:ir.model.fields,field_description:hr_commission_oca.field_res_users__agent_type +msgid "Type" +msgstr "Tipo" + +#. module: hr_commission_oca +#. odoo-python +#: code:addons/hr_commission_oca/models/hr_employee.py:0 +msgid "You can't remove the user, as it's linked to a commission agent." +msgstr "" +"Não é possível remover o utilizador, uma vez que este está vinculado a um " +"comissionista." diff --git a/hr_commission_oca/i18n/tr.po b/hr_commission_oca/i18n/tr.po new file mode 100644 index 000000000..0c0ee42a2 --- /dev/null +++ b/hr_commission_oca/i18n/tr.po @@ -0,0 +1,81 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * hr_commission +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 17.0\n" +"Report-Msgid-Bugs-To: \n" +"PO-Revision-Date: 2025-09-22 16:42+0000\n" +"Last-Translator: Tamer Sezgin \n" +"Language-Team: none\n" +"Language: tr\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 5.10.4\n" + +#. module: hr_commission_oca +#: model:ir.model.fields,help:hr_commission_oca.field_res_partner__employee +#: model:ir.model.fields,help:hr_commission_oca.field_res_users__employee +msgid "Check this box if this contact is an Employee." +msgstr "Bu kontak bir çalışan ise bu kutuyu işaretleyin." + +#. module: hr_commission_oca +#: model:ir.model,name:hr_commission_oca.model_res_partner +msgid "Contact" +msgstr "Kontak" + +#. module: hr_commission_oca +#: model:ir.model,name:hr_commission_oca.model_hr_employee +#: model:ir.model.fields,field_description:hr_commission_oca.field_res_partner__employee +#: model:ir.model.fields,field_description:hr_commission_oca.field_res_users__employee +msgid "Employee" +msgstr "Personel" + +#. module: hr_commission_oca +#: model_terms:ir.ui.view,arch_db:hr_commission_oca.view_settlement_form +msgid "Mark as invoiced" +msgstr "Faturalandı olarak işaretle" + +#. module: hr_commission_oca +#: model:ir.model.fields,field_description:hr_commission_oca.field_res_partner__employee_id +msgid "Related Employee" +msgstr "İlişkili Çalışan" + +#. module: hr_commission_oca +#: model:ir.model.fields.selection,name:hr_commission_oca.selection__res_partner__agent_type__salesman +msgid "Salesman (employee)" +msgstr "Satış Görevlisi(çalışan)" + +#. module: hr_commission_oca +#: model:ir.model,name:hr_commission_oca.model_commission_settlement +msgid "Settlement" +msgstr "Anlaşma" + +#. module: hr_commission_oca +#. odoo-python +#: code:addons/hr_commission_oca/models/res_partner.py:0 +msgid "" +"There must one (and only one) employee linked to this partner. To do this, " +"go to 'Employees' and create an Employee with a 'Related User' under 'HR " +"Settings'." +msgstr "" +"Bu iş ortağına bağlı bir (ve yalnızca bir) çalışan olmalıdır. Bunu yapmak " +"için 'Çalışanlar' bölümüne gidin ve 'İK Ayarları' altında 'İlgili Kullanıcı' " +"ile bir Çalışan oluşturun." + +#. module: hr_commission_oca +#: model:ir.model.fields,field_description:hr_commission_oca.field_res_partner__agent_type +#: model:ir.model.fields,field_description:hr_commission_oca.field_res_users__agent_type +msgid "Type" +msgstr "Tür" + +#. module: hr_commission_oca +#. odoo-python +#: code:addons/hr_commission_oca/models/hr_employee.py:0 +msgid "You can't remove the user, as it's linked to a commission agent." +msgstr "" +"Kullanıcıyı kaldıramazsınız, çünkü bir komisyon aracısı ile " +"ilişkilendirilmiş." diff --git a/hr_commission_oca/models/__init__.py b/hr_commission_oca/models/__init__.py new file mode 100644 index 000000000..20961d7bc --- /dev/null +++ b/hr_commission_oca/models/__init__.py @@ -0,0 +1,3 @@ +from . import hr_employee +from . import res_partner +from . import sale_commission_settlement diff --git a/hr_commission_oca/models/hr_employee.py b/hr_commission_oca/models/hr_employee.py new file mode 100644 index 000000000..6eca89f18 --- /dev/null +++ b/hr_commission_oca/models/hr_employee.py @@ -0,0 +1,21 @@ +# Copyright 2018 Tecnativa - Pedro M. Baeza +# License AGPL-3 - See https://www.gnu.org/licenses/agpl-3.0.html + +from odoo import exceptions, models + + +class HrEmployee(models.Model): + _inherit = "hr.employee" + + def write(self, vals): + """Check if there's an agent linked to that employee.""" + if "user_id" in vals and not vals["user_id"]: + for emp in self: + if emp.user_id.partner_id.agent_type == "salesman": + raise exceptions.ValidationError( + self.env._( + "You can't remove the user, as it's linked to " + "a commission agent." + ) + ) + return super().write(vals) diff --git a/hr_commission_oca/models/res_partner.py b/hr_commission_oca/models/res_partner.py new file mode 100644 index 000000000..d840d3177 --- /dev/null +++ b/hr_commission_oca/models/res_partner.py @@ -0,0 +1,39 @@ +# Copyright 2015-2018 Tecnativa - Pedro M. Baeza +# Copyright 2021 Tecnativa - Jo??o Marques +# License AGPL-3 - See https://www.gnu.org/licenses/agpl-3.0.html + +from odoo import api, exceptions, fields, models + + +class ResPartner(models.Model): + _inherit = "res.partner" + + agent_type = fields.Selection( + selection_add=[("salesman", "Salesman (employee)")], + ) + employee_id = fields.Many2one( + string="Related Employee", + comodel_name="hr.employee", + compute="_compute_employee_id", + compute_sudo=True, + ) + + @api.depends("user_ids") + def _compute_employee_id(self): + for partner in self: + if len(partner.user_ids) == 1 and partner.user_ids[0].employee_ids: + partner.employee_id = partner.user_ids[0].employee_ids[0] + else: + partner.employee_id = False + + @api.constrains("agent_type") + def _check_employee(self): + for partner in self: + if partner.agent_type == "salesman" and not partner.employee_id: + raise exceptions.ValidationError( + self.env._( + "There must one (and only one) employee linked to this " + "partner. To do this, go to 'Employees' and create an " + "Employee with a 'Related User' under 'HR Settings'." + ) + ) diff --git a/hr_commission_oca/models/sale_commission_settlement.py b/hr_commission_oca/models/sale_commission_settlement.py new file mode 100644 index 000000000..4e38dcf3d --- /dev/null +++ b/hr_commission_oca/models/sale_commission_settlement.py @@ -0,0 +1,11 @@ +# Copyright 2020 Tecnativa - Pedro M. Baeza +# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). + +from odoo import models + + +class CommissionSettlement(models.Model): + _inherit = "commission.settlement" + + def mark_as_invoiced(self): + self.write({"state": "invoiced"}) diff --git a/hr_commission_oca/pyproject.toml b/hr_commission_oca/pyproject.toml new file mode 100644 index 000000000..4231d0ccc --- /dev/null +++ b/hr_commission_oca/pyproject.toml @@ -0,0 +1,3 @@ +[build-system] +requires = ["whool"] +build-backend = "whool.buildapi" diff --git a/hr_commission_oca/readme/CONTRIBUTORS.md b/hr_commission_oca/readme/CONTRIBUTORS.md new file mode 100644 index 000000000..180b00ade --- /dev/null +++ b/hr_commission_oca/readme/CONTRIBUTORS.md @@ -0,0 +1,7 @@ +- [Tecnativa](https://www.tecnativa.com) + - Pedro M. Baeza + - João Marques + - Ernesto García + - David Bañón Gil +- Rattapong C. \<\> +- Mina S. Wahib diff --git a/hr_commission_oca/readme/DESCRIPTION.md b/hr_commission_oca/readme/DESCRIPTION.md new file mode 100644 index 000000000..c50ffb86a --- /dev/null +++ b/hr_commission_oca/readme/DESCRIPTION.md @@ -0,0 +1,7 @@ +This module links sale_commission with hr module. For now, it only adds +another type of agent whose commissions are not invoiced in the +corresponding wizard. + +It also computes the Boolean field "employee" in ResPartner to be +updated according to the ResPartner-HrEmployee relation that was +created. diff --git a/hr_commission_oca/readme/ROADMAP.md b/hr_commission_oca/readme/ROADMAP.md new file mode 100644 index 000000000..e9b351f0b --- /dev/null +++ b/hr_commission_oca/readme/ROADMAP.md @@ -0,0 +1,2 @@ +- Add demo data. +- Link settlements with wages. diff --git a/hr_commission_oca/static/description/icon.png b/hr_commission_oca/static/description/icon.png new file mode 100644 index 000000000..26b979afb Binary files /dev/null and b/hr_commission_oca/static/description/icon.png differ diff --git a/hr_commission_oca/static/description/icon.svg b/hr_commission_oca/static/description/icon.svg new file mode 100644 index 000000000..0dca35dc0 --- /dev/null +++ b/hr_commission_oca/static/description/icon.svg @@ -0,0 +1,148 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/hr_commission_oca/static/description/index.html b/hr_commission_oca/static/description/index.html new file mode 100644 index 000000000..21cc3cef9 --- /dev/null +++ b/hr_commission_oca/static/description/index.html @@ -0,0 +1,450 @@ + + + + + +README.rst + + + +
+ + + +Odoo Community Association + +
+

HR commissions OCA

+ +

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

+

This module links sale_commission with hr module. For now, it only adds +another type of agent whose commissions are not invoiced in the +corresponding wizard.

+

It also computes the Boolean field “employee” in ResPartner to be +updated according to the ResPartner-HrEmployee relation that was +created.

+

Table of contents

+ +
+

Known issues / Roadmap

+
    +
  • Add demo data.
  • +
  • Link settlements with wages.
  • +
+
+
+

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

+
    +
  • Tecnativa
  • +
+
+
+

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.

+

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

+

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

+
+
+
+
+ + diff --git a/hr_commission_oca/tests/__init__.py b/hr_commission_oca/tests/__init__.py new file mode 100644 index 000000000..c8eaa6127 --- /dev/null +++ b/hr_commission_oca/tests/__init__.py @@ -0,0 +1 @@ +from . import test_hr_commission diff --git a/hr_commission_oca/tests/test_hr_commission.py b/hr_commission_oca/tests/test_hr_commission.py new file mode 100644 index 000000000..b6cdc7234 --- /dev/null +++ b/hr_commission_oca/tests/test_hr_commission.py @@ -0,0 +1,55 @@ +# Copyright 2018 Tecnativa - Pedro M. Baeza +# License AGPL-3 - See https://www.gnu.org/licenses/agpl-3.0.html + +from odoo import exceptions +from odoo.tests import new_test_user + +from odoo.addons.commission_oca.tests.test_commission import TestCommissionBase + + +class TestHrCommission(TestCommissionBase): + @classmethod + def setUpClass(cls): + super().setUpClass() + cls.env = cls.env(context=dict(cls.env.context, tracking_disable=True)) + cls.employee = cls.env["hr.employee"].create({"name": "Test employee"}) + cls.user = new_test_user( + cls.env, name="Test user", login="test_hr_commission@example.org" + ) + cls.partner = cls.user.partner_id + + def test_hr_commission(self): + self.assertFalse(self.partner.employee_id) + with self.assertRaises(exceptions.ValidationError): + self.partner.agent_type = "salesman" + self.employee.user_id = self.user.id + self.assertEqual(self.partner.employee_id, self.employee) + # This shouldn't trigger exception now + self.partner.agent_type = "salesman" + self.assertTrue(self.partner.employee) + # Check that un-assigning user in employee, it raises the constraint + with self.assertRaises(exceptions.ValidationError): + self.employee.user_id = False + + def test_remove_user_not_salesman(self): + """Removing user from a non-salesman employee should not raise.""" + other_user = new_test_user( + self.env, + name="Other user", + login="other_hr_commission@example.org", + ) + other_employee = self.env["hr.employee"].create( + {"name": "Other employee", "user_id": other_user.id} + ) + # Should NOT raise - partner is not a commission salesman + other_employee.user_id = False + self.assertFalse(other_employee.user_id) + + def test_mark_to_invoice(self): + settlements = self._create_settlement( + self.partner, + self.commission_section_paid, + ) + self.assertEqual(settlements.state, "settled") + settlements.mark_as_invoiced() + self.assertEqual(settlements.state, "invoiced") diff --git a/hr_commission_oca/views/res_partner_view.xml b/hr_commission_oca/views/res_partner_view.xml new file mode 100644 index 000000000..87663ca90 --- /dev/null +++ b/hr_commission_oca/views/res_partner_view.xml @@ -0,0 +1,12 @@ + + + + res.partner + + + + + + + + diff --git a/hr_commission_oca/views/sale_commission_settlement_views.xml b/hr_commission_oca/views/sale_commission_settlement_views.xml new file mode 100644 index 000000000..034edf51b --- /dev/null +++ b/hr_commission_oca/views/sale_commission_settlement_views.xml @@ -0,0 +1,19 @@ + + + + Settlements - Add "Mark as invoiced" button + commission.settlement + + + + + +