From e294c27ccbd95278ed771d058e0bf16c0ba550e2 Mon Sep 17 00:00:00 2001 From: "Yanina Aular (Vauxoo)" Date: Mon, 28 Sep 2015 11:03:41 -0430 Subject: [PATCH] module refactor, merge between crm_claim_typ and crm_claim_code and apply OCA guidelines --- crm_claim_rma_code/README.rst | 67 ++++++++++++++++++ crm_claim_rma_code/__init__.py | 22 ++++++ crm_claim_rma_code/__openerp__.py | 39 +++++++++++ crm_claim_rma_code/data/ir_sequence_type.xml | 69 +++++++++++++++++++ .../i18n/crm_claim_rma_code.pot | 22 ++++++ crm_claim_rma_code/i18n/es.po | 22 ++++++ crm_claim_rma_code/i18n/es_MX.po | 16 +++++ crm_claim_rma_code/i18n/es_PA.po | 16 +++++ crm_claim_rma_code/i18n/es_VE.po | 16 +++++ crm_claim_rma_code/models/__init__.py | 22 ++++++ crm_claim_rma_code/models/crm_claim_type.py | 33 +++++++++ crm_claim_rma_code/views/crm_claim_type.xml | 25 +++++++ 12 files changed, 369 insertions(+) create mode 100644 crm_claim_rma_code/README.rst create mode 100644 crm_claim_rma_code/__init__.py create mode 100644 crm_claim_rma_code/__openerp__.py create mode 100644 crm_claim_rma_code/data/ir_sequence_type.xml create mode 100644 crm_claim_rma_code/i18n/crm_claim_rma_code.pot create mode 100644 crm_claim_rma_code/i18n/es.po create mode 100644 crm_claim_rma_code/i18n/es_MX.po create mode 100644 crm_claim_rma_code/i18n/es_PA.po create mode 100644 crm_claim_rma_code/i18n/es_VE.po create mode 100644 crm_claim_rma_code/models/__init__.py create mode 100644 crm_claim_rma_code/models/crm_claim_type.py create mode 100644 crm_claim_rma_code/views/crm_claim_type.xml diff --git a/crm_claim_rma_code/README.rst b/crm_claim_rma_code/README.rst new file mode 100644 index 00000000..6a0430ad --- /dev/null +++ b/crm_claim_rma_code/README.rst @@ -0,0 +1,67 @@ +.. image:: https://img.shields.io/badge/licence-AGPL--3-blue.svg + :alt: License: AGPL-3 + +================== +CRM Claim RMA Code +================== + +This module was written to include different code sequences for RMA Claims based on the claim types and also it defines a RMA Number to track and manage claims for company partners + +Installation +============ + +To install this module, you need to install it from availables modules + +Configuration +============= + +To configure this module, you need to: + +#. Go to Settings > Sequence & Identifiers and then add/edit sequences and sequences codes to use. +#. Then go to Sales > Configuration > Claim > Claim Types and set the sequence codes for the claim types. + +Usage +===== + +To use this module, you need to create new claims based on the configuration set before. + +.. image:: https://odoo-community.org/website/image/ir.attachment/5784_f2813bd/datas + :alt: Try me on Runbot + :target: https://runbot.odoo-community.org/runbot/145/8.0 + + +For further information, please visit: + +* https://www.odoo.com/forum/help-1 + +Bug Tracker +=========== + +Bugs are tracked on `GitHub 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 +`here `_. + +Credits +======= + +Contributors +------------ + +* Yanina Aular +* Osval Reyes + +Maintainer +---------- + +.. image:: https://odoo-community.org/logo.png + :alt: Odoo Community Association + :target: https://odoo-community.org + +This module is maintained by the OCA. + +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. + +To contribute to this module, please visit http://odoo-community.org. diff --git a/crm_claim_rma_code/__init__.py b/crm_claim_rma_code/__init__.py new file mode 100644 index 00000000..001e1f21 --- /dev/null +++ b/crm_claim_rma_code/__init__.py @@ -0,0 +1,22 @@ +# -*- coding: utf-8 -*- +############################################################################## +# +# Copyright 2015 Vauxoo +# Author: Osval Reyes, Yanina Aular +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as +# published by the Free Software Foundation, either version 3 of the +# License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . +# +############################################################################## + +from . import models diff --git a/crm_claim_rma_code/__openerp__.py b/crm_claim_rma_code/__openerp__.py new file mode 100644 index 00000000..fa388721 --- /dev/null +++ b/crm_claim_rma_code/__openerp__.py @@ -0,0 +1,39 @@ +# -*- coding: utf-8 -*- +############################################################################## +# +# Copyright 2015 Vauxoo +# Author: Osval Reyes, Yanina Aular +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as +# published by the Free Software Foundation, either version 3 of the +# License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . +# +############################################################################## + +{ + 'name': 'CRM Claim RMA Code', + 'version': '8.0.1.0.0', + 'category': 'Generic Modules/CRM & SRM', + 'author': 'Vauxoo,Odoo Community Association (OCA)', + 'website': 'http://www.vauxoo.com/', + 'license': 'AGPL-3', + 'depends': [ + 'crm_claim_type', + 'crm_claim_code', + ], + 'data': [ + 'data/ir_sequence_type.xml', + 'views/crm_claim_type.xml', + ], + 'active': True, + 'installable': True, +} diff --git a/crm_claim_rma_code/data/ir_sequence_type.xml b/crm_claim_rma_code/data/ir_sequence_type.xml new file mode 100644 index 00000000..9aa1952b --- /dev/null +++ b/crm_claim_rma_code/data/ir_sequence_type.xml @@ -0,0 +1,69 @@ + + + + + + CRM Claim Supplier + crm.claim.rma.supplier + + + + CRM Claim Supplier + crm.claim.rma.supplier + 5 + RMA-V/%(year)s/ + + + + CRM Claim Client + crm.claim.rma.customer + + + + CRM Claim Client + crm.claim.rma.customer + 5 + RMA-C/%(year)s/ + + + + CRM Claim + crm.claim.rma.basic + + + + CRM Claim + crm.claim.rma.basic + 5 + RMA/%(year)s/ + + + + Claim Line + claim.line + + + + Claim Line + claim.line + + no_gap + RMA-R/ + + + + + + + + + + + + diff --git a/crm_claim_rma_code/i18n/crm_claim_rma_code.pot b/crm_claim_rma_code/i18n/crm_claim_rma_code.pot new file mode 100644 index 00000000..e863f3a6 --- /dev/null +++ b/crm_claim_rma_code/i18n/crm_claim_rma_code.pot @@ -0,0 +1,22 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * crm_claim_rma_number +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 8.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2015-07-17 19:13+0000\n" +"PO-Revision-Date: 2015-07-17 19:13+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_rma_code +#: field:crm.claim.type,ir_sequence_id:0 +msgid "Sequence Number" +msgstr "" + diff --git a/crm_claim_rma_code/i18n/es.po b/crm_claim_rma_code/i18n/es.po new file mode 100644 index 00000000..5f70c46d --- /dev/null +++ b/crm_claim_rma_code/i18n/es.po @@ -0,0 +1,22 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * crm_claim_rma_number +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 8.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2015-07-17 19:13+0000\n" +"PO-Revision-Date: 2015-07-17 19:13+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_rma_code +#: field:crm.claim.type,ir_sequence_id:0 +msgid "Sequence Number" +msgstr "Número de secuencia" + diff --git a/crm_claim_rma_code/i18n/es_MX.po b/crm_claim_rma_code/i18n/es_MX.po new file mode 100644 index 00000000..d48c7457 --- /dev/null +++ b/crm_claim_rma_code/i18n/es_MX.po @@ -0,0 +1,16 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * crm_claim_rma_number +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 8.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2015-07-17 19:13+0000\n" +"PO-Revision-Date: 2015-07-17 19:13+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" diff --git a/crm_claim_rma_code/i18n/es_PA.po b/crm_claim_rma_code/i18n/es_PA.po new file mode 100644 index 00000000..d48c7457 --- /dev/null +++ b/crm_claim_rma_code/i18n/es_PA.po @@ -0,0 +1,16 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * crm_claim_rma_number +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 8.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2015-07-17 19:13+0000\n" +"PO-Revision-Date: 2015-07-17 19:13+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" diff --git a/crm_claim_rma_code/i18n/es_VE.po b/crm_claim_rma_code/i18n/es_VE.po new file mode 100644 index 00000000..d48c7457 --- /dev/null +++ b/crm_claim_rma_code/i18n/es_VE.po @@ -0,0 +1,16 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * crm_claim_rma_number +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 8.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2015-07-17 19:13+0000\n" +"PO-Revision-Date: 2015-07-17 19:13+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" diff --git a/crm_claim_rma_code/models/__init__.py b/crm_claim_rma_code/models/__init__.py new file mode 100644 index 00000000..9810edcc --- /dev/null +++ b/crm_claim_rma_code/models/__init__.py @@ -0,0 +1,22 @@ +# -*- coding: utf-8 -*- +############################################################################## +# +# Copyright 2015 Vauxoo +# Author: Osval Reyes, Yanina Aular +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as +# published by the Free Software Foundation, either version 3 of the +# License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . +# +############################################################################## + +from . import crm_claim_type diff --git a/crm_claim_rma_code/models/crm_claim_type.py b/crm_claim_rma_code/models/crm_claim_type.py new file mode 100644 index 00000000..a13c29e5 --- /dev/null +++ b/crm_claim_rma_code/models/crm_claim_type.py @@ -0,0 +1,33 @@ +# -*- coding: utf-8 -*- +############################################################################## +# +# Copyright 2015 Vauxoo +# Author: Osval Reyes, Yanina Aular +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as +# published by the Free Software Foundation, either version 3 of the +# License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . +# +############################################################################## +from openerp import fields, models + + +class CrmClaimType(models.Model): + + _inherit = 'crm.claim.type' + + ir_sequence_id = \ + fields.Many2one('ir.sequence', + string='Sequence Code', + default=lambda self: self.env['ir.sequence']. + search([('code', '=', 'crm.claim.rma.basic')]) + ) diff --git a/crm_claim_rma_code/views/crm_claim_type.xml b/crm_claim_rma_code/views/crm_claim_type.xml new file mode 100644 index 00000000..6c178e42 --- /dev/null +++ b/crm_claim_rma_code/views/crm_claim_type.xml @@ -0,0 +1,25 @@ + + + + + crm.claim.type.form + crm.claim.type + + + + + + + + + crm.claim.type.tree + crm.claim.type + + + + + + + + +