Skip to content
Merged
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
51 changes: 51 additions & 0 deletions crm_claim_ref_search/README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
====================
CRM claim ref search
====================

.. |badge1| image:: https://img.shields.io/badge/licence-LGPL--3-blue.png
:target: http://www.gnu.org/licenses/lgpl-3.0-standalone.html
:alt: License: LGPL-3

|badge1|

This module shows the field "reference" in the claims search form and,
and allows grouping records by this field.


**Table of contents**

.. contents::
:local:

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 smashing it by providing a detailed and welcomed
`feedback <https://github.com/avanzosc/crm-addons/issues/new?body=module:%crm_claim_ref_search%0Aversion:%2018.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

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

* Pedro M. Baeza
* Ana Juaristi <anajuaristi@avanzosc.es>
* Alfredo de la Fuente <alfredodelafuente@avanzosc.es>



CRM claim ref search
====================

This module shows the field "reference" in the claims search form and,
and allows grouping records by this field.
1 change: 1 addition & 0 deletions crm_claim_ref_search/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
from . import model
25 changes: 25 additions & 0 deletions crm_claim_ref_search/__manifest__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# Copyright 2015 Pedro M. Baeza (http://www.serviciosbaeza.com)
# Copyright 2024 Alfredo de la Fuente - AvanzOSC
# Copyright 2026 Eñaut Alberdi - AvanzOSC
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html).
{
"name": "CRM Claim Ref Search",
"version": "18.0.1.0.0",
"author": "OdooMRP team," "AvanzOSC," "Serv. Tecnol. Avanzados - Pedro M. Baeza",
"category": "CRM Claim",
"license": "AGPL-3",
"website": "https://github.com/avanzosc/crm-addons",
"contributors": [
"Pedro M. Baeza <pedro.baeza@serviciosbaeza.com",
"Ana Juaristi <anajuaristi@avanzosc.es>",
"Alfredo de la Fuente <alfredodelafuente@avanzosc.es>",
"Eñaut Alberdi <enautavanzosc@gmail.com>",
],
"depends": [
"crm_claim",
],
"data": [
"views/crm_claim_view.xml",
],
"installable": True,
}
36 changes: 36 additions & 0 deletions crm_claim_ref_search/i18n/crm_claim_ref_search.pot
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * crm_claim_ref_search
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 16.0\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2024-03-26 13:37+0000\n"
"PO-Revision-Date: 2024-03-26 13: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_ref_search
#: model:ir.model,name:crm_claim_ref_search.model_crm_claim
msgid "Claim"
msgstr ""

#. module: crm_claim_ref_search
#: model:ir.model.fields,field_description:crm_claim_ref_search.field_crm_claim__ref_model_name
msgid "Ref. Model"
msgstr ""

#. module: crm_claim_ref_search
#: model:ir.model.fields,field_description:crm_claim_ref_search.field_crm_claim__ref_name
msgid "Ref. Name"
msgstr ""

#. module: crm_claim_ref_search
#: model_terms:ir.ui.view,arch_db:crm_claim_ref_search.view_crm_case_claims_filter
msgid "Reference"
msgstr ""
36 changes: 36 additions & 0 deletions crm_claim_ref_search/i18n/es.po
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * crm_claim_ref_search
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 16.0\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2024-03-26 13:37+0000\n"
"PO-Revision-Date: 2024-03-26 13: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_ref_search
#: model:ir.model,name:crm_claim_ref_search.model_crm_claim
msgid "Claim"
msgstr "Reclamación"

#. module: crm_claim_ref_search
#: model:ir.model.fields,field_description:crm_claim_ref_search.field_crm_claim__ref_model_name
msgid "Ref. Model"
msgstr "Ref. Modelo"

#. module: crm_claim_ref_search
#: model:ir.model.fields,field_description:crm_claim_ref_search.field_crm_claim__ref_name
msgid "Ref. Name"
msgstr "Ref. Nombre"

#. module: crm_claim_ref_search
#: model_terms:ir.ui.view,arch_db:crm_claim_ref_search.view_crm_case_claims_filter
msgid "Reference"
msgstr "Referencia"
1 change: 1 addition & 0 deletions crm_claim_ref_search/model/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
from . import crm_claim
35 changes: 35 additions & 0 deletions crm_claim_ref_search/model/crm_claim.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
# Copyright 2015 Pedro M. Baeza (http://www.serviciosbaeza.com)
# Copyright 2024 Alfredo de la Fuente - AvanzOSC
# Copyright 2026 Eñaut Alberdi - AvanzOSC
# License AGPL-3 - See http://www.gnu.org/licenses/agpl-3.0.html
from odoo import api, fields, models


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

@api.depends("model_ref_id")
def _compute_ref_model_name(self):
model_obj = self.env["ir.model"]
for claim in self:
ref_model_name = False
if claim.model_ref_id:
cond = [("model", "=", str(claim.model_ref_id._name))]
model = model_obj.search(cond, limit=1)
ref_model_name = model.display_name
claim.ref_model_name = ref_model_name

@api.depends("model_ref_id")
def _compute_ref_name(self):
for claim in self:
ref_name = False
if claim.model_ref_id:
ref_name = claim.model_ref_id.display_name
claim.ref_name = ref_name

ref_model_name = fields.Char(
string="Ref. Model", compute="_compute_ref_model_name", store=True, copy=False
)
ref_name = fields.Char(
string="Ref. Name", compute="_compute_ref_name", store=True, copy=False
)
3 changes: 3 additions & 0 deletions crm_claim_ref_search/pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[build-system]
requires = ["whool"]
build-backend = "whool.buildapi"
32 changes: 32 additions & 0 deletions crm_claim_ref_search/views/crm_claim_view.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
<?xml version="1.0" encoding="utf-8" ?>
<odoo>
<record id="view_crm_case_claims_filter" model="ir.ui.view">
<field name="model">crm.claim</field>
<field name="inherit_id" ref="crm_claim.view_crm_case_claims_filter" />
<field name="arch" type="xml">
<field name="name" position="after">
<separator />
<field name="ref_name" />
</field>
<filter name="partner" position="after">
<filter
string="Reference"
name="reference"
domain="[]"
help="Reference"
context="{'group_by':'ref_model_name'}"
/>
</filter>
</field>
</record>
<record id="crm_case_claims_tree_view" model="ir.ui.view">
<field name="model">crm.claim</field>
<field name="inherit_id" ref="crm_claim.crm_case_claims_tree_view" />
<field name="arch" type="xml">
<field name="name" position="before">
<field name="ref_model_name" optional="show" />
<field name="ref_name" optional="show" />
</field>
</field>
</record>
</odoo>