Skip to content

Commit

Permalink
Merge PR #578 into 15.0
Browse files Browse the repository at this point in the history
Signed-off-by pedrobaeza
  • Loading branch information
OCA-git-bot committed Jul 9, 2024
2 parents a9e04b4 + da4ad34 commit 656dace
Show file tree
Hide file tree
Showing 32 changed files with 1,393 additions and 1 deletion.
94 changes: 94 additions & 0 deletions crm_claim_code/README.rst
Original file line number Diff line number Diff line change
@@ -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 <https://github.com/OCA/crm/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 <https://github.com/OCA/crm/issues/new?body=module:%20crm_claim_code%0Aversion:%2015.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_.

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

Credits
=======

Authors
~~~~~~~

* AvanzOSC
* Tecnativa

Contributors
~~~~~~~~~~~~

* Ana Juaristi <anajuarist@avanzosc.es>
* Iker Coranti <ikercoranti@avanzosc.com>
* Oihane Crucelaegui <oihanecrucelaegi@avanzosc.es>
* Alfredo de la Fuente <alfredodelafuente@avanzosc.es>
* Tharathip Chaweewongphan <tharathipc@ecosoft.co.th>
* `Tecnativa <https://www.tecnativa.com>`_:

* 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 <https://github.com/OCA/crm/tree/15.0/crm_claim_code>`_ project on GitHub.

You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.
4 changes: 4 additions & 0 deletions crm_claim_code/__init__.py
Original file line number Diff line number Diff line change
@@ -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
18 changes: 18 additions & 0 deletions crm_claim_code/__manifest__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# Copyright 2015-2018 Tecnativa - Pedro M. Baeza
# Copyright 2015 AvanzOsc (http://www.avanzosc.es)
# Copyright 2017 Tecnativa - Vicent Cubells <vicent.cubells@tecnativa.com>
# 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",
}
9 changes: 9 additions & 0 deletions crm_claim_code/data/claim_sequence.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<?xml version="1.0" encoding="UTF-8" ?>
<odoo noupdate="1">
<record id="sequence_claim" model="ir.sequence">
<field name="name">Claim Code</field>
<field name="code">crm.claim</field>
<field eval="4" name="padding" />
<field name="prefix">CLM</field>
</record>
</odoo>
32 changes: 32 additions & 0 deletions crm_claim_code/hooks.py
Original file line number Diff line number Diff line change
@@ -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")
47 changes: 47 additions & 0 deletions crm_claim_code/i18n/bg.po
Original file line number Diff line number Diff line change
@@ -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 "Номерът трябва да е уникален!"
44 changes: 44 additions & 0 deletions crm_claim_code/i18n/crm_claim_code.pot
Original file line number Diff line number Diff line change
@@ -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 ""
47 changes: 47 additions & 0 deletions crm_claim_code/i18n/de.po
Original file line number Diff line number Diff line change
@@ -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!"
50 changes: 50 additions & 0 deletions crm_claim_code/i18n/es.po
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * crm_claim_code
#
# Translators:
# enjolras <yo@miguelrevilla.com>, 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 <informatica@totmaterial.es>\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!"
Loading

0 comments on commit 656dace

Please sign in to comment.