Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[15.0] [MIG] crm_claim_code: Migration to 15.0 #521

Closed
wants to merge 9 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
98 changes: 98 additions & 0 deletions crm_claim_code/README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,98 @@
==========================
Sequential Code for Claims
==========================

..
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! source digest: sha256:69c955590a5299ba39c50023a03614707e14b9b7494e2ad602215f9257381cbb
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

.. |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 <[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

* `Trey Kilobytes de Soluciones SL <https://www.trey.es>`_:

* 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 <[email protected]>
# 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>
29 changes: 29 additions & 0 deletions crm_claim_code/hooks.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# 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

Check warning on line 24 in crm_claim_code/hooks.py

View check run for this annotation

Codecov / codecov/patch

crm_claim_code/hooks.py#L24

Added line #L24 was not covered by tests
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")
32 changes: 32 additions & 0 deletions crm_claim_code/i18n/bg.po
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
# 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
#: sql_constraint:crm.claim:0
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 ""
32 changes: 32 additions & 0 deletions crm_claim_code/i18n/de.po
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
# 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
#: sql_constraint:crm.claim:0
msgid "The code must be unique!"
msgstr "Der Schlüssel muss eindeutig sein!"
35 changes: 35 additions & 0 deletions crm_claim_code/i18n/es.po
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * crm_claim_code
#
# Translators:
# enjolras <[email protected]>, 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: 2023-06-06 11:08+0000\n"
"Last-Translator: luis-ron <[email protected]>\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
#: sql_constraint:crm.claim:0
msgid "The code must be unique!"
msgstr "¡El código debe ser único!"
32 changes: 32 additions & 0 deletions crm_claim_code/i18n/es_MX.po
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
# 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
#: sql_constraint:crm.claim:0
msgid "The code must be unique!"
msgstr ""
32 changes: 32 additions & 0 deletions crm_claim_code/i18n/es_VE.po
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
# 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
#: sql_constraint:crm.claim:0
msgid "The code must be unique!"
msgstr ""
Loading