From 5b050c8182e054eb6374deeea66d84784b5d4f54 Mon Sep 17 00:00:00 2001 From: cubells Date: Tue, 5 Sep 2017 18:03:31 +0200 Subject: [PATCH] [MIG] crm_claim_code: Migration to 10.0 --- crm_claim_code/README.rst | 28 +++++++--- crm_claim_code/__init__.py | 8 +-- crm_claim_code/__manifest__.py | 18 ++---- crm_claim_code/data/claim_sequence.xml | 20 +++---- crm_claim_code/i18n/bg.po | 34 ----------- crm_claim_code/i18n/crm_claim_code.pot | 32 ----------- crm_claim_code/i18n/de.po | 33 ----------- crm_claim_code/i18n/es.po | 19 +++---- crm_claim_code/i18n/es_MX.po | 33 ----------- crm_claim_code/i18n/es_VE.po | 33 ----------- crm_claim_code/i18n/fr.po | 33 ----------- crm_claim_code/i18n/hr.po | 33 ----------- crm_claim_code/i18n/nb.po | 33 ----------- crm_claim_code/i18n/pt_BR.po | 33 ----------- crm_claim_code/i18n/sk.po | 34 ----------- crm_claim_code/i18n/sl.po | 33 ----------- crm_claim_code/i18n/sv.po | 33 ----------- crm_claim_code/models/__init__.py | 5 +- crm_claim_code/models/crm_claim.py | 24 ++++---- crm_claim_code/tests/__init__.py | 6 +- crm_claim_code/tests/test_crm_claim_code.py | 35 ++++++------ crm_claim_code/views/crm_claim_view.xml | 62 ++++++++++----------- 22 files changed, 117 insertions(+), 505 deletions(-) delete mode 100644 crm_claim_code/i18n/bg.po delete mode 100644 crm_claim_code/i18n/crm_claim_code.pot delete mode 100644 crm_claim_code/i18n/de.po delete mode 100644 crm_claim_code/i18n/es_MX.po delete mode 100644 crm_claim_code/i18n/es_VE.po delete mode 100644 crm_claim_code/i18n/fr.po delete mode 100644 crm_claim_code/i18n/hr.po delete mode 100644 crm_claim_code/i18n/nb.po delete mode 100644 crm_claim_code/i18n/pt_BR.po delete mode 100644 crm_claim_code/i18n/sk.po delete mode 100644 crm_claim_code/i18n/sl.po delete mode 100644 crm_claim_code/i18n/sv.po diff --git a/crm_claim_code/README.rst b/crm_claim_code/README.rst index 92daeb36bc9..4b64577404b 100644 --- a/crm_claim_code/README.rst +++ b/crm_claim_code/README.rst @@ -1,20 +1,33 @@ .. image:: https://img.shields.io/badge/licence-AGPL--3-blue.svg - :alt: License: AGPL-3 + :target: http://www.gnu.org/licenses/agpl + :alt: License: AGPL-3 +========================== Sequential code for claims ========================== * This module adds a sequential code for claims. +Usage +===== + +To use this module, you need to: + +* Go to menu **CRM > After Sale > Services > Claims** and create a new claim. +* Enter claim subject and Save. You must see a new number for this claim. + + +.. image:: https://odoo-community.org/website/image/ir.attachment/5784_f2813bd/datas + :alt: Try me on Runbot + :target: https://runbot.odoo-community.org/runbot/111/10.0 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 `_. - +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 smash it by providing detailed and welcomed +feedback. Credits ======= @@ -27,6 +40,7 @@ Contributors * Iker Coranti * Oihane Crucelaegui * Alfredo de la Fuente +* Vicent Cubells Maintainer ---------- @@ -41,4 +55,4 @@ 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. +To contribute to this module, please visit https://odoo-community.org. diff --git a/crm_claim_code/__init__.py b/crm_claim_code/__init__.py index 6a9ea6586d3..bdfe4e3e336 100644 --- a/crm_claim_code/__init__.py +++ b/crm_claim_code/__init__.py @@ -1,11 +1,9 @@ # -*- coding: utf-8 -*- -############################################################################## -# For copyright and license notices, see __openerp__.py file in root directory -############################################################################## +# License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl). from . import models -from openerp.api import Environment -from openerp import SUPERUSER_ID +from odoo.api import Environment +from odoo import SUPERUSER_ID new_field_code_added = False diff --git a/crm_claim_code/__manifest__.py b/crm_claim_code/__manifest__.py index fe6c0aba57e..1ab8499dc5d 100644 --- a/crm_claim_code/__manifest__.py +++ b/crm_claim_code/__manifest__.py @@ -1,10 +1,12 @@ # -*- coding: utf-8 -*- -# © 2015 Serv. Tec. Avanzados - Pedro M. Baeza (http://www.serviciosbaeza.com) -# © 2015 AvanzOsc (http://www.avanzosc.es) +# Copyright 2015 Serv. Tec. Avanzados - Pedro M. Baeza (http://www.serviciosbaeza.com) +# Copyright 2015 AvanzOsc (http://www.avanzosc.es) +# Copyright 2017 Tecnativa - Vicent Cubells +# License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl). { "name": "Sequential Code for Claims", - "version": "9.0.1.0.0", + "version": "10.0.1.0.0", "category": "Customer Relationship Management", "author": "OdooMRP team, " "AvanzOSC, " @@ -12,14 +14,6 @@ "Odoo Community Association (OCA)", "website": "http://www.avanzosc.es", "license": "AGPL-3", - "contributors": [ - "Pedro M. Baeza ", - "Ana Juaristi ", - "Iker Coranti ", - "Oihane Crucelaegui ", - "Alfredo de la Fuente ", - "Cyril Gaudin ", - ], "depends": [ "crm_claim", ], @@ -27,7 +21,7 @@ "views/crm_claim_view.xml", "data/claim_sequence.xml", ], - 'installable': False, + 'installable': True, "pre_init_hook": "create_code_equal_to_id", "post_init_hook": "assign_old_sequences", } diff --git a/crm_claim_code/data/claim_sequence.xml b/crm_claim_code/data/claim_sequence.xml index b72d8f4ad82..e6073ea457f 100644 --- a/crm_claim_code/data/claim_sequence.xml +++ b/crm_claim_code/data/claim_sequence.xml @@ -1,11 +1,11 @@ - - - - Claim Code - crm.claim - - CLM - - - + + + + Claim Code + crm.claim + + CLM + + + diff --git a/crm_claim_code/i18n/bg.po b/crm_claim_code/i18n/bg.po deleted file mode 100644 index afb5a583626..00000000000 --- a/crm_claim_code/i18n/bg.po +++ /dev/null @@ -1,34 +0,0 @@ -# Translation of Odoo Server. -# This file contains the translation of the following modules: -# * crm_claim_code -# -# Translators: -# Kaloyan Naumov , 2016 -msgid "" -msgstr "" -"Project-Id-Version: crm (9.0)\n" -"Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2016-11-26 03:41+0000\n" -"PO-Revision-Date: 2016-10-10 18:30+0000\n" -"Last-Translator: Kaloyan Naumov \n" -"Language-Team: Bulgarian (http://www.transifex.com/oca/OCA-crm-9-0/language/bg/)\n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: \n" -"Language: bg\n" -"Plural-Forms: nplurals=2; plural=(n != 1);\n" - -#. module: crm_claim_code -#: model:ir.model,name:crm_claim_code.model_crm_claim -msgid "Claim" -msgstr "Жалба" - -#. module: crm_claim_code -#: model:ir.model.fields,field_description:crm_claim_code.field_crm_claim_code -msgid "Claim Number" -msgstr "Жалба Номер" - -#. module: crm_claim_code -#: sql_constraint:crm.claim:0 -msgid "The code must be unique!" -msgstr "Номерът трябва да е уникален!" diff --git a/crm_claim_code/i18n/crm_claim_code.pot b/crm_claim_code/i18n/crm_claim_code.pot deleted file mode 100644 index 8960bac7ff9..00000000000 --- a/crm_claim_code/i18n/crm_claim_code.pot +++ /dev/null @@ -1,32 +0,0 @@ -# Translation of Odoo Server. -# This file contains the translation of the following modules: -# * crm_claim_code -# -msgid "" -msgstr "" -"Project-Id-Version: Odoo Server 8.0\n" -"Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2015-06-18 14:21+0000\n" -"PO-Revision-Date: 2015-06-18 14:21+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_code -#: model:ir.model,name:crm_claim_code.model_crm_claim -msgid "Claim" -msgstr "" - -#. module: crm_claim_code -#: field:crm.claim,code:0 -msgid "Claim Number" -msgstr "" - -#. module: crm_claim_code -#: sql_constraint:crm.claim:0 -msgid "The code must be unique!" -msgstr "" - diff --git a/crm_claim_code/i18n/de.po b/crm_claim_code/i18n/de.po deleted file mode 100644 index d8a119f3924..00000000000 --- a/crm_claim_code/i18n/de.po +++ /dev/null @@ -1,33 +0,0 @@ -# Translation of Odoo Server. -# This file contains the translation of the following modules: -# * crm_claim_code -# -# Translators: -msgid "" -msgstr "" -"Project-Id-Version: crm (9.0)\n" -"Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2017-03-28 02:27+0000\n" -"PO-Revision-Date: 2016-05-19 09:44+0000\n" -"Last-Translator: <>\n" -"Language-Team: German (http://www.transifex.com/oca/OCA-crm-9-0/language/de/)\n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: \n" -"Language: de\n" -"Plural-Forms: nplurals=2; plural=(n != 1);\n" - -#. module: crm_claim_code -#: model:ir.model,name:crm_claim_code.model_crm_claim -msgid "Claim" -msgstr "Forderung" - -#. module: crm_claim_code -#: model:ir.model.fields,field_description:crm_claim_code.field_crm_claim_code -msgid "Claim Number" -msgstr "Forderungsnummer" - -#. module: crm_claim_code -#: sql_constraint:crm.claim:0 -msgid "The code must be unique!" -msgstr "Der Schlüssel muss eindeutig sein!" diff --git a/crm_claim_code/i18n/es.po b/crm_claim_code/i18n/es.po index 8b40094f591..e4494af0652 100644 --- a/crm_claim_code/i18n/es.po +++ b/crm_claim_code/i18n/es.po @@ -1,21 +1,19 @@ # Translation of Odoo Server. # This file contains the translation of the following modules: -# * crm_claim_code -# -# Translators: +# * crm_claim_code +# msgid "" msgstr "" -"Project-Id-Version: crm (9.0)\n" +"Project-Id-Version: Odoo Server 10.0\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2016-05-20 02:44+0000\n" -"PO-Revision-Date: 2016-05-19 09:45+0000\n" -"Last-Translator: OCA Transbot \n" -"Language-Team: Spanish (http://www.transifex.com/oca/OCA-crm-9-0/language/es/)\n" +"POT-Creation-Date: 2017-09-05 16:00+0000\n" +"PO-Revision-Date: 2017-09-05 16:00+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" -"Language: es\n" -"Plural-Forms: nplurals=2; plural=(n != 1);\n" +"Plural-Forms: \n" #. module: crm_claim_code #: model:ir.model,name:crm_claim_code.model_crm_claim @@ -31,3 +29,4 @@ msgstr "Número de reclamación" #: sql_constraint:crm.claim:0 msgid "The code must be unique!" msgstr "¡El número debe de ser único!" + diff --git a/crm_claim_code/i18n/es_MX.po b/crm_claim_code/i18n/es_MX.po deleted file mode 100644 index 460e3d75365..00000000000 --- a/crm_claim_code/i18n/es_MX.po +++ /dev/null @@ -1,33 +0,0 @@ -# Translation of Odoo Server. -# This file contains the translation of the following modules: -# * crm_claim_code -# -# Translators: -msgid "" -msgstr "" -"Project-Id-Version: crm (9.0)\n" -"Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2016-05-20 02:44+0000\n" -"PO-Revision-Date: 2016-05-19 09:44+0000\n" -"Last-Translator: <>\n" -"Language-Team: Spanish (Mexico) (http://www.transifex.com/oca/OCA-crm-9-0/language/es_MX/)\n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: \n" -"Language: es_MX\n" -"Plural-Forms: nplurals=2; plural=(n != 1);\n" - -#. module: crm_claim_code -#: model:ir.model,name:crm_claim_code.model_crm_claim -msgid "Claim" -msgstr "Reclamo" - -#. module: crm_claim_code -#: model:ir.model.fields,field_description:crm_claim_code.field_crm_claim_code -msgid "Claim Number" -msgstr "" - -#. module: crm_claim_code -#: sql_constraint:crm.claim:0 -msgid "The code must be unique!" -msgstr "" diff --git a/crm_claim_code/i18n/es_VE.po b/crm_claim_code/i18n/es_VE.po deleted file mode 100644 index 3dc63afdd91..00000000000 --- a/crm_claim_code/i18n/es_VE.po +++ /dev/null @@ -1,33 +0,0 @@ -# Translation of Odoo Server. -# This file contains the translation of the following modules: -# * crm_claim_code -# -# Translators: -msgid "" -msgstr "" -"Project-Id-Version: crm (9.0)\n" -"Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2016-05-20 02:44+0000\n" -"PO-Revision-Date: 2016-05-19 09:44+0000\n" -"Last-Translator: <>\n" -"Language-Team: Spanish (Venezuela) (http://www.transifex.com/oca/OCA-crm-9-0/language/es_VE/)\n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: \n" -"Language: es_VE\n" -"Plural-Forms: nplurals=2; plural=(n != 1);\n" - -#. module: crm_claim_code -#: model:ir.model,name:crm_claim_code.model_crm_claim -msgid "Claim" -msgstr "Reclamo" - -#. module: crm_claim_code -#: model:ir.model.fields,field_description:crm_claim_code.field_crm_claim_code -msgid "Claim Number" -msgstr "" - -#. module: crm_claim_code -#: sql_constraint:crm.claim:0 -msgid "The code must be unique!" -msgstr "" diff --git a/crm_claim_code/i18n/fr.po b/crm_claim_code/i18n/fr.po deleted file mode 100644 index 9a5d97d4a94..00000000000 --- a/crm_claim_code/i18n/fr.po +++ /dev/null @@ -1,33 +0,0 @@ -# Translation of Odoo Server. -# This file contains the translation of the following modules: -# * crm_claim_code -# -# Translators: -msgid "" -msgstr "" -"Project-Id-Version: crm (9.0)\n" -"Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2016-11-26 03:41+0000\n" -"PO-Revision-Date: 2016-05-19 09:44+0000\n" -"Last-Translator: <>\n" -"Language-Team: French (http://www.transifex.com/oca/OCA-crm-9-0/language/fr/)\n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: \n" -"Language: fr\n" -"Plural-Forms: nplurals=2; plural=(n > 1);\n" - -#. module: crm_claim_code -#: model:ir.model,name:crm_claim_code.model_crm_claim -msgid "Claim" -msgstr "Réclamation" - -#. module: crm_claim_code -#: model:ir.model.fields,field_description:crm_claim_code.field_crm_claim_code -msgid "Claim Number" -msgstr "" - -#. module: crm_claim_code -#: sql_constraint:crm.claim:0 -msgid "The code must be unique!" -msgstr "Le code doit être unique!" diff --git a/crm_claim_code/i18n/hr.po b/crm_claim_code/i18n/hr.po deleted file mode 100644 index 269f0d2a781..00000000000 --- a/crm_claim_code/i18n/hr.po +++ /dev/null @@ -1,33 +0,0 @@ -# Translation of Odoo Server. -# This file contains the translation of the following modules: -# * crm_claim_code -# -# Translators: -msgid "" -msgstr "" -"Project-Id-Version: crm (9.0)\n" -"Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2016-07-01 15:03+0000\n" -"PO-Revision-Date: 2016-05-19 09:44+0000\n" -"Last-Translator: <>\n" -"Language-Team: Croatian (http://www.transifex.com/oca/OCA-crm-9-0/language/hr/)\n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: \n" -"Language: hr\n" -"Plural-Forms: nplurals=3; plural=n%10==1 && n%100!=11 ? 0 : n%10>=2 && n%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2;\n" - -#. module: crm_claim_code -#: model:ir.model,name:crm_claim_code.model_crm_claim -msgid "Claim" -msgstr "Potraživanje" - -#. module: crm_claim_code -#: model:ir.model.fields,field_description:crm_claim_code.field_crm_claim_code -msgid "Claim Number" -msgstr "" - -#. module: crm_claim_code -#: sql_constraint:crm.claim:0 -msgid "The code must be unique!" -msgstr "" diff --git a/crm_claim_code/i18n/nb.po b/crm_claim_code/i18n/nb.po deleted file mode 100644 index ec399b80570..00000000000 --- a/crm_claim_code/i18n/nb.po +++ /dev/null @@ -1,33 +0,0 @@ -# Translation of Odoo Server. -# This file contains the translation of the following modules: -# * crm_claim_code -# -# Translators: -msgid "" -msgstr "" -"Project-Id-Version: crm (9.0)\n" -"Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2017-01-14 11:05+0000\n" -"PO-Revision-Date: 2016-05-19 09:44+0000\n" -"Last-Translator: <>\n" -"Language-Team: Norwegian Bokmål (http://www.transifex.com/oca/OCA-crm-9-0/language/nb/)\n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: \n" -"Language: nb\n" -"Plural-Forms: nplurals=2; plural=(n != 1);\n" - -#. module: crm_claim_code -#: model:ir.model,name:crm_claim_code.model_crm_claim -msgid "Claim" -msgstr "Reklamasjon" - -#. module: crm_claim_code -#: model:ir.model.fields,field_description:crm_claim_code.field_crm_claim_code -msgid "Claim Number" -msgstr "" - -#. module: crm_claim_code -#: sql_constraint:crm.claim:0 -msgid "The code must be unique!" -msgstr "" diff --git a/crm_claim_code/i18n/pt_BR.po b/crm_claim_code/i18n/pt_BR.po deleted file mode 100644 index b39a21f45f8..00000000000 --- a/crm_claim_code/i18n/pt_BR.po +++ /dev/null @@ -1,33 +0,0 @@ -# Translation of Odoo Server. -# This file contains the translation of the following modules: -# * crm_claim_code -# -# Translators: -msgid "" -msgstr "" -"Project-Id-Version: crm (9.0)\n" -"Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2017-01-14 11:05+0000\n" -"PO-Revision-Date: 2016-05-19 09:44+0000\n" -"Last-Translator: <>\n" -"Language-Team: Portuguese (Brazil) (http://www.transifex.com/oca/OCA-crm-9-0/language/pt_BR/)\n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: \n" -"Language: pt_BR\n" -"Plural-Forms: nplurals=2; plural=(n > 1);\n" - -#. module: crm_claim_code -#: model:ir.model,name:crm_claim_code.model_crm_claim -msgid "Claim" -msgstr "Reclamação" - -#. module: crm_claim_code -#: model:ir.model.fields,field_description:crm_claim_code.field_crm_claim_code -msgid "Claim Number" -msgstr "" - -#. module: crm_claim_code -#: sql_constraint:crm.claim:0 -msgid "The code must be unique!" -msgstr "" diff --git a/crm_claim_code/i18n/sk.po b/crm_claim_code/i18n/sk.po deleted file mode 100644 index ee9f309ab0d..00000000000 --- a/crm_claim_code/i18n/sk.po +++ /dev/null @@ -1,34 +0,0 @@ -# Translation of Odoo Server. -# This file contains the translation of the following modules: -# * crm_claim_code -# -# Translators: -# gebri , 2016 -msgid "" -msgstr "" -"Project-Id-Version: crm (9.0)\n" -"Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2016-12-17 01:29+0000\n" -"PO-Revision-Date: 2016-12-22 20:15+0000\n" -"Last-Translator: gebri \n" -"Language-Team: Slovak (http://www.transifex.com/oca/OCA-crm-9-0/language/sk/)\n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: \n" -"Language: sk\n" -"Plural-Forms: nplurals=3; plural=(n==1) ? 0 : (n>=2 && n<=4) ? 1 : 2;\n" - -#. module: crm_claim_code -#: model:ir.model,name:crm_claim_code.model_crm_claim -msgid "Claim" -msgstr "Reklamácia" - -#. module: crm_claim_code -#: model:ir.model.fields,field_description:crm_claim_code.field_crm_claim_code -msgid "Claim Number" -msgstr "Číslo Reklamácie" - -#. module: crm_claim_code -#: sql_constraint:crm.claim:0 -msgid "The code must be unique!" -msgstr "Kód musí byť jedinečný!" diff --git a/crm_claim_code/i18n/sl.po b/crm_claim_code/i18n/sl.po deleted file mode 100644 index cd91e333f3b..00000000000 --- a/crm_claim_code/i18n/sl.po +++ /dev/null @@ -1,33 +0,0 @@ -# Translation of Odoo Server. -# This file contains the translation of the following modules: -# * crm_claim_code -# -# Translators: -msgid "" -msgstr "" -"Project-Id-Version: crm (9.0)\n" -"Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2017-01-14 11:05+0000\n" -"PO-Revision-Date: 2016-05-19 09:44+0000\n" -"Last-Translator: <>\n" -"Language-Team: Slovenian (http://www.transifex.com/oca/OCA-crm-9-0/language/sl/)\n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: \n" -"Language: sl\n" -"Plural-Forms: nplurals=4; plural=(n%100==1 ? 0 : n%100==2 ? 1 : n%100==3 || n%100==4 ? 2 : 3);\n" - -#. module: crm_claim_code -#: model:ir.model,name:crm_claim_code.model_crm_claim -msgid "Claim" -msgstr "Zahtevek" - -#. module: crm_claim_code -#: model:ir.model.fields,field_description:crm_claim_code.field_crm_claim_code -msgid "Claim Number" -msgstr "" - -#. module: crm_claim_code -#: sql_constraint:crm.claim:0 -msgid "The code must be unique!" -msgstr "" diff --git a/crm_claim_code/i18n/sv.po b/crm_claim_code/i18n/sv.po deleted file mode 100644 index ac84d64c299..00000000000 --- a/crm_claim_code/i18n/sv.po +++ /dev/null @@ -1,33 +0,0 @@ -# Translation of Odoo Server. -# This file contains the translation of the following modules: -# * crm_claim_code -# -# Translators: -msgid "" -msgstr "" -"Project-Id-Version: crm (9.0)\n" -"Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2017-01-14 11:05+0000\n" -"PO-Revision-Date: 2016-05-19 09:44+0000\n" -"Last-Translator: <>\n" -"Language-Team: Swedish (http://www.transifex.com/oca/OCA-crm-9-0/language/sv/)\n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: \n" -"Language: sv\n" -"Plural-Forms: nplurals=2; plural=(n != 1);\n" - -#. module: crm_claim_code -#: model:ir.model,name:crm_claim_code.model_crm_claim -msgid "Claim" -msgstr "Reklamation" - -#. module: crm_claim_code -#: model:ir.model.fields,field_description:crm_claim_code.field_crm_claim_code -msgid "Claim Number" -msgstr "" - -#. module: crm_claim_code -#: sql_constraint:crm.claim:0 -msgid "The code must be unique!" -msgstr "" diff --git a/crm_claim_code/models/__init__.py b/crm_claim_code/models/__init__.py index e01f8e95922..67c1a4b4481 100644 --- a/crm_claim_code/models/__init__.py +++ b/crm_claim_code/models/__init__.py @@ -1,5 +1,4 @@ # -*- coding: utf-8 -*- -############################################################################## -# For copyright and license notices, see __openerp__.py file in root directory -############################################################################## +# License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl). + from . import crm_claim diff --git a/crm_claim_code/models/crm_claim.py b/crm_claim_code/models/crm_claim.py index 63789883f02..f5651248932 100644 --- a/crm_claim_code/models/crm_claim.py +++ b/crm_claim_code/models/crm_claim.py @@ -1,16 +1,21 @@ # -*- coding: utf-8 -*- -############################################################################## -# For copyright and license notices, see __openerp__.py file in root directory -############################################################################## +# Copyright 2015 Tecnativa - Pedro M. Baeza +# Copyright 2015 AvanzOsc (http://www.avanzosc.es) +# Copyright 2017 Tecnativa - Vicent Cubells +# License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl). -from openerp import models, fields, api +from odoo import api, fields, models class CrmClaim(models.Model): _inherit = "crm.claim" code = fields.Char( - string='Claim Number', required=True, default="/", readonly=True) + string='Claim Number', + required=True, + default="/", + readonly=True, + ) _sql_constraints = [ ('crm_claim_unique_code', 'UNIQUE (code)', @@ -18,10 +23,10 @@ class CrmClaim(models.Model): ] @api.model - def create(self, vals): - if vals.get('code', '/') == '/': - vals['code'] = self.env['ir.sequence'].next_by_code('crm.claim') - return super(CrmClaim, self).create(vals) + def create(self, values): + if values.get('code', '/') == '/': + values['code'] = self.env['ir.sequence'].next_by_code('crm.claim') + return super(CrmClaim, self).create(values) @api.multi def copy(self, default=None): @@ -30,5 +35,4 @@ def copy(self, default=None): default = {} if 'code' not in default: default['code'] = self.env['ir.sequence'].next_by_code('crm.claim') - return super(CrmClaim, self).copy(default) diff --git a/crm_claim_code/tests/__init__.py b/crm_claim_code/tests/__init__.py index f3b453bb032..c2cdadbc780 100644 --- a/crm_claim_code/tests/__init__.py +++ b/crm_claim_code/tests/__init__.py @@ -1,6 +1,4 @@ -# -*- encoding: utf-8 -*- -############################################################################## -# For copyright and license notices, see __openerp__.py file in root directory -############################################################################## +# -*- coding: utf-8 -*- +# License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl). from . import test_crm_claim_code diff --git a/crm_claim_code/tests/test_crm_claim_code.py b/crm_claim_code/tests/test_crm_claim_code.py index bf86f41db24..015ae5a521d 100644 --- a/crm_claim_code/tests/test_crm_claim_code.py +++ b/crm_claim_code/tests/test_crm_claim_code.py @@ -1,19 +1,22 @@ -# -*- encoding: utf-8 -*- -############################################################################## -# For copyright and license notices, see __openerp__.py file in root directory -############################################################################## - -import openerp.tests.common as common - - -class TestCrmClaimCode(common.TransactionCase): - - def setUp(self): - super(TestCrmClaimCode, self).setUp() - self.crm_claim_model = self.env['crm.claim'] - self.ir_sequence_model = self.env['ir.sequence'] - self.crm_sequence = self.env.ref('crm_claim_code.sequence_claim') - self.crm_claim = self.env.ref('crm_claim.crm_claim_1') +# -*- coding: utf-8 -*- +# Copyright 2015 Tecnativa - Pedro M. Baeza +# Copyright 2015 AvanzOsc (http://www.avanzosc.es) +# Copyright 2017 Tecnativa - Vicent Cubells +# License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl). + +from odoo.tests import common + + +class TestCrmClaimCode(common.SavepointCase): + @classmethod + def setUpClass(cls): + super(TestCrmClaimCode, cls).setUpClass() + cls.crm_claim_model = cls.env['crm.claim'] + cls.ir_sequence_model = cls.env['ir.sequence'] + cls.crm_sequence = cls.env.ref('crm_claim_code.sequence_claim') + cls.crm_claim = cls.env['crm.claim'].create({ + 'name': 'Test Claim', + }) def test_old_claim_code_assign(self): crm_claims = self.crm_claim_model.search([]) diff --git a/crm_claim_code/views/crm_claim_view.xml b/crm_claim_code/views/crm_claim_view.xml index 9e867268a74..d03348abc21 100644 --- a/crm_claim_code/views/crm_claim_view.xml +++ b/crm_claim_code/views/crm_claim_view.xml @@ -1,37 +1,37 @@ - - - - crm.claim.add.seq.form.view.inh - crm.claim - - - - - + + + + crm.claim.add.seq.form.view.inh + crm.claim + + + + - + + - - crm.claim.add.seq.tree.view.inh - crm.claim - - - - - + + crm.claim.add.seq.tree.view.inh + crm.claim + + + + - + + - - view.crm.case.claims.filter.inh.claimseq - crm.claim - - - - ['|', ('name', 'ilike', self), ('code', 'ilike', self)] - + + view.crm.case.claims.filter.inh.claimseq + crm.claim + + + + ['|', ('name', 'ilike', self), ('code', 'ilike', self)] - - - + + + +