Skip to content
Open
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
30 changes: 30 additions & 0 deletions crm_claim_type_sequence/README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
.. image:: https://img.shields.io/badge/licence-AGPL--3-blue.svg
:target: http://www.gnu.org/licenses/agpl-3.0-standalone.html
:alt: License: AGPL-3

=======================
Crm claim type sequence
=======================

* In crm claim types new field "Sequence".
* If when registering a claim, the claim type has a sequence defined, use that
sequence to register the claim.

Bug Tracker
===========

Bugs are tracked on `GitHub Issues
<https://github.com/avanzosc/crm-addons/issues>`_. In case of trouble,
please check there if your issue has already been reported. If you spotted
it first, help us smash it by providing detailed and welcomed feedback.

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

Credits
=======

Contributors
------------

* Ana Juaristi <anajuaristi@avanzosc.es>
* Alfredo de la Fuente <alfredodelafuente@avanzosc.es>
1 change: 1 addition & 0 deletions crm_claim_type_sequence/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
from . import models
15 changes: 15 additions & 0 deletions crm_claim_type_sequence/__manifest__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# Copyright 2024 Alfredo de la Fuente - AvanzOSC
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html).
{
"name": "CRM Claim Type Sequence",
"version": "18.0.1.0.0",
"category": "Customer Relationship Management",
"license": "AGPL-3",
"author": "AvanzOSC",
"website": "https://github.com/avanzosc/crm-addons",
"depends": ["crm_claim_type", "crm_claim_code"],
"data": [
"views/crm_claim_type_views.xml",
],
"installable": True,
}
31 changes: 31 additions & 0 deletions crm_claim_type_sequence/i18n/ca_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_type_sequence
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 16.0\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2024-09-30 12:41+0000\n"
"PO-Revision-Date: 2024-09-30 12:41+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_type_sequence
#: model:ir.model,name:crm_claim_type_sequence.model_crm_claim
msgid "Claim"
msgstr ""

#. module: crm_claim_type_sequence
#: model:ir.model,name:crm_claim_type_sequence.model_crm_claim_type
msgid "Claim Type"
msgstr "Tipus de reclamació"

#. module: crm_claim_type_sequence
#: model:ir.model.fields,field_description:crm_claim_type_sequence.field_crm_claim_type__sequence_id
msgid "Sequence"
msgstr ""
31 changes: 31 additions & 0 deletions crm_claim_type_sequence/i18n/crm_claim_type_sequence.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_type_sequence
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 16.0\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2024-09-30 12:41+0000\n"
"PO-Revision-Date: 2024-09-30 12:41+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_type_sequence
#: model:ir.model,name:crm_claim_type_sequence.model_crm_claim
msgid "Claim"
msgstr ""

#. module: crm_claim_type_sequence
#: model:ir.model,name:crm_claim_type_sequence.model_crm_claim_type
msgid "Claim Type"
msgstr ""

#. module: crm_claim_type_sequence
#: model:ir.model.fields,field_description:crm_claim_type_sequence.field_crm_claim_type__sequence_id
msgid "Sequence"
msgstr ""
31 changes: 31 additions & 0 deletions crm_claim_type_sequence/i18n/en_GB.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_type_sequence
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 16.0\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2024-09-30 12:41+0000\n"
"PO-Revision-Date: 2024-09-30 12:41+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_type_sequence
#: model:ir.model,name:crm_claim_type_sequence.model_crm_claim
msgid "Claim"
msgstr ""

#. module: crm_claim_type_sequence
#: model:ir.model,name:crm_claim_type_sequence.model_crm_claim_type
msgid "Claim Type"
msgstr ""

#. module: crm_claim_type_sequence
#: model:ir.model.fields,field_description:crm_claim_type_sequence.field_crm_claim_type__sequence_id
msgid "Sequence"
msgstr ""
31 changes: 31 additions & 0 deletions crm_claim_type_sequence/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_type_sequence
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 16.0\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2024-09-30 12:42+0000\n"
"PO-Revision-Date: 2024-09-30 12:42+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_type_sequence
#: model:ir.model,name:crm_claim_type_sequence.model_crm_claim
msgid "Claim"
msgstr "Reclamación"

#. module: crm_claim_type_sequence
#: model:ir.model,name:crm_claim_type_sequence.model_crm_claim_type
msgid "Claim Type"
msgstr "Tipo de reclamación"

#. module: crm_claim_type_sequence
#: model:ir.model.fields,field_description:crm_claim_type_sequence.field_crm_claim_type__sequence_id
msgid "Sequence"
msgstr "Secuencia"
31 changes: 31 additions & 0 deletions crm_claim_type_sequence/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_type_sequence
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 16.0\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2024-09-30 12:42+0000\n"
"PO-Revision-Date: 2024-09-30 12:42+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_type_sequence
#: model:ir.model,name:crm_claim_type_sequence.model_crm_claim
msgid "Claim"
msgstr ""

#. module: crm_claim_type_sequence
#: model:ir.model,name:crm_claim_type_sequence.model_crm_claim_type
msgid "Claim Type"
msgstr ""

#. module: crm_claim_type_sequence
#: model:ir.model.fields,field_description:crm_claim_type_sequence.field_crm_claim_type__sequence_id
msgid "Sequence"
msgstr ""
2 changes: 2 additions & 0 deletions crm_claim_type_sequence/models/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
from . import crm_claim_type
from . import crm_claim
20 changes: 20 additions & 0 deletions crm_claim_type_sequence/models/crm_claim.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# Copyright 2024 Alfredo de la Fuente - AvanzOSC
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html).
from odoo import api, models


class CrmClaim(models.Model):
_inherit = "crm.claim"

@api.model_create_multi
def create(self, vals_list):
for vals in vals_list:
if (
vals.get("code", "/") == "/"
and "claim_type" in vals
and vals.get("claim_type", False)
):
claim_type = self.env["crm.claim.type"].browse(vals.get("claim_type"))
if claim_type.sequence_id:
vals["code"] = claim_type.sequence_id.next_by_id()
return super().create(vals_list)
9 changes: 9 additions & 0 deletions crm_claim_type_sequence/models/crm_claim_type.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# Copyright 2024 Alfredo de la Fuente - AvanzOSC
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html).
from odoo import fields, models


class CrmClaimtype(models.Model):
_inherit = "crm.claim.type"

sequence_id = fields.Many2one(string="Sequence", comodel_name="ir.sequence")
3 changes: 3 additions & 0 deletions crm_claim_type_sequence/pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[build-system]
requires = ["whool"]
build-backend = "whool.buildapi"
22 changes: 22 additions & 0 deletions crm_claim_type_sequence/views/crm_claim_type_views.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
<?xml version="1.0" encoding="UTF-8" ?>
<odoo>
<record model="ir.ui.view" id="crm_claim_type_tree">
<field name="model">crm.claim.type</field>
<field name="inherit_id" ref="crm_claim_type.crm_claim_type_tree" />
<field name="arch" type="xml">
<field name="name" position="after">
<field name="sequence_id" optional="show" />
</field>
</field>
</record>

<record model="ir.ui.view" id="crm_claim_type_form">
<field name="model">crm.claim.type</field>
<field name="inherit_id" ref="crm_claim_type.crm_claim_type_form" />
<field name="arch" type="xml">
<field name="description" position="after">
<field name="sequence_id" />
</field>
</field>
</record>
</odoo>
Loading