Skip to content

Commit

Permalink
[IMP] crm_claim_non_conformity: In crm new nenu "NC Quality".
Browse files Browse the repository at this point in the history
  • Loading branch information
alfredoavanzosc authored and anajuaristi committed Oct 3, 2024
1 parent 1eb6769 commit bdf36b8
Show file tree
Hide file tree
Showing 10 changed files with 244 additions and 10 deletions.
1 change: 1 addition & 0 deletions crm_claim_non_conformity/README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ Crm claim non conformity
========================

* In crm claim type new field "Is Non Conformity?".
* In crm new nenu "NC Quality".

Bug Tracker
===========
Expand Down
1 change: 1 addition & 0 deletions crm_claim_non_conformity/__manifest__.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
],
"data": [
"views/crm_claim_type_views.xml",
"views/crm_claim_views.xml",
],
"installable": True,
}
31 changes: 29 additions & 2 deletions crm_claim_non_conformity/i18n/ca_ES.po
Original file line number Diff line number Diff line change
Expand Up @@ -6,21 +6,48 @@ msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 16.0\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2024-10-01 07:11+0000\n"
"PO-Revision-Date: 2024-10-01 07:11+0000\n"
"POT-Creation-Date: 2024-10-03 05:44+0000\n"
"PO-Revision-Date: 2024-10-03 05:44+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_non_conformity
#: model:ir.model,name:crm_claim_non_conformity.model_crm_claim
msgid "Claim"
msgstr ""

#. module: crm_claim_non_conformity
#: model:ir.model,name:crm_claim_non_conformity.model_crm_claim_type
#: model:ir.model.fields,field_description:crm_claim_non_conformity.field_crm_claim__claim_type
msgid "Claim Type"
msgstr "Tipus de reclamació"

#. module: crm_claim_non_conformity
#: model:ir.model.fields,help:crm_claim_non_conformity.field_crm_claim__claim_type
msgid "Claim classification"
msgstr "Classificació de les reclamacions"

#. module: crm_claim_non_conformity
#: model:ir.model.fields,field_description:crm_claim_non_conformity.field_crm_claim__non_conformity
#: model:ir.model.fields,field_description:crm_claim_non_conformity.field_crm_claim_type__non_conformity
msgid "Is Non Conformity?"
msgstr ""

#. module: crm_claim_non_conformity
#: model:ir.actions.act_window,name:crm_claim_non_conformity.action_crm_claim_non_conformity
#: model:ir.ui.menu,name:crm_claim_non_conformity.menu_crm_claim_non_conformit
msgid "NC Quality"
msgstr ""

#. module: crm_claim_non_conformity
#: model_terms:ir.actions.act_window,help:crm_claim_non_conformity.action_crm_claim_non_conformity
msgid ""
"Record and track your customers' claims.\n"
" Claims may be linked to a sales order or a lot.\n"
" You can send emails with attachments and keep the full history for a claim (emails sent, intervention type and so on).\n"
" Claims may automatically be linked to an email address using the mail gateway module."
msgstr ""
31 changes: 29 additions & 2 deletions crm_claim_non_conformity/i18n/crm_claim_non_conformity.pot
Original file line number Diff line number Diff line change
Expand Up @@ -6,21 +6,48 @@ msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 16.0\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2024-10-01 07:11+0000\n"
"PO-Revision-Date: 2024-10-01 07:11+0000\n"
"POT-Creation-Date: 2024-10-03 05:44+0000\n"
"PO-Revision-Date: 2024-10-03 05:44+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_non_conformity
#: model:ir.model,name:crm_claim_non_conformity.model_crm_claim
msgid "Claim"
msgstr ""

#. module: crm_claim_non_conformity
#: model:ir.model,name:crm_claim_non_conformity.model_crm_claim_type
#: model:ir.model.fields,field_description:crm_claim_non_conformity.field_crm_claim__claim_type
msgid "Claim Type"
msgstr ""

#. module: crm_claim_non_conformity
#: model:ir.model.fields,help:crm_claim_non_conformity.field_crm_claim__claim_type
msgid "Claim classification"
msgstr ""

#. module: crm_claim_non_conformity
#: model:ir.model.fields,field_description:crm_claim_non_conformity.field_crm_claim__non_conformity
#: model:ir.model.fields,field_description:crm_claim_non_conformity.field_crm_claim_type__non_conformity
msgid "Is Non Conformity?"
msgstr ""

#. module: crm_claim_non_conformity
#: model:ir.actions.act_window,name:crm_claim_non_conformity.action_crm_claim_non_conformity
#: model:ir.ui.menu,name:crm_claim_non_conformity.menu_crm_claim_non_conformit
msgid "NC Quality"
msgstr ""

#. module: crm_claim_non_conformity
#: model_terms:ir.actions.act_window,help:crm_claim_non_conformity.action_crm_claim_non_conformity
msgid ""
"Record and track your customers' claims.\n"
" Claims may be linked to a sales order or a lot.\n"
" You can send emails with attachments and keep the full history for a claim (emails sent, intervention type and so on).\n"
" Claims may automatically be linked to an email address using the mail gateway module."
msgstr ""
31 changes: 29 additions & 2 deletions crm_claim_non_conformity/i18n/en_GB.po
Original file line number Diff line number Diff line change
Expand Up @@ -6,21 +6,48 @@ msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 16.0\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2024-10-01 07:11+0000\n"
"PO-Revision-Date: 2024-10-01 07:11+0000\n"
"POT-Creation-Date: 2024-10-03 05:44+0000\n"
"PO-Revision-Date: 2024-10-03 05:44+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_non_conformity
#: model:ir.model,name:crm_claim_non_conformity.model_crm_claim
msgid "Claim"
msgstr ""

#. module: crm_claim_non_conformity
#: model:ir.model,name:crm_claim_non_conformity.model_crm_claim_type
#: model:ir.model.fields,field_description:crm_claim_non_conformity.field_crm_claim__claim_type
msgid "Claim Type"
msgstr ""

#. module: crm_claim_non_conformity
#: model:ir.model.fields,help:crm_claim_non_conformity.field_crm_claim__claim_type
msgid "Claim classification"
msgstr ""

#. module: crm_claim_non_conformity
#: model:ir.model.fields,field_description:crm_claim_non_conformity.field_crm_claim__non_conformity
#: model:ir.model.fields,field_description:crm_claim_non_conformity.field_crm_claim_type__non_conformity
msgid "Is Non Conformity?"
msgstr ""

#. module: crm_claim_non_conformity
#: model:ir.actions.act_window,name:crm_claim_non_conformity.action_crm_claim_non_conformity
#: model:ir.ui.menu,name:crm_claim_non_conformity.menu_crm_claim_non_conformit
msgid "NC Quality"
msgstr ""

#. module: crm_claim_non_conformity
#: model_terms:ir.actions.act_window,help:crm_claim_non_conformity.action_crm_claim_non_conformity
msgid ""
"Record and track your customers' claims.\n"
" Claims may be linked to a sales order or a lot.\n"
" You can send emails with attachments and keep the full history for a claim (emails sent, intervention type and so on).\n"
" Claims may automatically be linked to an email address using the mail gateway module."
msgstr ""
35 changes: 33 additions & 2 deletions crm_claim_non_conformity/i18n/es.po
Original file line number Diff line number Diff line change
Expand Up @@ -6,21 +6,52 @@ msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 16.0\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2024-10-01 07:12+0000\n"
"PO-Revision-Date: 2024-10-01 07:12+0000\n"
"POT-Creation-Date: 2024-10-03 05:45+0000\n"
"PO-Revision-Date: 2024-10-03 05:45+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_non_conformity
#: model:ir.model,name:crm_claim_non_conformity.model_crm_claim
msgid "Claim"
msgstr "Reclamación"

#. module: crm_claim_non_conformity
#: model:ir.model,name:crm_claim_non_conformity.model_crm_claim_type
#: model:ir.model.fields,field_description:crm_claim_non_conformity.field_crm_claim__claim_type
msgid "Claim Type"
msgstr "Tipo de reclamación"

#. module: crm_claim_non_conformity
#: model:ir.model.fields,help:crm_claim_non_conformity.field_crm_claim__claim_type
msgid "Claim classification"
msgstr "Clasificación de las reclamaciones"

#. module: crm_claim_non_conformity
#: model:ir.model.fields,field_description:crm_claim_non_conformity.field_crm_claim__non_conformity
#: model:ir.model.fields,field_description:crm_claim_non_conformity.field_crm_claim_type__non_conformity
msgid "Is Non Conformity?"
msgstr "¿Es no conformidad?"

#. module: crm_claim_non_conformity
#: model:ir.actions.act_window,name:crm_claim_non_conformity.action_crm_claim_non_conformity
#: model:ir.ui.menu,name:crm_claim_non_conformity.menu_crm_claim_non_conformit
msgid "NC Quality"
msgstr "NC Calidad"

#. module: crm_claim_non_conformity
#: model_terms:ir.actions.act_window,help:crm_claim_non_conformity.action_crm_claim_non_conformity
msgid ""
"Record and track your customers' claims.\n"
" Claims may be linked to a sales order or a lot.\n"
" You can send emails with attachments and keep the full history for a claim (emails sent, intervention type and so on).\n"
" Claims may automatically be linked to an email address using the mail gateway module."
msgstr ""
"Registre y realice el seguimiento de las reclamaciones de sus clientes.\n"
" Las reclamaciones pueden estar vinculadas a un pedido de venta o a un lote.\n"
" Puede enviar correos electrónicos con archivos adjuntos y conservar el historial completo de una reclamación (correos electrónicos enviados, tipo de intervención, etc.).\n"
" Las reclamaciones pueden vincularse automáticamente a una dirección de correo electrónico mediante el módulo de pasarela de correo."
31 changes: 29 additions & 2 deletions crm_claim_non_conformity/i18n/fr.po
Original file line number Diff line number Diff line change
Expand Up @@ -6,21 +6,48 @@ msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 16.0\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2024-10-01 07:12+0000\n"
"PO-Revision-Date: 2024-10-01 07:12+0000\n"
"POT-Creation-Date: 2024-10-03 05:44+0000\n"
"PO-Revision-Date: 2024-10-03 05:44+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_non_conformity
#: model:ir.model,name:crm_claim_non_conformity.model_crm_claim
msgid "Claim"
msgstr ""

#. module: crm_claim_non_conformity
#: model:ir.model,name:crm_claim_non_conformity.model_crm_claim_type
#: model:ir.model.fields,field_description:crm_claim_non_conformity.field_crm_claim__claim_type
msgid "Claim Type"
msgstr ""

#. module: crm_claim_non_conformity
#: model:ir.model.fields,help:crm_claim_non_conformity.field_crm_claim__claim_type
msgid "Claim classification"
msgstr ""

#. module: crm_claim_non_conformity
#: model:ir.model.fields,field_description:crm_claim_non_conformity.field_crm_claim__non_conformity
#: model:ir.model.fields,field_description:crm_claim_non_conformity.field_crm_claim_type__non_conformity
msgid "Is Non Conformity?"
msgstr ""

#. module: crm_claim_non_conformity
#: model:ir.actions.act_window,name:crm_claim_non_conformity.action_crm_claim_non_conformity
#: model:ir.ui.menu,name:crm_claim_non_conformity.menu_crm_claim_non_conformit
msgid "NC Quality"
msgstr ""

#. module: crm_claim_non_conformity
#: model_terms:ir.actions.act_window,help:crm_claim_non_conformity.action_crm_claim_non_conformity
msgid ""
"Record and track your customers' claims.\n"
" Claims may be linked to a sales order or a lot.\n"
" You can send emails with attachments and keep the full history for a claim (emails sent, intervention type and so on).\n"
" Claims may automatically be linked to an email address using the mail gateway module."
msgstr ""
1 change: 1 addition & 0 deletions crm_claim_non_conformity/models/__init__.py
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
from . import crm_claim_type
from . import crm_claim
34 changes: 34 additions & 0 deletions crm_claim_non_conformity/models/crm_claim.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
# Copyright 2024 Alfredo de la Fuente - AvanzOSC
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html).
from odoo import api, fields, models


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

def _default_claim_type(self):
claim_type_obj = self.env["crm.claim.type"]
if "non_conformity" in self.env.context and self.env.context.get(
"non_conformity"
):
cond = [("non_conformity", "=", True)]
claim_type = claim_type_obj.search(cond, limit=1)
if claim_type:
return claim_type.id
return claim_type_obj

def _default_non_conformity(self):
if "non_conformity" in self.env.context:
return self.env.context.get("non_conformity")
return False

claim_type = fields.Many2one(default=_default_claim_type)
non_conformity = fields.Boolean(
string="Is Non Conformity?", default=_default_non_conformity
)

@api.onchange("non_conformity")
def onchange_non_conformity(self):
return {
"domain": {"claim_type": [("non_conformity", "=", self.non_conformity)]}
}
58 changes: 58 additions & 0 deletions crm_claim_non_conformity/views/crm_claim_views.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
<?xml version="1.0" encoding="UTF-8" ?>
<odoo>
<record id="crm_case_claims_form_view" model="ir.ui.view">
<field name="model">crm.claim</field>
<field name="inherit_id" ref="crm_claim_type.crm_case_claims_form_view" />
<field name="arch" type="xml">
<field name="claim_type" position="after">
<field name="non_conformity" invisible="1" />
</field>
</field>
</record>

<record model="ir.actions.act_window" id="crm_claim.crm_claim_category_claim0">
<field name="name">Claims</field>
<field name="res_model">crm.claim</field>
<field name="view_mode">tree,calendar,form</field>
<field name="view_id" ref="crm_claim.crm_case_claims_tree_view" />
<field name="domain">[('claim_type.non_conformity', '=', False)]</field>
<field name="context">
{&quot;search_default_user_id&quot;:uid, &quot;stage_type&quot;: 'claim', &quot;non_conformity&quot;: False}</field>
<field name="search_view_id" ref="crm_claim.view_crm_case_claims_filter" />
<field name="help" type="html">
<p class="oe_view_nocontent_create">
Record and track your customers' claims.
Claims may be linked to a sales order or a lot.
You can send emails with attachments and keep the full history for a claim (emails sent, intervention type and so on).
Claims may automatically be linked to an email address using the mail gateway module.
</p>
</field>
</record>

<record model="ir.actions.act_window" id="action_crm_claim_non_conformity">
<field name="name">NC Quality</field>
<field name="res_model">crm.claim</field>
<field name="view_mode">tree,calendar,form</field>
<field name="view_id" ref="crm_claim.crm_case_claims_tree_view" />
<field name="domain">[('claim_type.non_conformity', '=', True)]</field>
<field name="context">
{&quot;search_default_user_id&quot;:uid, &quot;stage_type&quot;: 'claim', &quot;non_conformity&quot;: True}</field>
<field name="search_view_id" ref="crm_claim.view_crm_case_claims_filter" />
<field name="help" type="html">
<p class="oe_view_nocontent_create">
Record and track your customers' claims.
Claims may be linked to a sales order or a lot.
You can send emails with attachments and keep the full history for a claim (emails sent, intervention type and so on).
Claims may automatically be linked to an email address using the mail gateway module.
</p>
</field>
</record>

<menuitem
name="NC Quality"
id="menu_crm_claim_non_conformit"
parent="crm_claim.menu_aftersale"
action="action_crm_claim_non_conformity"
sequence="10"
/>
</odoo>

0 comments on commit bdf36b8

Please sign in to comment.