Skip to content

Commit

Permalink
Merge PR #499 into 16.0
Browse files Browse the repository at this point in the history
Signed-off-by pedrobaeza
  • Loading branch information
OCA-git-bot committed Sep 28, 2023
2 parents ceee109 + 7ae4cd6 commit e1794ec
Show file tree
Hide file tree
Showing 31 changed files with 1,156 additions and 0 deletions.
91 changes: 91 additions & 0 deletions crm_claim_code/README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,91 @@
==========================
Sequential Code for Claims
==========================

.. !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
.. |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/14.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-14-0/crm-14-0-crm_claim_code
:alt: Translate me on Weblate
.. |badge5| image:: https://img.shields.io/badge/runbot-Try%20me-875A7B.png
:target: https://runbot.odoo-community.org/runbot/111/14.0
:alt: Try me on Runbot

|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 smashing it by providing a detailed and welcomed
`feedback <https://github.com/OCA/crm/issues/new?body=module:%20crm_claim_code%0Aversion:%2014.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 <[email protected]>
* Iker Coranti <[email protected]>
* Oihane Crucelaegui <[email protected]>
* Alfredo de la Fuente <[email protected]>
* Tharathip Chaweewongphan <[email protected]>
* `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/14.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 <[email protected]>
# License LGPL-3.0 or later (https://www.gnu.org/licenses/lgpl).

{
"name": "Sequential Code for Claims",
"version": "16.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")
31 changes: 31 additions & 0 deletions crm_claim_code/i18n/bg.po
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * crm_claim_code
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 16.0\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2023-06-05 08:31+0000\n"
"PO-Revision-Date: 2023-06-05 08:31+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: 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.constraint,message:crm_claim_code.constraint_crm_claim_crm_claim_unique_code
msgid "The code must be unique!"
msgstr "Номерът трябва да е уникален!"
31 changes: 31 additions & 0 deletions crm_claim_code/i18n/crm_claim_code.pot
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * crm_claim_code
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 16.0\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2023-06-05 08:34+0000\n"
"PO-Revision-Date: 2023-06-05 08:34+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: 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.constraint,message:crm_claim_code.constraint_crm_claim_crm_claim_unique_code
msgid "The code must be unique!"
msgstr ""
31 changes: 31 additions & 0 deletions crm_claim_code/i18n/de.po
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * crm_claim_code
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 16.0\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2023-06-05 08:35+0000\n"
"PO-Revision-Date: 2023-06-05 08:35+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: 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 "Forderungsnummer"

#. 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!"
31 changes: 31 additions & 0 deletions crm_claim_code/i18n/es.po
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * crm_claim_code
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 16.0\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2023-06-05 08:37+0000\n"
"PO-Revision-Date: 2023-06-05 08:37+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: 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.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."
31 changes: 31 additions & 0 deletions crm_claim_code/i18n/es_MX.po
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * crm_claim_code
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 16.0\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2023-06-05 08:36+0000\n"
"PO-Revision-Date: 2023-06-05 08:36+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: 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.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."
31 changes: 31 additions & 0 deletions crm_claim_code/i18n/es_VE.po
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * crm_claim_code
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 16.0\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2023-06-05 08:36+0000\n"
"PO-Revision-Date: 2023-06-05 08:36+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: 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.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."
31 changes: 31 additions & 0 deletions crm_claim_code/i18n/fr.po
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * crm_claim_code
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 16.0\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2023-06-05 08:35+0000\n"
"PO-Revision-Date: 2023-06-05 08:35+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: 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.constraint,message:crm_claim_code.constraint_crm_claim_crm_claim_unique_code
msgid "The code must be unique!"
msgstr "Le code doit être unique!"
Loading

0 comments on commit e1794ec

Please sign in to comment.