diff --git a/crm_claim_code/README.rst b/crm_claim_code/README.rst new file mode 100644 index 00000000000..89a40b34de9 --- /dev/null +++ b/crm_claim_code/README.rst @@ -0,0 +1,94 @@ +========================== +Sequential Code for Claims +========================== + +.. + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + !! This file is generated by oca-gen-addon-readme !! + !! changes will be overwritten. !! + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + !! source digest: sha256:9afa3e7e4d192a290459cd6986e91e9ba7053feef16422119113f03c374c7882 + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +.. |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%2Fcrm-lightgray.png?logo=github + :target: https://github.com/OCA/crm/tree/15.0/crm_claim_code + :alt: OCA/crm +.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png + :target: https://translation.odoo-community.org/projects/crm-15-0/crm-15-0-crm_claim_code + :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/crm&target_branch=15.0 + :alt: Try me on Runboat + +|badge1| |badge2| |badge3| |badge4| |badge5| + +* This module adds a sequential code for claims. + +**Table of contents** + +.. contents:: + :local: + +Usage +===== + +To use this module, you need to: + +* Go to menu **CRM > After Sale > Claims** and create a new claim. +* Enter claim subject and Save it. You must see a new number for this claim. + +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 +~~~~~~~ + +* AvanzOSC +* Tecnativa + +Contributors +~~~~~~~~~~~~ + +* Ana Juaristi +* Iker Coranti +* Oihane Crucelaegui +* Alfredo de la Fuente +* Tharathip Chaweewongphan +* `Tecnativa `_: + + * Ernesto Tejeda + * Pedro M. Baeza + * Vicent Cubells + +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/crm `_ project on GitHub. + +You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute. diff --git a/crm_claim_code/__init__.py b/crm_claim_code/__init__.py new file mode 100644 index 00000000000..ad5146ec712 --- /dev/null +++ b/crm_claim_code/__init__.py @@ -0,0 +1,4 @@ +# License LGPL-3.0 or later (https://www.gnu.org/licenses/lgpl). + +from . import models +from .hooks import create_code_equal_to_id, assign_old_sequences diff --git a/crm_claim_code/__manifest__.py b/crm_claim_code/__manifest__.py new file mode 100644 index 00000000000..2169a49065a --- /dev/null +++ b/crm_claim_code/__manifest__.py @@ -0,0 +1,18 @@ +# Copyright 2015-2018 Tecnativa - Pedro M. Baeza +# Copyright 2015 AvanzOsc (http://www.avanzosc.es) +# Copyright 2017 Tecnativa - Vicent Cubells +# License LGPL-3.0 or later (https://www.gnu.org/licenses/lgpl). + +{ + "name": "Sequential Code for Claims", + "version": "15.0.1.0.0", + "category": "Customer Relationship Management", + "author": "AvanzOSC, Tecnativa, Odoo Community Association (OCA)", + "website": "https://github.com/OCA/crm", + "license": "AGPL-3", + "depends": ["crm_claim"], + "data": ["views/crm_claim_view.xml", "data/claim_sequence.xml"], + "installable": True, + "pre_init_hook": "create_code_equal_to_id", + "post_init_hook": "assign_old_sequences", +} diff --git a/crm_claim_code/data/claim_sequence.xml b/crm_claim_code/data/claim_sequence.xml new file mode 100644 index 00000000000..1e3a515679b --- /dev/null +++ b/crm_claim_code/data/claim_sequence.xml @@ -0,0 +1,9 @@ + + + + Claim Code + crm.claim + + CLM + + diff --git a/crm_claim_code/hooks.py b/crm_claim_code/hooks.py new file mode 100644 index 00000000000..5a07394cb7d --- /dev/null +++ b/crm_claim_code/hooks.py @@ -0,0 +1,32 @@ +# License LGPL-3.0 or later (https://www.gnu.org/licenses/lgpl). + +from odoo import SUPERUSER_ID +from odoo.api import Environment + +new_field_code_added = False + + +def create_code_equal_to_id(cr): + cr.execute( + "SELECT column_name FROM information_schema.columns " + "WHERE table_name = 'crm_claim' AND column_name = 'code'" + ) + if not cr.fetchone(): + cr.execute("ALTER TABLE crm_claim ADD COLUMN code character varying;") + cr.execute("UPDATE crm_claim SET code = id;") + global new_field_code_added + new_field_code_added = True + + +def assign_old_sequences(cr, registry): + if not new_field_code_added: + # the field was already existing before the installation of the addon + return + + env = Environment(cr, SUPERUSER_ID, {}) + + sequence_model = env["ir.sequence"] + + claims = env["crm.claim"].search([], order="id") + for claim in claims: + claim.code = sequence_model.next_by_code("crm.claim") diff --git a/crm_claim_code/i18n/bg.po b/crm_claim_code/i18n/bg.po new file mode 100644 index 00000000000..de4a709bd34 --- /dev/null +++ b/crm_claim_code/i18n/bg.po @@ -0,0 +1,47 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * crm_claim_code +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 10.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2017-09-05 16:00+0000\n" +"PO-Revision-Date: 2017-09-05 16:00+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: crm_claim_code +#: model:ir.model,name:crm_claim_code.model_crm_claim +msgid "Claim" +msgstr "Жалба" + +#. module: crm_claim_code +#: model:ir.model.fields,field_description:crm_claim_code.field_crm_claim__code +msgid "Claim Number" +msgstr "Жалба Номер" + +#. module: crm_claim_code +#: model:ir.model.fields,field_description:crm_claim_code.field_crm_claim__display_name +msgid "Display Name" +msgstr "" + +#. module: crm_claim_code +#: model:ir.model.fields,field_description:crm_claim_code.field_crm_claim__id +msgid "ID" +msgstr "" + +#. module: crm_claim_code +#: model:ir.model.fields,field_description:crm_claim_code.field_crm_claim____last_update +msgid "Last Modified on" +msgstr "" + +#. module: crm_claim_code +#: model:ir.model.constraint,message:crm_claim_code.constraint_crm_claim_crm_claim_unique_code +msgid "The code must be unique!" +msgstr "Номерът трябва да е уникален!" diff --git a/crm_claim_code/i18n/crm_claim_code.pot b/crm_claim_code/i18n/crm_claim_code.pot new file mode 100644 index 00000000000..df276cc0c95 --- /dev/null +++ b/crm_claim_code/i18n/crm_claim_code.pot @@ -0,0 +1,44 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * crm_claim_code +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 14.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: crm_claim_code +#: model:ir.model,name:crm_claim_code.model_crm_claim +msgid "Claim" +msgstr "" + +#. module: crm_claim_code +#: model:ir.model.fields,field_description:crm_claim_code.field_crm_claim__code +msgid "Claim Number" +msgstr "" + +#. module: crm_claim_code +#: model:ir.model.fields,field_description:crm_claim_code.field_crm_claim__display_name +msgid "Display Name" +msgstr "" + +#. module: crm_claim_code +#: model:ir.model.fields,field_description:crm_claim_code.field_crm_claim__id +msgid "ID" +msgstr "" + +#. module: crm_claim_code +#: model:ir.model.fields,field_description:crm_claim_code.field_crm_claim____last_update +msgid "Last Modified on" +msgstr "" + +#. module: crm_claim_code +#: model:ir.model.constraint,message:crm_claim_code.constraint_crm_claim_crm_claim_unique_code +msgid "The code must be unique!" +msgstr "" diff --git a/crm_claim_code/i18n/de.po b/crm_claim_code/i18n/de.po new file mode 100644 index 00000000000..376b932afd1 --- /dev/null +++ b/crm_claim_code/i18n/de.po @@ -0,0 +1,47 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * crm_claim_code +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 10.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2017-09-05 16:00+0000\n" +"PO-Revision-Date: 2017-09-05 16:00+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: crm_claim_code +#: model:ir.model,name:crm_claim_code.model_crm_claim +msgid "Claim" +msgstr "Forderung" + +#. module: crm_claim_code +#: model:ir.model.fields,field_description:crm_claim_code.field_crm_claim__code +msgid "Claim Number" +msgstr "Forderungsnummer" + +#. module: crm_claim_code +#: model:ir.model.fields,field_description:crm_claim_code.field_crm_claim__display_name +msgid "Display Name" +msgstr "" + +#. module: crm_claim_code +#: model:ir.model.fields,field_description:crm_claim_code.field_crm_claim__id +msgid "ID" +msgstr "" + +#. module: crm_claim_code +#: model:ir.model.fields,field_description:crm_claim_code.field_crm_claim____last_update +msgid "Last Modified on" +msgstr "" + +#. module: crm_claim_code +#: model:ir.model.constraint,message:crm_claim_code.constraint_crm_claim_crm_claim_unique_code +msgid "The code must be unique!" +msgstr "Der Schlüssel muss eindeutig sein!" diff --git a/crm_claim_code/i18n/es.po b/crm_claim_code/i18n/es.po new file mode 100644 index 00000000000..133e0740de5 --- /dev/null +++ b/crm_claim_code/i18n/es.po @@ -0,0 +1,50 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * crm_claim_code +# +# Translators: +# enjolras , 2018 +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 10.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2018-01-06 01:53+0000\n" +"PO-Revision-Date: 2024-02-17 10:33+0000\n" +"Last-Translator: Ivorra78 \n" +"Language-Team: Spanish (https://www.transifex.com/oca/teams/23907/es/)\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: crm_claim_code +#: model:ir.model,name:crm_claim_code.model_crm_claim +msgid "Claim" +msgstr "Reclamación" + +#. module: crm_claim_code +#: model:ir.model.fields,field_description:crm_claim_code.field_crm_claim__code +msgid "Claim Number" +msgstr "Número de reclamación" + +#. module: crm_claim_code +#: model:ir.model.fields,field_description:crm_claim_code.field_crm_claim__display_name +msgid "Display Name" +msgstr "Mostrar Nombre" + +#. module: crm_claim_code +#: model:ir.model.fields,field_description:crm_claim_code.field_crm_claim__id +msgid "ID" +msgstr "ID" + +#. module: crm_claim_code +#: model:ir.model.fields,field_description:crm_claim_code.field_crm_claim____last_update +msgid "Last Modified on" +msgstr "Última Modificación el" + +#. module: crm_claim_code +#: model:ir.model.constraint,message:crm_claim_code.constraint_crm_claim_crm_claim_unique_code +msgid "The code must be unique!" +msgstr "¡El código debe ser único!" diff --git a/crm_claim_code/i18n/es_MX.po b/crm_claim_code/i18n/es_MX.po new file mode 100644 index 00000000000..8ce08b0dc45 --- /dev/null +++ b/crm_claim_code/i18n/es_MX.po @@ -0,0 +1,47 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * crm_claim_code +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 10.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2017-09-05 16:00+0000\n" +"PO-Revision-Date: 2017-09-05 16:00+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: crm_claim_code +#: model:ir.model,name:crm_claim_code.model_crm_claim +msgid "Claim" +msgstr "Reclamo" + +#. module: crm_claim_code +#: model:ir.model.fields,field_description:crm_claim_code.field_crm_claim__code +msgid "Claim Number" +msgstr "" + +#. module: crm_claim_code +#: model:ir.model.fields,field_description:crm_claim_code.field_crm_claim__display_name +msgid "Display Name" +msgstr "" + +#. module: crm_claim_code +#: model:ir.model.fields,field_description:crm_claim_code.field_crm_claim__id +msgid "ID" +msgstr "" + +#. module: crm_claim_code +#: model:ir.model.fields,field_description:crm_claim_code.field_crm_claim____last_update +msgid "Last Modified on" +msgstr "" + +#. module: crm_claim_code +#: model:ir.model.constraint,message:crm_claim_code.constraint_crm_claim_crm_claim_unique_code +msgid "The code must be unique!" +msgstr "" diff --git a/crm_claim_code/i18n/es_VE.po b/crm_claim_code/i18n/es_VE.po new file mode 100644 index 00000000000..8ce08b0dc45 --- /dev/null +++ b/crm_claim_code/i18n/es_VE.po @@ -0,0 +1,47 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * crm_claim_code +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 10.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2017-09-05 16:00+0000\n" +"PO-Revision-Date: 2017-09-05 16:00+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: crm_claim_code +#: model:ir.model,name:crm_claim_code.model_crm_claim +msgid "Claim" +msgstr "Reclamo" + +#. module: crm_claim_code +#: model:ir.model.fields,field_description:crm_claim_code.field_crm_claim__code +msgid "Claim Number" +msgstr "" + +#. module: crm_claim_code +#: model:ir.model.fields,field_description:crm_claim_code.field_crm_claim__display_name +msgid "Display Name" +msgstr "" + +#. module: crm_claim_code +#: model:ir.model.fields,field_description:crm_claim_code.field_crm_claim__id +msgid "ID" +msgstr "" + +#. module: crm_claim_code +#: model:ir.model.fields,field_description:crm_claim_code.field_crm_claim____last_update +msgid "Last Modified on" +msgstr "" + +#. module: crm_claim_code +#: model:ir.model.constraint,message:crm_claim_code.constraint_crm_claim_crm_claim_unique_code +msgid "The code must be unique!" +msgstr "" diff --git a/crm_claim_code/i18n/fr.po b/crm_claim_code/i18n/fr.po new file mode 100644 index 00000000000..ce64fe5b8ae --- /dev/null +++ b/crm_claim_code/i18n/fr.po @@ -0,0 +1,47 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * crm_claim_code +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 10.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2017-09-05 16:00+0000\n" +"PO-Revision-Date: 2017-09-05 16:00+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: crm_claim_code +#: model:ir.model,name:crm_claim_code.model_crm_claim +msgid "Claim" +msgstr "Réclamation" + +#. module: crm_claim_code +#: model:ir.model.fields,field_description:crm_claim_code.field_crm_claim__code +msgid "Claim Number" +msgstr "" + +#. module: crm_claim_code +#: model:ir.model.fields,field_description:crm_claim_code.field_crm_claim__display_name +msgid "Display Name" +msgstr "" + +#. module: crm_claim_code +#: model:ir.model.fields,field_description:crm_claim_code.field_crm_claim__id +msgid "ID" +msgstr "" + +#. module: crm_claim_code +#: model:ir.model.fields,field_description:crm_claim_code.field_crm_claim____last_update +msgid "Last Modified on" +msgstr "" + +#. module: crm_claim_code +#: model:ir.model.constraint,message:crm_claim_code.constraint_crm_claim_crm_claim_unique_code +msgid "The code must be unique!" +msgstr "Le code doit être unique!" diff --git a/crm_claim_code/i18n/hr.po b/crm_claim_code/i18n/hr.po new file mode 100644 index 00000000000..e947e8a5456 --- /dev/null +++ b/crm_claim_code/i18n/hr.po @@ -0,0 +1,49 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * crm_claim_code +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 10.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2017-09-05 16:00+0000\n" +"PO-Revision-Date: 2019-11-13 15:34+0000\n" +"Last-Translator: Bole \n" +"Language-Team: \n" +"Language: hr\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Plural-Forms: nplurals=3; plural=n%10==1 && n%100!=11 ? 0 : n%10>=2 && n" +"%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2;\n" +"X-Generator: Weblate 3.8\n" + +#. module: crm_claim_code +#: model:ir.model,name:crm_claim_code.model_crm_claim +msgid "Claim" +msgstr "Potraživanje" + +#. module: crm_claim_code +#: model:ir.model.fields,field_description:crm_claim_code.field_crm_claim__code +msgid "Claim Number" +msgstr "Broj zahtjeva" + +#. module: crm_claim_code +#: model:ir.model.fields,field_description:crm_claim_code.field_crm_claim__display_name +msgid "Display Name" +msgstr "" + +#. module: crm_claim_code +#: model:ir.model.fields,field_description:crm_claim_code.field_crm_claim__id +msgid "ID" +msgstr "" + +#. module: crm_claim_code +#: model:ir.model.fields,field_description:crm_claim_code.field_crm_claim____last_update +msgid "Last Modified on" +msgstr "" + +#. module: crm_claim_code +#: model:ir.model.constraint,message:crm_claim_code.constraint_crm_claim_crm_claim_unique_code +msgid "The code must be unique!" +msgstr "Šifra mora biti jedinstvena!" diff --git a/crm_claim_code/i18n/it.po b/crm_claim_code/i18n/it.po new file mode 100644 index 00000000000..7358b39cb64 --- /dev/null +++ b/crm_claim_code/i18n/it.po @@ -0,0 +1,47 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * crm_claim_code +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 12.0\n" +"Report-Msgid-Bugs-To: \n" +"PO-Revision-Date: 2023-10-11 08:36+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: crm_claim_code +#: model:ir.model,name:crm_claim_code.model_crm_claim +msgid "Claim" +msgstr "Reclamo" + +#. module: crm_claim_code +#: model:ir.model.fields,field_description:crm_claim_code.field_crm_claim__code +msgid "Claim Number" +msgstr "Numero reclamo" + +#. module: crm_claim_code +#: model:ir.model.fields,field_description:crm_claim_code.field_crm_claim__display_name +msgid "Display Name" +msgstr "Nome visualizzato" + +#. module: crm_claim_code +#: model:ir.model.fields,field_description:crm_claim_code.field_crm_claim__id +msgid "ID" +msgstr "ID" + +#. module: crm_claim_code +#: model:ir.model.fields,field_description:crm_claim_code.field_crm_claim____last_update +msgid "Last Modified on" +msgstr "Ultima modifica il" + +#. module: crm_claim_code +#: model:ir.model.constraint,message:crm_claim_code.constraint_crm_claim_crm_claim_unique_code +msgid "The code must be unique!" +msgstr "Il codice deve essere univoco!" diff --git a/crm_claim_code/i18n/nb.po b/crm_claim_code/i18n/nb.po new file mode 100644 index 00000000000..66f391cdfea --- /dev/null +++ b/crm_claim_code/i18n/nb.po @@ -0,0 +1,47 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * crm_claim_code +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 10.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2017-09-05 16:00+0000\n" +"PO-Revision-Date: 2017-09-05 16:00+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: crm_claim_code +#: model:ir.model,name:crm_claim_code.model_crm_claim +msgid "Claim" +msgstr "Reklamasjon" + +#. module: crm_claim_code +#: model:ir.model.fields,field_description:crm_claim_code.field_crm_claim__code +msgid "Claim Number" +msgstr "" + +#. module: crm_claim_code +#: model:ir.model.fields,field_description:crm_claim_code.field_crm_claim__display_name +msgid "Display Name" +msgstr "" + +#. module: crm_claim_code +#: model:ir.model.fields,field_description:crm_claim_code.field_crm_claim__id +msgid "ID" +msgstr "" + +#. module: crm_claim_code +#: model:ir.model.fields,field_description:crm_claim_code.field_crm_claim____last_update +msgid "Last Modified on" +msgstr "" + +#. module: crm_claim_code +#: model:ir.model.constraint,message:crm_claim_code.constraint_crm_claim_crm_claim_unique_code +msgid "The code must be unique!" +msgstr "" diff --git a/crm_claim_code/i18n/pt_BR.po b/crm_claim_code/i18n/pt_BR.po new file mode 100644 index 00000000000..72489dee2ab --- /dev/null +++ b/crm_claim_code/i18n/pt_BR.po @@ -0,0 +1,48 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * crm_claim_code +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 10.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2017-09-05 16:00+0000\n" +"PO-Revision-Date: 2024-05-23 16:58+0000\n" +"Last-Translator: Marcel Savegnago \n" +"Language-Team: \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: crm_claim_code +#: model:ir.model,name:crm_claim_code.model_crm_claim +msgid "Claim" +msgstr "Reclamação" + +#. module: crm_claim_code +#: model:ir.model.fields,field_description:crm_claim_code.field_crm_claim__code +msgid "Claim Number" +msgstr "Número de reclamação" + +#. module: crm_claim_code +#: model:ir.model.fields,field_description:crm_claim_code.field_crm_claim__display_name +msgid "Display Name" +msgstr "Nome Exibido" + +#. module: crm_claim_code +#: model:ir.model.fields,field_description:crm_claim_code.field_crm_claim__id +msgid "ID" +msgstr "" + +#. module: crm_claim_code +#: model:ir.model.fields,field_description:crm_claim_code.field_crm_claim____last_update +msgid "Last Modified on" +msgstr "" + +#. module: crm_claim_code +#: model:ir.model.constraint,message:crm_claim_code.constraint_crm_claim_crm_claim_unique_code +msgid "The code must be unique!" +msgstr "O código deve ser único!" diff --git a/crm_claim_code/i18n/sk.po b/crm_claim_code/i18n/sk.po new file mode 100644 index 00000000000..8033bcf5204 --- /dev/null +++ b/crm_claim_code/i18n/sk.po @@ -0,0 +1,47 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * crm_claim_code +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 10.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2017-09-05 16:00+0000\n" +"PO-Revision-Date: 2017-09-05 16:00+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: crm_claim_code +#: model:ir.model,name:crm_claim_code.model_crm_claim +msgid "Claim" +msgstr "Reklamácia" + +#. module: crm_claim_code +#: model:ir.model.fields,field_description:crm_claim_code.field_crm_claim__code +msgid "Claim Number" +msgstr "Číslo Reklamácie" + +#. module: crm_claim_code +#: model:ir.model.fields,field_description:crm_claim_code.field_crm_claim__display_name +msgid "Display Name" +msgstr "" + +#. module: crm_claim_code +#: model:ir.model.fields,field_description:crm_claim_code.field_crm_claim__id +msgid "ID" +msgstr "" + +#. module: crm_claim_code +#: model:ir.model.fields,field_description:crm_claim_code.field_crm_claim____last_update +msgid "Last Modified on" +msgstr "" + +#. module: crm_claim_code +#: model:ir.model.constraint,message:crm_claim_code.constraint_crm_claim_crm_claim_unique_code +msgid "The code must be unique!" +msgstr "Kód musí byť jedinečný!" diff --git a/crm_claim_code/i18n/sl.po b/crm_claim_code/i18n/sl.po new file mode 100644 index 00000000000..d0b0fc55134 --- /dev/null +++ b/crm_claim_code/i18n/sl.po @@ -0,0 +1,49 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * crm_claim_code +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 10.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2017-09-05 16:00+0000\n" +"PO-Revision-Date: 2020-08-11 15:59+0000\n" +"Last-Translator: Matjaz Mozetic \n" +"Language-Team: \n" +"Language: sl\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Plural-Forms: nplurals=4; plural=n%100==1 ? 0 : n%100==2 ? 1 : n%100==3 || n" +"%100==4 ? 2 : 3;\n" +"X-Generator: Weblate 3.10\n" + +#. module: crm_claim_code +#: model:ir.model,name:crm_claim_code.model_crm_claim +msgid "Claim" +msgstr "Zahtevek" + +#. module: crm_claim_code +#: model:ir.model.fields,field_description:crm_claim_code.field_crm_claim__code +msgid "Claim Number" +msgstr "Številka zahtevka" + +#. module: crm_claim_code +#: model:ir.model.fields,field_description:crm_claim_code.field_crm_claim__display_name +msgid "Display Name" +msgstr "" + +#. module: crm_claim_code +#: model:ir.model.fields,field_description:crm_claim_code.field_crm_claim__id +msgid "ID" +msgstr "" + +#. module: crm_claim_code +#: model:ir.model.fields,field_description:crm_claim_code.field_crm_claim____last_update +msgid "Last Modified on" +msgstr "" + +#. module: crm_claim_code +#: model:ir.model.constraint,message:crm_claim_code.constraint_crm_claim_crm_claim_unique_code +msgid "The code must be unique!" +msgstr "Koda mora biti unikatna!" diff --git a/crm_claim_code/i18n/sv.po b/crm_claim_code/i18n/sv.po new file mode 100644 index 00000000000..defde1f6666 --- /dev/null +++ b/crm_claim_code/i18n/sv.po @@ -0,0 +1,47 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * crm_claim_code +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 10.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2017-09-05 16:00+0000\n" +"PO-Revision-Date: 2017-09-05 16:00+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: crm_claim_code +#: model:ir.model,name:crm_claim_code.model_crm_claim +msgid "Claim" +msgstr "Reklamation" + +#. module: crm_claim_code +#: model:ir.model.fields,field_description:crm_claim_code.field_crm_claim__code +msgid "Claim Number" +msgstr "" + +#. module: crm_claim_code +#: model:ir.model.fields,field_description:crm_claim_code.field_crm_claim__display_name +msgid "Display Name" +msgstr "" + +#. module: crm_claim_code +#: model:ir.model.fields,field_description:crm_claim_code.field_crm_claim__id +msgid "ID" +msgstr "" + +#. module: crm_claim_code +#: model:ir.model.fields,field_description:crm_claim_code.field_crm_claim____last_update +msgid "Last Modified on" +msgstr "" + +#. module: crm_claim_code +#: model:ir.model.constraint,message:crm_claim_code.constraint_crm_claim_crm_claim_unique_code +msgid "The code must be unique!" +msgstr "" diff --git a/crm_claim_code/models/__init__.py b/crm_claim_code/models/__init__.py new file mode 100644 index 00000000000..d61016c746e --- /dev/null +++ b/crm_claim_code/models/__init__.py @@ -0,0 +1,3 @@ +# License LGPL-3.0 or later (https://www.gnu.org/licenses/lgpl). + +from . import crm_claim diff --git a/crm_claim_code/models/crm_claim.py b/crm_claim_code/models/crm_claim.py new file mode 100644 index 00000000000..e26b9840fdd --- /dev/null +++ b/crm_claim_code/models/crm_claim.py @@ -0,0 +1,28 @@ +# Copyright 2015 Tecnativa - Pedro M. Baeza +# Copyright 2015 AvanzOsc (http://www.avanzosc.es) +# Copyright 2017 Tecnativa - Vicent Cubells +# License LGPL-3.0 or later (https://www.gnu.org/licenses/lgpl). + +from odoo import api, fields, models + + +class CrmClaim(models.Model): + _inherit = "crm.claim" + + code = fields.Char( + string="Claim Number", + required=True, + default="/", + readonly=True, + copy=False, + ) + + _sql_constraints = [ + ("crm_claim_unique_code", "UNIQUE (code)", "The code must be unique!"), + ] + + @api.model + def create(self, values): + if values.get("code", "/") == "/": + values["code"] = self.env["ir.sequence"].next_by_code("crm.claim") + return super().create(values) diff --git a/crm_claim_code/readme/CONTRIBUTORS.rst b/crm_claim_code/readme/CONTRIBUTORS.rst new file mode 100644 index 00000000000..2fdb4cf7ba7 --- /dev/null +++ b/crm_claim_code/readme/CONTRIBUTORS.rst @@ -0,0 +1,10 @@ +* Ana Juaristi +* Iker Coranti +* Oihane Crucelaegui +* Alfredo de la Fuente +* Tharathip Chaweewongphan +* `Tecnativa `_: + + * Ernesto Tejeda + * Pedro M. Baeza + * Vicent Cubells diff --git a/crm_claim_code/readme/DESCRIPTION.rst b/crm_claim_code/readme/DESCRIPTION.rst new file mode 100644 index 00000000000..0f694e56713 --- /dev/null +++ b/crm_claim_code/readme/DESCRIPTION.rst @@ -0,0 +1 @@ +* This module adds a sequential code for claims. diff --git a/crm_claim_code/readme/USAGE.rst b/crm_claim_code/readme/USAGE.rst new file mode 100644 index 00000000000..e47ec739ba9 --- /dev/null +++ b/crm_claim_code/readme/USAGE.rst @@ -0,0 +1,4 @@ +To use this module, you need to: + +* Go to menu **CRM > After Sale > Claims** and create a new claim. +* Enter claim subject and Save it. You must see a new number for this claim. diff --git a/crm_claim_code/static/description/icon.png b/crm_claim_code/static/description/icon.png new file mode 100644 index 00000000000..3a0328b516c Binary files /dev/null and b/crm_claim_code/static/description/icon.png differ diff --git a/crm_claim_code/static/description/index.html b/crm_claim_code/static/description/index.html new file mode 100644 index 00000000000..17d28675e60 --- /dev/null +++ b/crm_claim_code/static/description/index.html @@ -0,0 +1,445 @@ + + + + + +Sequential Code for Claims + + + +
+

Sequential Code for Claims

+ + +

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

+
    +
  • This module adds a sequential code for claims.
  • +
+

Table of contents

+ +
+

Usage

+

To use this module, you need to:

+
    +
  • Go to menu CRM > After Sale > Claims and create a new claim.
  • +
  • Enter claim subject and Save it. You must see a new number for this claim.
  • +
+
+
+

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

+
    +
  • AvanzOSC
  • +
  • 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/crm project on GitHub.

+

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

+
+
+
+ + diff --git a/crm_claim_code/tests/__init__.py b/crm_claim_code/tests/__init__.py new file mode 100644 index 00000000000..f17f478983a --- /dev/null +++ b/crm_claim_code/tests/__init__.py @@ -0,0 +1,3 @@ +# License LGPL-3.0 or later (https://www.gnu.org/licenses/lgpl). + +from . import test_crm_claim_code diff --git a/crm_claim_code/tests/test_crm_claim_code.py b/crm_claim_code/tests/test_crm_claim_code.py new file mode 100644 index 00000000000..08eb155959f --- /dev/null +++ b/crm_claim_code/tests/test_crm_claim_code.py @@ -0,0 +1,36 @@ +# Copyright 2015 Tecnativa - Pedro M. Baeza +# Copyright 2015 AvanzOsc (http://www.avanzosc.es) +# Copyright 2017 Tecnativa - Vicent Cubells +# License LGPL-3.0 or later (https://www.gnu.org/licenses/lgpl). + +from odoo.tests import common + + +class TestCrmClaimCode(common.TransactionCase): + @classmethod + def setUpClass(cls): + super(TestCrmClaimCode, cls).setUpClass() + cls.crm_claim_model = cls.env["crm.claim"] + cls.ir_sequence_model = cls.env["ir.sequence"] + cls.crm_sequence = cls.env.ref("crm_claim_code.sequence_claim") + cls.crm_claim = cls.env["crm.claim"].create({"name": "Test Claim"}) + + def test_old_claim_code_assign(self): + crm_claims = self.crm_claim_model.search([]) + for crm_claim in crm_claims: + self.assertNotEqual(crm_claim.code, "/") + + def test_new_claim_code_assign(self): + code = self._get_next_code() + crm_claim = self.crm_claim_model.create({"name": "Testing claim code"}) + self.assertNotEqual(crm_claim.code, "/") + self.assertEqual(crm_claim.code, code) + + def test_copy_claim_code_assign(self): + code = self._get_next_code() + crm_claim_copy = self.crm_claim.copy() + self.assertNotEqual(crm_claim_copy.code, self.crm_claim.code) + self.assertEqual(crm_claim_copy.code, code) + + def _get_next_code(self): + return self.crm_sequence.get_next_char(self.crm_sequence.number_next_actual) diff --git a/crm_claim_code/views/crm_claim_view.xml b/crm_claim_code/views/crm_claim_view.xml new file mode 100644 index 00000000000..2caf296c127 --- /dev/null +++ b/crm_claim_code/views/crm_claim_view.xml @@ -0,0 +1,35 @@ + + + + crm.claim.add.seq.form.view.inh + crm.claim + + + + + + + + + crm.claim.add.seq.tree.view.inh + crm.claim + + + + + + + + + view.crm.case.claims.filter.inh.claimseq + crm.claim + + + + ['|', ('name', 'ilike', self), ('code', 'ilike', self)] + + + + diff --git a/crm_salesperson_planner/tests/test_crm_salesperson_planner_visit_template.py b/crm_salesperson_planner/tests/test_crm_salesperson_planner_visit_template.py index 2df099e56d6..361e4a15f22 100644 --- a/crm_salesperson_planner/tests/test_crm_salesperson_planner_visit_template.py +++ b/crm_salesperson_planner/tests/test_crm_salesperson_planner_visit_template.py @@ -210,7 +210,7 @@ def test_05_repeat_weeks(self): create_model = self.env["crm.salesperson.planner.visit.template.create"] create_item = create_model.with_context( active_id=self.visit_template_base.id - ).create({"date_to": "2024-07-02"}) + ).create({"date_to": "2027-12-31"}) create_item.create_visits() self.assertEqual(self.visit_template_base.state, "done") visit_dates = self.visit_template_base.visit_ids.mapped("date") diff --git a/setup/crm_claim_code/odoo/addons/crm_claim_code b/setup/crm_claim_code/odoo/addons/crm_claim_code new file mode 120000 index 00000000000..0352619b9b4 --- /dev/null +++ b/setup/crm_claim_code/odoo/addons/crm_claim_code @@ -0,0 +1 @@ +../../../../crm_claim_code \ No newline at end of file diff --git a/setup/crm_claim_code/setup.py b/setup/crm_claim_code/setup.py new file mode 100644 index 00000000000..28c57bb6403 --- /dev/null +++ b/setup/crm_claim_code/setup.py @@ -0,0 +1,6 @@ +import setuptools + +setuptools.setup( + setup_requires=['setuptools-odoo'], + odoo_addon=True, +)