From bdf36b8d82953c4aa6c0881e74c55179d3fb7a8b Mon Sep 17 00:00:00 2001 From: Alfredo Date: Wed, 2 Oct 2024 14:09:03 +0200 Subject: [PATCH] [IMP] crm_claim_non_conformity: In crm new nenu "NC Quality". --- crm_claim_non_conformity/README.rst | 1 + crm_claim_non_conformity/__manifest__.py | 1 + crm_claim_non_conformity/i18n/ca_ES.po | 31 +++++++++- .../i18n/crm_claim_non_conformity.pot | 31 +++++++++- crm_claim_non_conformity/i18n/en_GB.po | 31 +++++++++- crm_claim_non_conformity/i18n/es.po | 35 ++++++++++- crm_claim_non_conformity/i18n/fr.po | 31 +++++++++- crm_claim_non_conformity/models/__init__.py | 1 + crm_claim_non_conformity/models/crm_claim.py | 34 +++++++++++ .../views/crm_claim_views.xml | 58 +++++++++++++++++++ 10 files changed, 244 insertions(+), 10 deletions(-) create mode 100644 crm_claim_non_conformity/models/crm_claim.py create mode 100644 crm_claim_non_conformity/views/crm_claim_views.xml diff --git a/crm_claim_non_conformity/README.rst b/crm_claim_non_conformity/README.rst index eddbe475..55a2bc67 100644 --- a/crm_claim_non_conformity/README.rst +++ b/crm_claim_non_conformity/README.rst @@ -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 =========== diff --git a/crm_claim_non_conformity/__manifest__.py b/crm_claim_non_conformity/__manifest__.py index 92673a41..01178b08 100644 --- a/crm_claim_non_conformity/__manifest__.py +++ b/crm_claim_non_conformity/__manifest__.py @@ -12,6 +12,7 @@ ], "data": [ "views/crm_claim_type_views.xml", + "views/crm_claim_views.xml", ], "installable": True, } diff --git a/crm_claim_non_conformity/i18n/ca_ES.po b/crm_claim_non_conformity/i18n/ca_ES.po index 9b5f68a6..e37584ac 100644 --- a/crm_claim_non_conformity/i18n/ca_ES.po +++ b/crm_claim_non_conformity/i18n/ca_ES.po @@ -6,8 +6,8 @@ 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" @@ -15,12 +15,39 @@ msgstr "" "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 "" diff --git a/crm_claim_non_conformity/i18n/crm_claim_non_conformity.pot b/crm_claim_non_conformity/i18n/crm_claim_non_conformity.pot index 2d0dc4bd..e4d22591 100644 --- a/crm_claim_non_conformity/i18n/crm_claim_non_conformity.pot +++ b/crm_claim_non_conformity/i18n/crm_claim_non_conformity.pot @@ -6,8 +6,8 @@ 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" @@ -15,12 +15,39 @@ msgstr "" "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 "" diff --git a/crm_claim_non_conformity/i18n/en_GB.po b/crm_claim_non_conformity/i18n/en_GB.po index 2d0dc4bd..e4d22591 100644 --- a/crm_claim_non_conformity/i18n/en_GB.po +++ b/crm_claim_non_conformity/i18n/en_GB.po @@ -6,8 +6,8 @@ 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" @@ -15,12 +15,39 @@ msgstr "" "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 "" diff --git a/crm_claim_non_conformity/i18n/es.po b/crm_claim_non_conformity/i18n/es.po index d3093659..f28481dd 100644 --- a/crm_claim_non_conformity/i18n/es.po +++ b/crm_claim_non_conformity/i18n/es.po @@ -6,8 +6,8 @@ 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" @@ -15,12 +15,43 @@ msgstr "" "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." diff --git a/crm_claim_non_conformity/i18n/fr.po b/crm_claim_non_conformity/i18n/fr.po index ce121a61..e4d22591 100644 --- a/crm_claim_non_conformity/i18n/fr.po +++ b/crm_claim_non_conformity/i18n/fr.po @@ -6,8 +6,8 @@ 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" @@ -15,12 +15,39 @@ msgstr "" "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 "" diff --git a/crm_claim_non_conformity/models/__init__.py b/crm_claim_non_conformity/models/__init__.py index dd91ae1c..09559722 100644 --- a/crm_claim_non_conformity/models/__init__.py +++ b/crm_claim_non_conformity/models/__init__.py @@ -1 +1,2 @@ from . import crm_claim_type +from . import crm_claim diff --git a/crm_claim_non_conformity/models/crm_claim.py b/crm_claim_non_conformity/models/crm_claim.py new file mode 100644 index 00000000..dfe41476 --- /dev/null +++ b/crm_claim_non_conformity/models/crm_claim.py @@ -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)]} + } diff --git a/crm_claim_non_conformity/views/crm_claim_views.xml b/crm_claim_non_conformity/views/crm_claim_views.xml new file mode 100644 index 00000000..cb9dfde5 --- /dev/null +++ b/crm_claim_non_conformity/views/crm_claim_views.xml @@ -0,0 +1,58 @@ + + + + crm.claim + + + + + + + + + + Claims + crm.claim + tree,calendar,form + + [('claim_type.non_conformity', '=', False)] + + {"search_default_user_id":uid, "stage_type": 'claim', "non_conformity": False} + + +

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

+
+
+ + + NC Quality + crm.claim + tree,calendar,form + + [('claim_type.non_conformity', '=', True)] + + {"search_default_user_id":uid, "stage_type": 'claim', "non_conformity": True} + + +

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

+
+
+ + +