From baefdb9ba1b97d75d5ac39cd0c994434a8a3c747 Mon Sep 17 00:00:00 2001 From: oihane Date: Mon, 27 Jul 2015 17:49:45 +0200 Subject: [PATCH 01/31] [ADD] New module --- crm_lead_code/README.rst | 43 ++++++++++++++++++++ crm_lead_code/__init__.py | 25 ++++++++++++ crm_lead_code/__openerp__.py | 48 +++++++++++++++++++++++ crm_lead_code/data/lead_sequence.xml | 15 +++++++ crm_lead_code/i18n/crm_lead_code.pot | 32 +++++++++++++++ crm_lead_code/i18n/es.po | 32 +++++++++++++++ crm_lead_code/models/__init__.py | 5 +++ crm_lead_code/models/crm_lead.py | 31 +++++++++++++++ crm_lead_code/tests/__init__.py | 6 +++ crm_lead_code/tests/test_crm_lead_code.py | 45 +++++++++++++++++++++ crm_lead_code/views/crm_lead_view.xml | 37 +++++++++++++++++ 11 files changed, 319 insertions(+) create mode 100644 crm_lead_code/README.rst create mode 100644 crm_lead_code/__init__.py create mode 100644 crm_lead_code/__openerp__.py create mode 100644 crm_lead_code/data/lead_sequence.xml create mode 100644 crm_lead_code/i18n/crm_lead_code.pot create mode 100644 crm_lead_code/i18n/es.po create mode 100644 crm_lead_code/models/__init__.py create mode 100644 crm_lead_code/models/crm_lead.py create mode 100644 crm_lead_code/tests/__init__.py create mode 100644 crm_lead_code/tests/test_crm_lead_code.py create mode 100644 crm_lead_code/views/crm_lead_view.xml diff --git a/crm_lead_code/README.rst b/crm_lead_code/README.rst new file mode 100644 index 00000000000..3c887951bb2 --- /dev/null +++ b/crm_lead_code/README.rst @@ -0,0 +1,43 @@ +.. image:: https://img.shields.io/badge/licence-AGPL--3-blue.svg + :alt: License: AGPL-3 + +Sequential code for leads +========================= + +* This module adds a sequential code for leads. + + +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 +------------ + +* Oihane Crucelaegui +* Pedro M. Baeza +* Ana Juaristi + +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_lead_code/__init__.py b/crm_lead_code/__init__.py new file mode 100644 index 00000000000..e12b746cb94 --- /dev/null +++ b/crm_lead_code/__init__.py @@ -0,0 +1,25 @@ +# -*- coding: utf-8 -*- +############################################################################## +# For copyright and license notices, see __openerp__.py file in root directory +############################################################################## + +from . import models +from openerp import SUPERUSER_ID + + +def create_code_equal_to_id(cr): + cr.execute('ALTER TABLE crm_lead ' + 'ADD COLUMN code character varying;') + cr.execute('UPDATE crm_lead ' + 'SET code = id;') + + +def assign_old_sequences(cr, registry): + lead_obj = registry['crm.lead'] + sequence_obj = registry['ir.sequence'] + lead_ids = lead_obj.search(cr, SUPERUSER_ID, [], order="id") + for lead_id in lead_ids: + cr.execute('UPDATE crm_lead ' + 'SET code = \'%s\' ' + 'WHERE id = %d;' % + (sequence_obj.get(cr, SUPERUSER_ID, 'crm.lead'), lead_id)) diff --git a/crm_lead_code/__openerp__.py b/crm_lead_code/__openerp__.py new file mode 100644 index 00000000000..2e4c5427a09 --- /dev/null +++ b/crm_lead_code/__openerp__.py @@ -0,0 +1,48 @@ +# -*- encoding: utf-8 -*- +############################################################################## +# +# Copyright (c) +# 2015 Serv. Tec. Avanzados - Pedro M. Baeza (http://www.serviciosbaeza.com) +# 2015 AvanzOsc (http://www.avanzosc.es) +# +# 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": "Sequential Code for Leads", + "version": "1.0", + "category": "Customer Relationship Management", + "author": "OdooMRP team, " + "AvanzOSC, " + "Serv. Tecnol. Avanzados - Pedro M. Baeza, " + "Odoo Community Association (OCA)", + "website": "http://www.odoomrp.com", + "license": "AGPL-3", + "contributors": [ + "Oihane Crucelaegui ", + "Pedro M. Baeza ", + "Ana Juaristi ", + ], + "depends": [ + "crm", + ], + "data": [ + "views/crm_lead_view.xml", + "data/lead_sequence.xml", + ], + "installable": True, + "pre_init_hook": "create_code_equal_to_id", + "post_init_hook": "assign_old_sequences", +} diff --git a/crm_lead_code/data/lead_sequence.xml b/crm_lead_code/data/lead_sequence.xml new file mode 100644 index 00000000000..80c359efc8c --- /dev/null +++ b/crm_lead_code/data/lead_sequence.xml @@ -0,0 +1,15 @@ + + + + + Lead code type + crm.lead + + + Lead Code + crm.lead + + LD + + + diff --git a/crm_lead_code/i18n/crm_lead_code.pot b/crm_lead_code/i18n/crm_lead_code.pot new file mode 100644 index 00000000000..a7036fe50cf --- /dev/null +++ b/crm_lead_code/i18n/crm_lead_code.pot @@ -0,0 +1,32 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * crm_lead_code +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 8.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2015-07-27 15:46+0000\n" +"PO-Revision-Date: 2015-07-27 15:46+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_lead_code +#: field:crm.lead,code:0 +msgid "Lead Number" +msgstr "" + +#. module: crm_lead_code +#: model:ir.model,name:crm_lead_code.model_crm_lead +msgid "Lead/Opportunity" +msgstr "" + +#. module: crm_lead_code +#: sql_constraint:crm.lead:0 +msgid "The code must be unique!" +msgstr "" + diff --git a/crm_lead_code/i18n/es.po b/crm_lead_code/i18n/es.po new file mode 100644 index 00000000000..aa11728ead6 --- /dev/null +++ b/crm_lead_code/i18n/es.po @@ -0,0 +1,32 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * crm_lead_code +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 8.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2015-07-27 15:47+0000\n" +"PO-Revision-Date: 2015-07-27 15:47+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_lead_code +#: field:crm.lead,code:0 +msgid "Lead Number" +msgstr "N??mero de Iniciativa" + +#. module: crm_lead_code +#: model:ir.model,name:crm_lead_code.model_crm_lead +msgid "Lead/Opportunity" +msgstr "Iniciativa/Oportunidad" + +#. module: crm_lead_code +#: sql_constraint:crm.lead:0 +msgid "The code must be unique!" +msgstr "??El n??mero debe de ser ??nico!" + diff --git a/crm_lead_code/models/__init__.py b/crm_lead_code/models/__init__.py new file mode 100644 index 00000000000..9e86cd957c9 --- /dev/null +++ b/crm_lead_code/models/__init__.py @@ -0,0 +1,5 @@ +# -*- coding: utf-8 -*- +############################################################################## +# For copyright and license notices, see __openerp__.py file in root directory +############################################################################## +from . import crm_lead diff --git a/crm_lead_code/models/crm_lead.py b/crm_lead_code/models/crm_lead.py new file mode 100644 index 00000000000..4669aaf758b --- /dev/null +++ b/crm_lead_code/models/crm_lead.py @@ -0,0 +1,31 @@ +# -*- coding: utf-8 -*- +############################################################################## +# For copyright and license notices, see __openerp__.py file in root directory +############################################################################## + +from openerp import api, fields, models + + +class CrmLead(models.Model): + _inherit = "crm.lead" + + code = fields.Char( + string='Lead Number', required=True, default="/", readonly=True) + + _sql_constraints = [ + ('crm_lead_unique_code', 'UNIQUE (code)', + 'The code must be unique!'), + ] + + @api.model + def create(self, vals): + if vals.get('code', '/') == '/': + vals['code'] = self.env['ir.sequence'].get('crm.lead') + return super(CrmLead, self).create(vals) + + @api.one + def copy(self, default=None): + if default is None: + default = {} + default['code'] = self.env['ir.sequence'].get('crm.lead') + return super(CrmLead, self).copy(default) diff --git a/crm_lead_code/tests/__init__.py b/crm_lead_code/tests/__init__.py new file mode 100644 index 00000000000..2269c75f6d4 --- /dev/null +++ b/crm_lead_code/tests/__init__.py @@ -0,0 +1,6 @@ +# -*- encoding: utf-8 -*- +############################################################################## +# For copyright and license notices, see __openerp__.py file in root directory +############################################################################## + +from . import test_crm_lead_code diff --git a/crm_lead_code/tests/test_crm_lead_code.py b/crm_lead_code/tests/test_crm_lead_code.py new file mode 100644 index 00000000000..bbc44cfe949 --- /dev/null +++ b/crm_lead_code/tests/test_crm_lead_code.py @@ -0,0 +1,45 @@ +# -*- encoding: utf-8 -*- +############################################################################## +# For copyright and license notices, see __openerp__.py file in root directory +############################################################################## + +import openerp.tests.common as common + + +class TestCrmLeadCode(common.TransactionCase): + + def setUp(self): + super(TestCrmLeadCode, self).setUp() + self.crm_lead_model = self.env['crm.lead'] + self.ir_sequence_model = self.env['ir.sequence'] + self.crm_sequence = self.env.ref('crm_lead_code.sequence_lead') + self.crm_lead = self.env.ref('crm.crm_case_1') + + def test_old_lead_code_assign(self): + crm_leads = self.crm_lead_model.search([]) + for crm_lead in crm_leads: + self.assertNotEqual(crm_lead.code, '/') + + def test_new_lead_code_assign(self): + code = self._get_next_code() + crm_lead = self.crm_lead_model.create({ + 'name': 'Testing lead code', + }) + self.assertNotEqual(crm_lead.code, '/') + self.assertEqual(crm_lead.code, code) + + def test_copy_lead_code_assign(self): + code = self._get_next_code() + crm_lead_copy = self.crm_lead.copy() + self.assertNotEqual(crm_lead_copy.code, self.crm_lead.code) + self.assertEqual(crm_lead_copy.code, code) + + def _get_next_code(self): + d = self.ir_sequence_model._interpolation_dict() + prefix = self.ir_sequence_model._interpolate( + self.crm_sequence.prefix, d) + suffix = self.ir_sequence_model._interpolate( + self.crm_sequence.suffix, d) + code = (prefix + ('%%0%sd' % self.crm_sequence.padding % + self.crm_sequence.number_next_actual) + suffix) + return code diff --git a/crm_lead_code/views/crm_lead_view.xml b/crm_lead_code/views/crm_lead_view.xml new file mode 100644 index 00000000000..fa2c3b4d1da --- /dev/null +++ b/crm_lead_code/views/crm_lead_view.xml @@ -0,0 +1,37 @@ + + + + + crm.lead.code.form + crm.lead + + + + + + + + + + crm.lead.code.tree + crm.lead + + + + + + + + + + crm.lead.code.search + crm.lead + + + + ['|', ('name', 'ilike', self), ('code', 'ilike', self)] + + + + + From 307f78ddfab65277f7cda6b7b9d0b714b6df59f0 Mon Sep 17 00:00:00 2001 From: oihane Date: Tue, 28 Jul 2015 13:59:07 +0200 Subject: [PATCH 02/31] [IMP] Code made visible in opportunities [UPD] prefix versions with 8.0 --- crm_lead_code/README.rst | 6 ++--- crm_lead_code/__openerp__.py | 4 ++-- crm_lead_code/views/crm_lead_view.xml | 34 +++++++++++++++++++++++++++ 3 files changed, 39 insertions(+), 5 deletions(-) diff --git a/crm_lead_code/README.rst b/crm_lead_code/README.rst index 3c887951bb2..74f7e4b2dd9 100644 --- a/crm_lead_code/README.rst +++ b/crm_lead_code/README.rst @@ -1,10 +1,10 @@ .. image:: https://img.shields.io/badge/licence-AGPL--3-blue.svg :alt: License: AGPL-3 -Sequential code for leads -========================= +Sequential code for Leads / Opportunities +========================================= -* This module adds a sequential code for leads. +* This module adds a sequential code for leads / opportunities. Bug Tracker diff --git a/crm_lead_code/__openerp__.py b/crm_lead_code/__openerp__.py index 2e4c5427a09..39b136578e1 100644 --- a/crm_lead_code/__openerp__.py +++ b/crm_lead_code/__openerp__.py @@ -21,8 +21,8 @@ ############################################################################## { - "name": "Sequential Code for Leads", - "version": "1.0", + "name": "Sequential Code for Leads / Opportunities", + "version": "8.0.1.0.0", "category": "Customer Relationship Management", "author": "OdooMRP team, " "AvanzOSC, " diff --git a/crm_lead_code/views/crm_lead_view.xml b/crm_lead_code/views/crm_lead_view.xml index fa2c3b4d1da..6339b1ccd2d 100644 --- a/crm_lead_code/views/crm_lead_view.xml +++ b/crm_lead_code/views/crm_lead_view.xml @@ -33,5 +33,39 @@ + + + crm.lead.oppor.code.form + crm.lead + + + + + + + + + + crm.lead.oppor.code.tree + crm.lead + + + + + + + + + + crm.lead.oppor.code.search + crm.lead + + + + ['|', ('name', 'ilike', self), ('code', 'ilike', self)] + + + + From 38c2cec6f6abed9543acaca6d38190c2dc0ccfa0 Mon Sep 17 00:00:00 2001 From: "Pedro M. Baeza" Date: Wed, 14 Oct 2015 03:12:56 +0200 Subject: [PATCH 03/31] [MIG] Make modules uninstallable --- crm_lead_code/__openerp__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crm_lead_code/__openerp__.py b/crm_lead_code/__openerp__.py index 39b136578e1..8f12b01c2db 100644 --- a/crm_lead_code/__openerp__.py +++ b/crm_lead_code/__openerp__.py @@ -42,7 +42,7 @@ "views/crm_lead_view.xml", "data/lead_sequence.xml", ], - "installable": True, + 'installable': False, "pre_init_hook": "create_code_equal_to_id", "post_init_hook": "assign_old_sequences", } From 0a1df0638e72e410194bb8262d1a2dea5161eb97 Mon Sep 17 00:00:00 2001 From: "Pedro M. Baeza" Date: Thu, 6 Oct 2016 14:50:54 +0200 Subject: [PATCH 04/31] [MIG] Rename manifest files --- crm_lead_code/{__openerp__.py => __manifest__.py} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename crm_lead_code/{__openerp__.py => __manifest__.py} (100%) diff --git a/crm_lead_code/__openerp__.py b/crm_lead_code/__manifest__.py similarity index 100% rename from crm_lead_code/__openerp__.py rename to crm_lead_code/__manifest__.py From 2135a8186116a250a698ca660a6f4bb9f35d3f0e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicol=C3=A1s=20Ramos?= Date: Tue, 26 Sep 2017 09:25:48 +0100 Subject: [PATCH 05/31] [10.0][MIG] crm_lead_code (#156) --- crm_lead_code/README.rst | 12 ++++++-- crm_lead_code/__init__.py | 19 ++++++------ crm_lead_code/__manifest__.py | 6 ++-- crm_lead_code/data/lead_sequence.xml | 22 +++++--------- crm_lead_code/i18n/bg.po | 35 ++++++++++++++++++++++ crm_lead_code/i18n/de.po | 35 ++++++++++++++++++++++ crm_lead_code/i18n/es.po | 29 ++++++++++-------- crm_lead_code/i18n/fr.po | 35 ++++++++++++++++++++++ crm_lead_code/i18n/hr.po | 35 ++++++++++++++++++++++ crm_lead_code/i18n/it.po | 35 ++++++++++++++++++++++ crm_lead_code/i18n/pt_BR.po | 35 ++++++++++++++++++++++ crm_lead_code/i18n/sk.po | 35 ++++++++++++++++++++++ crm_lead_code/i18n/sl.po | 35 ++++++++++++++++++++++ crm_lead_code/i18n/tr.po | 35 ++++++++++++++++++++++ crm_lead_code/i18n/zh_CN.po | 35 ++++++++++++++++++++++ crm_lead_code/models/__init__.py | 2 +- crm_lead_code/models/crm_lead.py | 12 ++++---- crm_lead_code/static/description/icon.png | Bin 0 -> 9455 bytes crm_lead_code/tests/__init__.py | 4 +-- crm_lead_code/tests/test_crm_lead_code.py | 19 +++++------- crm_lead_code/views/crm_lead_view.xml | 28 +++++++++++------ 21 files changed, 432 insertions(+), 71 deletions(-) create mode 100644 crm_lead_code/i18n/bg.po create mode 100644 crm_lead_code/i18n/de.po create mode 100644 crm_lead_code/i18n/fr.po create mode 100644 crm_lead_code/i18n/hr.po create mode 100644 crm_lead_code/i18n/it.po create mode 100644 crm_lead_code/i18n/pt_BR.po create mode 100644 crm_lead_code/i18n/sk.po create mode 100644 crm_lead_code/i18n/sl.po create mode 100644 crm_lead_code/i18n/tr.po create mode 100644 crm_lead_code/i18n/zh_CN.po create mode 100644 crm_lead_code/static/description/icon.png diff --git a/crm_lead_code/README.rst b/crm_lead_code/README.rst index 74f7e4b2dd9..8cc4ef94427 100644 --- a/crm_lead_code/README.rst +++ b/crm_lead_code/README.rst @@ -1,19 +1,26 @@ .. image:: https://img.shields.io/badge/licence-AGPL--3-blue.svg - :alt: License: AGPL-3 + :target: http://www.gnu.org/licenses/agpl-3.0-standalone.html + :alt: License: AGPL-3 +========================================= Sequential code for Leads / Opportunities ========================================= * This module adds a sequential code for leads / opportunities. +.. 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 `_. +`here `_. Credits @@ -25,6 +32,7 @@ Contributors * Oihane Crucelaegui * Pedro M. Baeza * Ana Juaristi +* Nicol??s Ramos Maintainer ---------- diff --git a/crm_lead_code/__init__.py b/crm_lead_code/__init__.py index e12b746cb94..1202fba91cb 100644 --- a/crm_lead_code/__init__.py +++ b/crm_lead_code/__init__.py @@ -1,10 +1,10 @@ # -*- coding: utf-8 -*- ############################################################################## -# For copyright and license notices, see __openerp__.py file in root directory +# For copyright and license notices, see __manifest__.py file in root directory ############################################################################## from . import models -from openerp import SUPERUSER_ID +from odoo import api, SUPERUSER_ID def create_code_equal_to_id(cr): @@ -15,11 +15,12 @@ def create_code_equal_to_id(cr): def assign_old_sequences(cr, registry): - lead_obj = registry['crm.lead'] - sequence_obj = registry['ir.sequence'] - lead_ids = lead_obj.search(cr, SUPERUSER_ID, [], order="id") - for lead_id in lead_ids: + env = api.Environment(cr, SUPERUSER_ID, dict()) + lead_obj = env['crm.lead'] + sequence_obj = env['ir.sequence'] + leads = lead_obj.search([], order="id") + for lead_id in leads.ids: cr.execute('UPDATE crm_lead ' - 'SET code = \'%s\' ' - 'WHERE id = %d;' % - (sequence_obj.get(cr, SUPERUSER_ID, 'crm.lead'), lead_id)) + 'SET code = %s ' + 'WHERE id = %s;', + (sequence_obj.next_by_code('crm.lead'), lead_id, )) diff --git a/crm_lead_code/__manifest__.py b/crm_lead_code/__manifest__.py index 8f12b01c2db..bb0548dcc43 100644 --- a/crm_lead_code/__manifest__.py +++ b/crm_lead_code/__manifest__.py @@ -1,4 +1,4 @@ -# -*- encoding: utf-8 -*- +# -*- coding: utf-8 -*- ############################################################################## # # Copyright (c) @@ -22,7 +22,7 @@ { "name": "Sequential Code for Leads / Opportunities", - "version": "8.0.1.0.0", + "version": "10.0.1.0.0", "category": "Customer Relationship Management", "author": "OdooMRP team, " "AvanzOSC, " @@ -42,7 +42,7 @@ "views/crm_lead_view.xml", "data/lead_sequence.xml", ], - 'installable': False, + 'installable': True, "pre_init_hook": "create_code_equal_to_id", "post_init_hook": "assign_old_sequences", } diff --git a/crm_lead_code/data/lead_sequence.xml b/crm_lead_code/data/lead_sequence.xml index 80c359efc8c..7f54f40f92e 100644 --- a/crm_lead_code/data/lead_sequence.xml +++ b/crm_lead_code/data/lead_sequence.xml @@ -1,15 +1,9 @@ - - - - Lead code type - crm.lead - - - Lead Code - crm.lead - - LD - - - + + + Lead Code + crm.lead + + LD + + diff --git a/crm_lead_code/i18n/bg.po b/crm_lead_code/i18n/bg.po new file mode 100644 index 00000000000..980212a1209 --- /dev/null +++ b/crm_lead_code/i18n/bg.po @@ -0,0 +1,35 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * crm_lead_code +# +# Translators: +# OCA Transbot , 2017 +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 10.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2017-12-04 15:47+0000\n" +"PO-Revision-Date: 2017-12-04 15:47+0000\n" +"Last-Translator: OCA Transbot , 2017\n" +"Language-Team: Bulgarian (https://www.transifex.com/oca/teams/23907/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_lead_code +#: model:ir.model.fields,field_description:crm_lead_code.field_crm_lead_code +msgid "Lead Number" +msgstr "" + +#. module: crm_lead_code +#: model:ir.model,name:crm_lead_code.model_crm_lead +msgid "Lead/Opportunity" +msgstr "??????????/????????????????????" + +#. module: crm_lead_code +#: code:addons/crm_lead_code/models/crm_lead.py:17 sql_constraint:crm.lead:0 +#, python-format +msgid "The code must be unique!" +msgstr "" diff --git a/crm_lead_code/i18n/de.po b/crm_lead_code/i18n/de.po new file mode 100644 index 00000000000..082f0e0e743 --- /dev/null +++ b/crm_lead_code/i18n/de.po @@ -0,0 +1,35 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * crm_lead_code +# +# Translators: +# OCA Transbot , 2017 +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 10.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2017-12-04 15:47+0000\n" +"PO-Revision-Date: 2017-12-04 15:47+0000\n" +"Last-Translator: OCA Transbot , 2017\n" +"Language-Team: German (https://www.transifex.com/oca/teams/23907/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_lead_code +#: model:ir.model.fields,field_description:crm_lead_code.field_crm_lead_code +msgid "Lead Number" +msgstr "" + +#. module: crm_lead_code +#: model:ir.model,name:crm_lead_code.model_crm_lead +msgid "Lead/Opportunity" +msgstr "Lead/Chance" + +#. module: crm_lead_code +#: code:addons/crm_lead_code/models/crm_lead.py:17 sql_constraint:crm.lead:0 +#, python-format +msgid "The code must be unique!" +msgstr "" diff --git a/crm_lead_code/i18n/es.po b/crm_lead_code/i18n/es.po index aa11728ead6..f9326123d2a 100644 --- a/crm_lead_code/i18n/es.po +++ b/crm_lead_code/i18n/es.po @@ -1,24 +1,27 @@ # Translation of Odoo Server. # This file contains the translation of the following modules: -# * crm_lead_code -# +# * crm_lead_code +# +# Translators: +# OCA Transbot , 2017 msgid "" msgstr "" -"Project-Id-Version: Odoo Server 8.0\n" +"Project-Id-Version: Odoo Server 10.0\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2015-07-27 15:47+0000\n" -"PO-Revision-Date: 2015-07-27 15:47+0000\n" -"Last-Translator: <>\n" -"Language-Team: \n" +"POT-Creation-Date: 2017-12-04 15:47+0000\n" +"PO-Revision-Date: 2017-12-04 15:47+0000\n" +"Last-Translator: OCA Transbot , 2017\n" +"Language-Team: Spanish (https://www.transifex.com/oca/teams/23907/es/)\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: \n" -"Plural-Forms: \n" +"Language: es\n" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" #. module: crm_lead_code -#: field:crm.lead,code:0 +#: model:ir.model.fields,field_description:crm_lead_code.field_crm_lead_code msgid "Lead Number" -msgstr "N??mero de Iniciativa" +msgstr "" #. module: crm_lead_code #: model:ir.model,name:crm_lead_code.model_crm_lead @@ -26,7 +29,7 @@ msgid "Lead/Opportunity" msgstr "Iniciativa/Oportunidad" #. module: crm_lead_code -#: sql_constraint:crm.lead:0 +#: code:addons/crm_lead_code/models/crm_lead.py:17 sql_constraint:crm.lead:0 +#, python-format msgid "The code must be unique!" -msgstr "??El n??mero debe de ser ??nico!" - +msgstr "" diff --git a/crm_lead_code/i18n/fr.po b/crm_lead_code/i18n/fr.po new file mode 100644 index 00000000000..448daecc7aa --- /dev/null +++ b/crm_lead_code/i18n/fr.po @@ -0,0 +1,35 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * crm_lead_code +# +# Translators: +# OCA Transbot , 2017 +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 10.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2017-12-04 15:47+0000\n" +"PO-Revision-Date: 2017-12-04 15:47+0000\n" +"Last-Translator: OCA Transbot , 2017\n" +"Language-Team: French (https://www.transifex.com/oca/teams/23907/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_lead_code +#: model:ir.model.fields,field_description:crm_lead_code.field_crm_lead_code +msgid "Lead Number" +msgstr "" + +#. module: crm_lead_code +#: model:ir.model,name:crm_lead_code.model_crm_lead +msgid "Lead/Opportunity" +msgstr "Piste/Opportunit??" + +#. module: crm_lead_code +#: code:addons/crm_lead_code/models/crm_lead.py:17 sql_constraint:crm.lead:0 +#, python-format +msgid "The code must be unique!" +msgstr "" diff --git a/crm_lead_code/i18n/hr.po b/crm_lead_code/i18n/hr.po new file mode 100644 index 00000000000..b262d0d8d2f --- /dev/null +++ b/crm_lead_code/i18n/hr.po @@ -0,0 +1,35 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * crm_lead_code +# +# Translators: +# OCA Transbot , 2017 +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 10.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2017-12-04 15:47+0000\n" +"PO-Revision-Date: 2017-12-04 15:47+0000\n" +"Last-Translator: OCA Transbot , 2017\n" +"Language-Team: Croatian (https://www.transifex.com/oca/teams/23907/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_lead_code +#: model:ir.model.fields,field_description:crm_lead_code.field_crm_lead_code +msgid "Lead Number" +msgstr "" + +#. module: crm_lead_code +#: model:ir.model,name:crm_lead_code.model_crm_lead +msgid "Lead/Opportunity" +msgstr "Potencijalni klijent" + +#. module: crm_lead_code +#: code:addons/crm_lead_code/models/crm_lead.py:17 sql_constraint:crm.lead:0 +#, python-format +msgid "The code must be unique!" +msgstr "" diff --git a/crm_lead_code/i18n/it.po b/crm_lead_code/i18n/it.po new file mode 100644 index 00000000000..ec03901e909 --- /dev/null +++ b/crm_lead_code/i18n/it.po @@ -0,0 +1,35 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * crm_lead_code +# +# Translators: +# OCA Transbot , 2017 +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 10.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2017-12-04 15:47+0000\n" +"PO-Revision-Date: 2017-12-04 15:47+0000\n" +"Last-Translator: OCA Transbot , 2017\n" +"Language-Team: Italian (https://www.transifex.com/oca/teams/23907/it/)\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Language: it\n" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" + +#. module: crm_lead_code +#: model:ir.model.fields,field_description:crm_lead_code.field_crm_lead_code +msgid "Lead Number" +msgstr "" + +#. module: crm_lead_code +#: model:ir.model,name:crm_lead_code.model_crm_lead +msgid "Lead/Opportunity" +msgstr "Lead/Opportunit??" + +#. module: crm_lead_code +#: code:addons/crm_lead_code/models/crm_lead.py:17 sql_constraint:crm.lead:0 +#, python-format +msgid "The code must be unique!" +msgstr "" diff --git a/crm_lead_code/i18n/pt_BR.po b/crm_lead_code/i18n/pt_BR.po new file mode 100644 index 00000000000..79ff2978eb8 --- /dev/null +++ b/crm_lead_code/i18n/pt_BR.po @@ -0,0 +1,35 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * crm_lead_code +# +# Translators: +# OCA Transbot , 2017 +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 10.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2017-12-04 15:47+0000\n" +"PO-Revision-Date: 2017-12-04 15:47+0000\n" +"Last-Translator: OCA Transbot , 2017\n" +"Language-Team: Portuguese (Brazil) (https://www.transifex.com/oca/teams/23907/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_lead_code +#: model:ir.model.fields,field_description:crm_lead_code.field_crm_lead_code +msgid "Lead Number" +msgstr "" + +#. module: crm_lead_code +#: model:ir.model,name:crm_lead_code.model_crm_lead +msgid "Lead/Opportunity" +msgstr "Prospector/Oportunidade" + +#. module: crm_lead_code +#: code:addons/crm_lead_code/models/crm_lead.py:17 sql_constraint:crm.lead:0 +#, python-format +msgid "The code must be unique!" +msgstr "" diff --git a/crm_lead_code/i18n/sk.po b/crm_lead_code/i18n/sk.po new file mode 100644 index 00000000000..669540d8365 --- /dev/null +++ b/crm_lead_code/i18n/sk.po @@ -0,0 +1,35 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * crm_lead_code +# +# Translators: +# OCA Transbot , 2017 +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 10.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2017-12-04 15:47+0000\n" +"PO-Revision-Date: 2017-12-04 15:47+0000\n" +"Last-Translator: OCA Transbot , 2017\n" +"Language-Team: Slovak (https://www.transifex.com/oca/teams/23907/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_lead_code +#: model:ir.model.fields,field_description:crm_lead_code.field_crm_lead_code +msgid "Lead Number" +msgstr "" + +#. module: crm_lead_code +#: model:ir.model,name:crm_lead_code.model_crm_lead +msgid "Lead/Opportunity" +msgstr "Iniciat??va/Pr??le??itos??" + +#. module: crm_lead_code +#: code:addons/crm_lead_code/models/crm_lead.py:17 sql_constraint:crm.lead:0 +#, python-format +msgid "The code must be unique!" +msgstr "" diff --git a/crm_lead_code/i18n/sl.po b/crm_lead_code/i18n/sl.po new file mode 100644 index 00000000000..aaf346f4c4b --- /dev/null +++ b/crm_lead_code/i18n/sl.po @@ -0,0 +1,35 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * crm_lead_code +# +# Translators: +# OCA Transbot , 2017 +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 10.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2017-12-04 15:47+0000\n" +"PO-Revision-Date: 2017-12-04 15:47+0000\n" +"Last-Translator: OCA Transbot , 2017\n" +"Language-Team: Slovenian (https://www.transifex.com/oca/teams/23907/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_lead_code +#: model:ir.model.fields,field_description:crm_lead_code.field_crm_lead_code +msgid "Lead Number" +msgstr "" + +#. module: crm_lead_code +#: model:ir.model,name:crm_lead_code.model_crm_lead +msgid "Lead/Opportunity" +msgstr "Indic/prilo??nost" + +#. module: crm_lead_code +#: code:addons/crm_lead_code/models/crm_lead.py:17 sql_constraint:crm.lead:0 +#, python-format +msgid "The code must be unique!" +msgstr "" diff --git a/crm_lead_code/i18n/tr.po b/crm_lead_code/i18n/tr.po new file mode 100644 index 00000000000..7f9c494e67d --- /dev/null +++ b/crm_lead_code/i18n/tr.po @@ -0,0 +1,35 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * crm_lead_code +# +# Translators: +# Ediz Duman , 2017 +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 10.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2017-12-04 15:47+0000\n" +"PO-Revision-Date: 2017-12-04 15:47+0000\n" +"Last-Translator: Ediz Duman , 2017\n" +"Language-Team: Turkish (https://www.transifex.com/oca/teams/23907/tr/)\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Language: tr\n" +"Plural-Forms: nplurals=2; plural=(n > 1);\n" + +#. module: crm_lead_code +#: model:ir.model.fields,field_description:crm_lead_code.field_crm_lead_code +msgid "Lead Number" +msgstr "" + +#. module: crm_lead_code +#: model:ir.model,name:crm_lead_code.model_crm_lead +msgid "Lead/Opportunity" +msgstr "Aday/F??rsat" + +#. module: crm_lead_code +#: code:addons/crm_lead_code/models/crm_lead.py:17 sql_constraint:crm.lead:0 +#, python-format +msgid "The code must be unique!" +msgstr "" diff --git a/crm_lead_code/i18n/zh_CN.po b/crm_lead_code/i18n/zh_CN.po new file mode 100644 index 00000000000..6461677b282 --- /dev/null +++ b/crm_lead_code/i18n/zh_CN.po @@ -0,0 +1,35 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * crm_lead_code +# +# Translators: +# OCA Transbot , 2017 +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 10.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2017-12-04 15:47+0000\n" +"PO-Revision-Date: 2017-12-04 15:47+0000\n" +"Last-Translator: OCA Transbot , 2017\n" +"Language-Team: Chinese (China) (https://www.transifex.com/oca/teams/23907/zh_CN/)\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Language: zh_CN\n" +"Plural-Forms: nplurals=1; plural=0;\n" + +#. module: crm_lead_code +#: model:ir.model.fields,field_description:crm_lead_code.field_crm_lead_code +msgid "Lead Number" +msgstr "" + +#. module: crm_lead_code +#: model:ir.model,name:crm_lead_code.model_crm_lead +msgid "Lead/Opportunity" +msgstr "??????/??????" + +#. module: crm_lead_code +#: code:addons/crm_lead_code/models/crm_lead.py:17 sql_constraint:crm.lead:0 +#, python-format +msgid "The code must be unique!" +msgstr "" diff --git a/crm_lead_code/models/__init__.py b/crm_lead_code/models/__init__.py index 9e86cd957c9..3c2b59c8609 100644 --- a/crm_lead_code/models/__init__.py +++ b/crm_lead_code/models/__init__.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- ############################################################################## -# For copyright and license notices, see __openerp__.py file in root directory +# For copyright and license notices, see __manifest__.py file in root directory ############################################################################## from . import crm_lead diff --git a/crm_lead_code/models/crm_lead.py b/crm_lead_code/models/crm_lead.py index 4669aaf758b..28101e426b7 100644 --- a/crm_lead_code/models/crm_lead.py +++ b/crm_lead_code/models/crm_lead.py @@ -1,9 +1,9 @@ # -*- coding: utf-8 -*- ############################################################################## -# For copyright and license notices, see __openerp__.py file in root directory +# For copyright and license notices, see __manifest__.py file in root directory ############################################################################## -from openerp import api, fields, models +from odoo import api, fields, models, _ class CrmLead(models.Model): @@ -14,18 +14,18 @@ class CrmLead(models.Model): _sql_constraints = [ ('crm_lead_unique_code', 'UNIQUE (code)', - 'The code must be unique!'), + _('The code must be unique!')), ] @api.model def create(self, vals): if vals.get('code', '/') == '/': - vals['code'] = self.env['ir.sequence'].get('crm.lead') + vals['code'] = self.env['ir.sequence'].next_by_code('crm.lead') return super(CrmLead, self).create(vals) - @api.one + @api.multi def copy(self, default=None): if default is None: default = {} - default['code'] = self.env['ir.sequence'].get('crm.lead') + default['code'] = self.env['ir.sequence'].next_by_code('crm.lead') return super(CrmLead, self).copy(default) diff --git a/crm_lead_code/static/description/icon.png b/crm_lead_code/static/description/icon.png new file mode 100644 index 0000000000000000000000000000000000000000..3a0328b516c4980e8e44cdb63fd945757ddd132d GIT binary patch literal 9455 zcmW++2RxMjAAjx~&dlBk9S+%}OXg)AGE&Cb*&}d0jUxM@u(PQx^-s)697TX`ehR4?GS^qbkof1cslKgkU)h65qZ9Oc=ml_0temigYLJfnz{IDzUf>bGs4N!v3=Z3jMq&A#7%rM5eQ#dc?k~! zVpnB`o+K7|Al`Q_U;eD$B zfJtP*jH`siUq~{KE)`jP2|#TUEFGRryE2`i0**z#*^6~AI|YzIWy$Cu#CSLW3q=GA z6`?GZymC;dCPk~rBS%eCb`5OLr;RUZ;D`}um=H)BfVIq%7VhiMr)_#G0N#zrNH|__ zc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|dOB*Q^S|xqTV*vIg?@fVFSmMpaw0qtTRbx} z({Pg?#{2`sc9)M5N$*N|4;^t$+QP?#mov zGVC@I*lBVrOU-%2y!7%)fAKjpEFsgQc4{amtiHb95KQEwvf<(3T<9-Zm$xIew#P22 zc2Ix|App^>v6(3L_MCU0d3W##AB0M~3D00EWoKZqsJYT(#@w$Y_H7G22M~ApVFTRHMI_3be)Lkn#0F*V8Pq zc}`Cjy$bE;FJ6H7p=0y#R>`}-m4(0F>%@P|?7fx{=R^uFdISRnZ2W_xQhD{YuR3t< z{6yxu=4~JkeA;|(J6_nv#>Nvs&FuLA&PW^he@t(UwFFE8)|a!R{`E`K`i^ZnyE4$k z;(749Ix|oi$c3QbEJ3b~D_kQsPz~fIUKym($a_7dJ?o+40*OLl^{=&oq$<#Q(yyrp z{J-FAniyAw9tPbe&IhQ|a`DqFTVQGQ&Gq3!C2==4x{6EJwiPZ8zub-iXoUtkJiG{} zPaR&}_fn8_z~(=;5lD-aPWD3z8PZS@AaUiomF!G8I}Mf>e~0g#BelA-5#`cj;O5>N Xviia!U7SGha1wx#SCgwmn*{w2TRX*I literal 0 HcmV?d00001 diff --git a/crm_lead_code/tests/__init__.py b/crm_lead_code/tests/__init__.py index 2269c75f6d4..7ba686aed97 100644 --- a/crm_lead_code/tests/__init__.py +++ b/crm_lead_code/tests/__init__.py @@ -1,6 +1,6 @@ -# -*- encoding: utf-8 -*- +# -*- coding: utf-8 -*- ############################################################################## -# For copyright and license notices, see __openerp__.py file in root directory +# For copyright and license notices, see __manifest__.py file in root directory ############################################################################## from . import test_crm_lead_code diff --git a/crm_lead_code/tests/test_crm_lead_code.py b/crm_lead_code/tests/test_crm_lead_code.py index bbc44cfe949..44f56694845 100644 --- a/crm_lead_code/tests/test_crm_lead_code.py +++ b/crm_lead_code/tests/test_crm_lead_code.py @@ -1,12 +1,12 @@ -# -*- encoding: utf-8 -*- +# -*- coding: utf-8 -*- ############################################################################## -# For copyright and license notices, see __openerp__.py file in root directory +# For copyright and license notices, see __manifest__.py file in root directory ############################################################################## -import openerp.tests.common as common +from odoo.tests.common import TransactionCase -class TestCrmLeadCode(common.TransactionCase): +class TestCrmLeadCode(TransactionCase): def setUp(self): super(TestCrmLeadCode, self).setUp() @@ -35,11 +35,6 @@ def test_copy_lead_code_assign(self): self.assertEqual(crm_lead_copy.code, code) def _get_next_code(self): - d = self.ir_sequence_model._interpolation_dict() - prefix = self.ir_sequence_model._interpolate( - self.crm_sequence.prefix, d) - suffix = self.ir_sequence_model._interpolate( - self.crm_sequence.suffix, d) - code = (prefix + ('%%0%sd' % self.crm_sequence.padding % - self.crm_sequence.number_next_actual) + suffix) - return code + return self.crm_sequence.get_next_char( + self.crm_sequence.number_next_actual + ) diff --git a/crm_lead_code/views/crm_lead_view.xml b/crm_lead_code/views/crm_lead_view.xml index 6339b1ccd2d..09d7969b990 100644 --- a/crm_lead_code/views/crm_lead_view.xml +++ b/crm_lead_code/views/crm_lead_view.xml @@ -1,13 +1,13 @@ - - - + + crm.lead.code.form crm.lead - + + @@ -33,14 +33,15 @@ - + crm.lead.oppor.code.form crm.lead - + + @@ -56,6 +57,17 @@ + + crm.lead.code.kanban + crm.lead + + + + + + + + crm.lead.oppor.code.search crm.lead @@ -66,6 +78,4 @@ - - - + From 795ee455af16432e3b59472050daa5a19230e817 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phane=20Bidoul=20=28ACSONE=29?= Date: Fri, 15 Jun 2018 23:11:36 +0200 Subject: [PATCH 06/31] remove obsolete .pot files [ci skip] --- crm_lead_code/i18n/bg.po | 4 ++-- crm_lead_code/i18n/crm_lead_code.pot | 8 ++++---- crm_lead_code/i18n/de.po | 4 ++-- crm_lead_code/i18n/es.po | 4 ++-- crm_lead_code/i18n/fr.po | 4 ++-- crm_lead_code/i18n/hr.po | 7 ++++--- crm_lead_code/i18n/it.po | 4 ++-- crm_lead_code/i18n/pt_BR.po | 7 ++++--- crm_lead_code/i18n/sk.po | 4 ++-- crm_lead_code/i18n/sl.po | 7 ++++--- crm_lead_code/i18n/tr.po | 4 ++-- crm_lead_code/i18n/zh_CN.po | 7 ++++--- 12 files changed, 34 insertions(+), 30 deletions(-) diff --git a/crm_lead_code/i18n/bg.po b/crm_lead_code/i18n/bg.po index 980212a1209..cba413ecc97 100644 --- a/crm_lead_code/i18n/bg.po +++ b/crm_lead_code/i18n/bg.po @@ -1,7 +1,7 @@ # Translation of Odoo Server. # This file contains the translation of the following modules: # * crm_lead_code -# +# # Translators: # OCA Transbot , 2017 msgid "" @@ -12,10 +12,10 @@ msgstr "" "PO-Revision-Date: 2017-12-04 15:47+0000\n" "Last-Translator: OCA Transbot , 2017\n" "Language-Team: Bulgarian (https://www.transifex.com/oca/teams/23907/bg/)\n" +"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_lead_code diff --git a/crm_lead_code/i18n/crm_lead_code.pot b/crm_lead_code/i18n/crm_lead_code.pot index a7036fe50cf..60a60ff883c 100644 --- a/crm_lead_code/i18n/crm_lead_code.pot +++ b/crm_lead_code/i18n/crm_lead_code.pot @@ -4,10 +4,8 @@ # msgid "" msgstr "" -"Project-Id-Version: Odoo Server 8.0\n" +"Project-Id-Version: Odoo Server 10.0\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2015-07-27 15:46+0000\n" -"PO-Revision-Date: 2015-07-27 15:46+0000\n" "Last-Translator: <>\n" "Language-Team: \n" "MIME-Version: 1.0\n" @@ -16,7 +14,7 @@ msgstr "" "Plural-Forms: \n" #. module: crm_lead_code -#: field:crm.lead,code:0 +#: model:ir.model.fields,field_description:crm_lead_code.field_crm_lead_code msgid "Lead Number" msgstr "" @@ -26,7 +24,9 @@ msgid "Lead/Opportunity" msgstr "" #. module: crm_lead_code +#: code:addons/crm_lead_code/models/crm_lead.py:17 #: sql_constraint:crm.lead:0 +#, python-format msgid "The code must be unique!" msgstr "" diff --git a/crm_lead_code/i18n/de.po b/crm_lead_code/i18n/de.po index 082f0e0e743..e690ba58f11 100644 --- a/crm_lead_code/i18n/de.po +++ b/crm_lead_code/i18n/de.po @@ -1,7 +1,7 @@ # Translation of Odoo Server. # This file contains the translation of the following modules: # * crm_lead_code -# +# # Translators: # OCA Transbot , 2017 msgid "" @@ -12,10 +12,10 @@ msgstr "" "PO-Revision-Date: 2017-12-04 15:47+0000\n" "Last-Translator: OCA Transbot , 2017\n" "Language-Team: German (https://www.transifex.com/oca/teams/23907/de/)\n" +"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_lead_code diff --git a/crm_lead_code/i18n/es.po b/crm_lead_code/i18n/es.po index f9326123d2a..8ceef9a92b5 100644 --- a/crm_lead_code/i18n/es.po +++ b/crm_lead_code/i18n/es.po @@ -1,7 +1,7 @@ # Translation of Odoo Server. # This file contains the translation of the following modules: # * crm_lead_code -# +# # Translators: # OCA Transbot , 2017 msgid "" @@ -12,10 +12,10 @@ msgstr "" "PO-Revision-Date: 2017-12-04 15:47+0000\n" "Last-Translator: OCA Transbot , 2017\n" "Language-Team: Spanish (https://www.transifex.com/oca/teams/23907/es/)\n" +"Language: es\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" #. module: crm_lead_code diff --git a/crm_lead_code/i18n/fr.po b/crm_lead_code/i18n/fr.po index 448daecc7aa..4175aabd8c8 100644 --- a/crm_lead_code/i18n/fr.po +++ b/crm_lead_code/i18n/fr.po @@ -1,7 +1,7 @@ # Translation of Odoo Server. # This file contains the translation of the following modules: # * crm_lead_code -# +# # Translators: # OCA Transbot , 2017 msgid "" @@ -12,10 +12,10 @@ msgstr "" "PO-Revision-Date: 2017-12-04 15:47+0000\n" "Last-Translator: OCA Transbot , 2017\n" "Language-Team: French (https://www.transifex.com/oca/teams/23907/fr/)\n" +"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_lead_code diff --git a/crm_lead_code/i18n/hr.po b/crm_lead_code/i18n/hr.po index b262d0d8d2f..2cbf406ebc6 100644 --- a/crm_lead_code/i18n/hr.po +++ b/crm_lead_code/i18n/hr.po @@ -1,7 +1,7 @@ # Translation of Odoo Server. # This file contains the translation of the following modules: # * crm_lead_code -# +# # Translators: # OCA Transbot , 2017 msgid "" @@ -12,11 +12,12 @@ msgstr "" "PO-Revision-Date: 2017-12-04 15:47+0000\n" "Last-Translator: OCA Transbot , 2017\n" "Language-Team: Croatian (https://www.transifex.com/oca/teams/23907/hr/)\n" +"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" +"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_lead_code #: model:ir.model.fields,field_description:crm_lead_code.field_crm_lead_code diff --git a/crm_lead_code/i18n/it.po b/crm_lead_code/i18n/it.po index ec03901e909..63a3f5bde8b 100644 --- a/crm_lead_code/i18n/it.po +++ b/crm_lead_code/i18n/it.po @@ -1,7 +1,7 @@ # Translation of Odoo Server. # This file contains the translation of the following modules: # * crm_lead_code -# +# # Translators: # OCA Transbot , 2017 msgid "" @@ -12,10 +12,10 @@ msgstr "" "PO-Revision-Date: 2017-12-04 15:47+0000\n" "Last-Translator: OCA Transbot , 2017\n" "Language-Team: Italian (https://www.transifex.com/oca/teams/23907/it/)\n" +"Language: it\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: \n" -"Language: it\n" "Plural-Forms: nplurals=2; plural=(n != 1);\n" #. module: crm_lead_code diff --git a/crm_lead_code/i18n/pt_BR.po b/crm_lead_code/i18n/pt_BR.po index 79ff2978eb8..12710e89991 100644 --- a/crm_lead_code/i18n/pt_BR.po +++ b/crm_lead_code/i18n/pt_BR.po @@ -1,7 +1,7 @@ # Translation of Odoo Server. # This file contains the translation of the following modules: # * crm_lead_code -# +# # Translators: # OCA Transbot , 2017 msgid "" @@ -11,11 +11,12 @@ msgstr "" "POT-Creation-Date: 2017-12-04 15:47+0000\n" "PO-Revision-Date: 2017-12-04 15:47+0000\n" "Last-Translator: OCA Transbot , 2017\n" -"Language-Team: Portuguese (Brazil) (https://www.transifex.com/oca/teams/23907/pt_BR/)\n" +"Language-Team: Portuguese (Brazil) (https://www.transifex.com/oca/" +"teams/23907/pt_BR/)\n" +"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_lead_code diff --git a/crm_lead_code/i18n/sk.po b/crm_lead_code/i18n/sk.po index 669540d8365..021c21b082d 100644 --- a/crm_lead_code/i18n/sk.po +++ b/crm_lead_code/i18n/sk.po @@ -1,7 +1,7 @@ # Translation of Odoo Server. # This file contains the translation of the following modules: # * crm_lead_code -# +# # Translators: # OCA Transbot , 2017 msgid "" @@ -12,10 +12,10 @@ msgstr "" "PO-Revision-Date: 2017-12-04 15:47+0000\n" "Last-Translator: OCA Transbot , 2017\n" "Language-Team: Slovak (https://www.transifex.com/oca/teams/23907/sk/)\n" +"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_lead_code diff --git a/crm_lead_code/i18n/sl.po b/crm_lead_code/i18n/sl.po index aaf346f4c4b..e8d917a77dc 100644 --- a/crm_lead_code/i18n/sl.po +++ b/crm_lead_code/i18n/sl.po @@ -1,7 +1,7 @@ # Translation of Odoo Server. # This file contains the translation of the following modules: # * crm_lead_code -# +# # Translators: # OCA Transbot , 2017 msgid "" @@ -12,11 +12,12 @@ msgstr "" "PO-Revision-Date: 2017-12-04 15:47+0000\n" "Last-Translator: OCA Transbot , 2017\n" "Language-Team: Slovenian (https://www.transifex.com/oca/teams/23907/sl/)\n" +"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" +"Plural-Forms: nplurals=4; plural=(n%100==1 ? 0 : n%100==2 ? 1 : n%100==3 || n" +"%100==4 ? 2 : 3);\n" #. module: crm_lead_code #: model:ir.model.fields,field_description:crm_lead_code.field_crm_lead_code diff --git a/crm_lead_code/i18n/tr.po b/crm_lead_code/i18n/tr.po index 7f9c494e67d..776236576e9 100644 --- a/crm_lead_code/i18n/tr.po +++ b/crm_lead_code/i18n/tr.po @@ -1,7 +1,7 @@ # Translation of Odoo Server. # This file contains the translation of the following modules: # * crm_lead_code -# +# # Translators: # Ediz Duman , 2017 msgid "" @@ -12,10 +12,10 @@ msgstr "" "PO-Revision-Date: 2017-12-04 15:47+0000\n" "Last-Translator: Ediz Duman , 2017\n" "Language-Team: Turkish (https://www.transifex.com/oca/teams/23907/tr/)\n" +"Language: tr\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: \n" -"Language: tr\n" "Plural-Forms: nplurals=2; plural=(n > 1);\n" #. module: crm_lead_code diff --git a/crm_lead_code/i18n/zh_CN.po b/crm_lead_code/i18n/zh_CN.po index 6461677b282..e33b6a244e6 100644 --- a/crm_lead_code/i18n/zh_CN.po +++ b/crm_lead_code/i18n/zh_CN.po @@ -1,7 +1,7 @@ # Translation of Odoo Server. # This file contains the translation of the following modules: # * crm_lead_code -# +# # Translators: # OCA Transbot , 2017 msgid "" @@ -11,11 +11,12 @@ msgstr "" "POT-Creation-Date: 2017-12-04 15:47+0000\n" "PO-Revision-Date: 2017-12-04 15:47+0000\n" "Last-Translator: OCA Transbot , 2017\n" -"Language-Team: Chinese (China) (https://www.transifex.com/oca/teams/23907/zh_CN/)\n" +"Language-Team: Chinese (China) (https://www.transifex.com/oca/teams/23907/" +"zh_CN/)\n" +"Language: zh_CN\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: \n" -"Language: zh_CN\n" "Plural-Forms: nplurals=1; plural=0;\n" #. module: crm_lead_code From b57c1dad80a67edc2e45ffd52ce17898d0b16032 Mon Sep 17 00:00:00 2001 From: Maria Sparenberg Date: Wed, 12 Dec 2018 13:27:41 +0000 Subject: [PATCH 07/31] Translated using Weblate (German) Currently translated at 100.0% (3 of 3 strings) Translation: crm-10.0/crm-10.0-crm_lead_code Translate-URL: https://translation.odoo-community.org/projects/crm-10-0/crm-10-0-crm_lead_code/de/ --- crm_lead_code/i18n/de.po | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/crm_lead_code/i18n/de.po b/crm_lead_code/i18n/de.po index e690ba58f11..18dfbb1eab1 100644 --- a/crm_lead_code/i18n/de.po +++ b/crm_lead_code/i18n/de.po @@ -9,19 +9,20 @@ msgstr "" "Project-Id-Version: Odoo Server 10.0\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2017-12-04 15:47+0000\n" -"PO-Revision-Date: 2017-12-04 15:47+0000\n" -"Last-Translator: OCA Transbot , 2017\n" +"PO-Revision-Date: 2018-12-13 12:58+0000\n" +"Last-Translator: Maria Sparenberg \n" "Language-Team: German (https://www.transifex.com/oca/teams/23907/de/)\n" "Language: de\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: \n" -"Plural-Forms: nplurals=2; plural=(n != 1);\n" +"Plural-Forms: nplurals=2; plural=n != 1;\n" +"X-Generator: Weblate 3.3\n" #. module: crm_lead_code #: model:ir.model.fields,field_description:crm_lead_code.field_crm_lead_code msgid "Lead Number" -msgstr "" +msgstr "Lead-Nummer" #. module: crm_lead_code #: model:ir.model,name:crm_lead_code.model_crm_lead @@ -32,4 +33,4 @@ msgstr "Lead/Chance" #: code:addons/crm_lead_code/models/crm_lead.py:17 sql_constraint:crm.lead:0 #, python-format msgid "The code must be unique!" -msgstr "" +msgstr "Der Schl??ssel muss eindeutig sein!" From 97ead0ee54dd966d05d888f1bcd6f71b72563de3 Mon Sep 17 00:00:00 2001 From: Mathias Markl Date: Mon, 14 Jan 2019 21:53:50 +0100 Subject: [PATCH 08/31] [MIG] crm_lead_code: Migration to 12.0 [UPD] Update crm_lead_code.pot --- crm_lead_code/README.rst | 1 + crm_lead_code/__init__.py | 1 - crm_lead_code/__manifest__.py | 7 +++---- crm_lead_code/i18n/bg.po | 4 ++-- crm_lead_code/i18n/crm_lead_code.pot | 6 +++--- crm_lead_code/i18n/de.po | 4 ++-- crm_lead_code/i18n/es.po | 4 ++-- crm_lead_code/i18n/fr.po | 4 ++-- crm_lead_code/i18n/hr.po | 4 ++-- crm_lead_code/i18n/it.po | 4 ++-- crm_lead_code/i18n/pt_BR.po | 4 ++-- crm_lead_code/i18n/sk.po | 4 ++-- crm_lead_code/i18n/sl.po | 4 ++-- crm_lead_code/i18n/tr.po | 4 ++-- crm_lead_code/i18n/zh_CN.po | 4 ++-- crm_lead_code/models/__init__.py | 3 +-- crm_lead_code/models/crm_lead.py | 12 ++++++------ crm_lead_code/tests/__init__.py | 1 - crm_lead_code/tests/test_crm_lead_code.py | 1 - crm_lead_code/views/crm_lead_view.xml | 4 ++-- 20 files changed, 38 insertions(+), 42 deletions(-) diff --git a/crm_lead_code/README.rst b/crm_lead_code/README.rst index 8cc4ef94427..8f6dbe16a7d 100644 --- a/crm_lead_code/README.rst +++ b/crm_lead_code/README.rst @@ -33,6 +33,7 @@ Contributors * Pedro M. Baeza * Ana Juaristi * Nicol??s Ramos +* Mathias Markl Maintainer ---------- diff --git a/crm_lead_code/__init__.py b/crm_lead_code/__init__.py index 1202fba91cb..38c315a0f64 100644 --- a/crm_lead_code/__init__.py +++ b/crm_lead_code/__init__.py @@ -1,4 +1,3 @@ -# -*- coding: utf-8 -*- ############################################################################## # For copyright and license notices, see __manifest__.py file in root directory ############################################################################## diff --git a/crm_lead_code/__manifest__.py b/crm_lead_code/__manifest__.py index bb0548dcc43..1d90665185d 100644 --- a/crm_lead_code/__manifest__.py +++ b/crm_lead_code/__manifest__.py @@ -1,4 +1,3 @@ -# -*- coding: utf-8 -*- ############################################################################## # # Copyright (c) @@ -22,11 +21,10 @@ { "name": "Sequential Code for Leads / Opportunities", - "version": "10.0.1.0.0", + "version": "12.0.1.0.0", "category": "Customer Relationship Management", - "author": "OdooMRP team, " + "author": "Tecnativa, " "AvanzOSC, " - "Serv. Tecnol. Avanzados - Pedro M. Baeza, " "Odoo Community Association (OCA)", "website": "http://www.odoomrp.com", "license": "AGPL-3", @@ -34,6 +32,7 @@ "Oihane Crucelaegui ", "Pedro M. Baeza ", "Ana Juaristi ", + "Mathias Markl ", ], "depends": [ "crm", diff --git a/crm_lead_code/i18n/bg.po b/crm_lead_code/i18n/bg.po index cba413ecc97..560eacc1701 100644 --- a/crm_lead_code/i18n/bg.po +++ b/crm_lead_code/i18n/bg.po @@ -19,7 +19,7 @@ msgstr "" "Plural-Forms: nplurals=2; plural=(n != 1);\n" #. module: crm_lead_code -#: model:ir.model.fields,field_description:crm_lead_code.field_crm_lead_code +#: model:ir.model.fields,field_description:crm_lead_code.field_crm_lead__code msgid "Lead Number" msgstr "" @@ -29,7 +29,7 @@ msgid "Lead/Opportunity" msgstr "??????????/????????????????????" #. module: crm_lead_code -#: code:addons/crm_lead_code/models/crm_lead.py:17 sql_constraint:crm.lead:0 +#: code:addons/crm_lead_code/models/crm_lead.py:16 sql_constraint:crm.lead:0 #, python-format msgid "The code must be unique!" msgstr "" diff --git a/crm_lead_code/i18n/crm_lead_code.pot b/crm_lead_code/i18n/crm_lead_code.pot index 60a60ff883c..462f8a5bab7 100644 --- a/crm_lead_code/i18n/crm_lead_code.pot +++ b/crm_lead_code/i18n/crm_lead_code.pot @@ -4,7 +4,7 @@ # msgid "" msgstr "" -"Project-Id-Version: Odoo Server 10.0\n" +"Project-Id-Version: Odoo Server 12.0\n" "Report-Msgid-Bugs-To: \n" "Last-Translator: <>\n" "Language-Team: \n" @@ -14,7 +14,7 @@ msgstr "" "Plural-Forms: \n" #. module: crm_lead_code -#: model:ir.model.fields,field_description:crm_lead_code.field_crm_lead_code +#: model:ir.model.fields,field_description:crm_lead_code.field_crm_lead__code msgid "Lead Number" msgstr "" @@ -24,7 +24,7 @@ msgid "Lead/Opportunity" msgstr "" #. module: crm_lead_code -#: code:addons/crm_lead_code/models/crm_lead.py:17 +#: code:addons/crm_lead_code/models/crm_lead.py:16 #: sql_constraint:crm.lead:0 #, python-format msgid "The code must be unique!" diff --git a/crm_lead_code/i18n/de.po b/crm_lead_code/i18n/de.po index 18dfbb1eab1..085e3fcece7 100644 --- a/crm_lead_code/i18n/de.po +++ b/crm_lead_code/i18n/de.po @@ -20,7 +20,7 @@ msgstr "" "X-Generator: Weblate 3.3\n" #. module: crm_lead_code -#: model:ir.model.fields,field_description:crm_lead_code.field_crm_lead_code +#: model:ir.model.fields,field_description:crm_lead_code.field_crm_lead__code msgid "Lead Number" msgstr "Lead-Nummer" @@ -30,7 +30,7 @@ msgid "Lead/Opportunity" msgstr "Lead/Chance" #. module: crm_lead_code -#: code:addons/crm_lead_code/models/crm_lead.py:17 sql_constraint:crm.lead:0 +#: code:addons/crm_lead_code/models/crm_lead.py:16 sql_constraint:crm.lead:0 #, python-format msgid "The code must be unique!" msgstr "Der Schl??ssel muss eindeutig sein!" diff --git a/crm_lead_code/i18n/es.po b/crm_lead_code/i18n/es.po index 8ceef9a92b5..ea95c5ad1f4 100644 --- a/crm_lead_code/i18n/es.po +++ b/crm_lead_code/i18n/es.po @@ -19,7 +19,7 @@ msgstr "" "Plural-Forms: nplurals=2; plural=(n != 1);\n" #. module: crm_lead_code -#: model:ir.model.fields,field_description:crm_lead_code.field_crm_lead_code +#: model:ir.model.fields,field_description:crm_lead_code.field_crm_lead__code msgid "Lead Number" msgstr "" @@ -29,7 +29,7 @@ msgid "Lead/Opportunity" msgstr "Iniciativa/Oportunidad" #. module: crm_lead_code -#: code:addons/crm_lead_code/models/crm_lead.py:17 sql_constraint:crm.lead:0 +#: code:addons/crm_lead_code/models/crm_lead.py:16 sql_constraint:crm.lead:0 #, python-format msgid "The code must be unique!" msgstr "" diff --git a/crm_lead_code/i18n/fr.po b/crm_lead_code/i18n/fr.po index 4175aabd8c8..8e43df9b670 100644 --- a/crm_lead_code/i18n/fr.po +++ b/crm_lead_code/i18n/fr.po @@ -19,7 +19,7 @@ msgstr "" "Plural-Forms: nplurals=2; plural=(n > 1);\n" #. module: crm_lead_code -#: model:ir.model.fields,field_description:crm_lead_code.field_crm_lead_code +#: model:ir.model.fields,field_description:crm_lead_code.field_crm_lead__code msgid "Lead Number" msgstr "" @@ -29,7 +29,7 @@ msgid "Lead/Opportunity" msgstr "Piste/Opportunit??" #. module: crm_lead_code -#: code:addons/crm_lead_code/models/crm_lead.py:17 sql_constraint:crm.lead:0 +#: code:addons/crm_lead_code/models/crm_lead.py:16 sql_constraint:crm.lead:0 #, python-format msgid "The code must be unique!" msgstr "" diff --git a/crm_lead_code/i18n/hr.po b/crm_lead_code/i18n/hr.po index 2cbf406ebc6..67f3ad78044 100644 --- a/crm_lead_code/i18n/hr.po +++ b/crm_lead_code/i18n/hr.po @@ -20,7 +20,7 @@ msgstr "" "%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2;\n" #. module: crm_lead_code -#: model:ir.model.fields,field_description:crm_lead_code.field_crm_lead_code +#: model:ir.model.fields,field_description:crm_lead_code.field_crm_lead__code msgid "Lead Number" msgstr "" @@ -30,7 +30,7 @@ msgid "Lead/Opportunity" msgstr "Potencijalni klijent" #. module: crm_lead_code -#: code:addons/crm_lead_code/models/crm_lead.py:17 sql_constraint:crm.lead:0 +#: code:addons/crm_lead_code/models/crm_lead.py:16 sql_constraint:crm.lead:0 #, python-format msgid "The code must be unique!" msgstr "" diff --git a/crm_lead_code/i18n/it.po b/crm_lead_code/i18n/it.po index 63a3f5bde8b..3d84e94c2ae 100644 --- a/crm_lead_code/i18n/it.po +++ b/crm_lead_code/i18n/it.po @@ -19,7 +19,7 @@ msgstr "" "Plural-Forms: nplurals=2; plural=(n != 1);\n" #. module: crm_lead_code -#: model:ir.model.fields,field_description:crm_lead_code.field_crm_lead_code +#: model:ir.model.fields,field_description:crm_lead_code.field_crm_lead__code msgid "Lead Number" msgstr "" @@ -29,7 +29,7 @@ msgid "Lead/Opportunity" msgstr "Lead/Opportunit??" #. module: crm_lead_code -#: code:addons/crm_lead_code/models/crm_lead.py:17 sql_constraint:crm.lead:0 +#: code:addons/crm_lead_code/models/crm_lead.py:16 sql_constraint:crm.lead:0 #, python-format msgid "The code must be unique!" msgstr "" diff --git a/crm_lead_code/i18n/pt_BR.po b/crm_lead_code/i18n/pt_BR.po index 12710e89991..1a83485410f 100644 --- a/crm_lead_code/i18n/pt_BR.po +++ b/crm_lead_code/i18n/pt_BR.po @@ -20,7 +20,7 @@ msgstr "" "Plural-Forms: nplurals=2; plural=(n > 1);\n" #. module: crm_lead_code -#: model:ir.model.fields,field_description:crm_lead_code.field_crm_lead_code +#: model:ir.model.fields,field_description:crm_lead_code.field_crm_lead__code msgid "Lead Number" msgstr "" @@ -30,7 +30,7 @@ msgid "Lead/Opportunity" msgstr "Prospector/Oportunidade" #. module: crm_lead_code -#: code:addons/crm_lead_code/models/crm_lead.py:17 sql_constraint:crm.lead:0 +#: code:addons/crm_lead_code/models/crm_lead.py:16 sql_constraint:crm.lead:0 #, python-format msgid "The code must be unique!" msgstr "" diff --git a/crm_lead_code/i18n/sk.po b/crm_lead_code/i18n/sk.po index 021c21b082d..658a003d57a 100644 --- a/crm_lead_code/i18n/sk.po +++ b/crm_lead_code/i18n/sk.po @@ -19,7 +19,7 @@ msgstr "" "Plural-Forms: nplurals=3; plural=(n==1) ? 0 : (n>=2 && n<=4) ? 1 : 2;\n" #. module: crm_lead_code -#: model:ir.model.fields,field_description:crm_lead_code.field_crm_lead_code +#: model:ir.model.fields,field_description:crm_lead_code.field_crm_lead__code msgid "Lead Number" msgstr "" @@ -29,7 +29,7 @@ msgid "Lead/Opportunity" msgstr "Iniciat??va/Pr??le??itos??" #. module: crm_lead_code -#: code:addons/crm_lead_code/models/crm_lead.py:17 sql_constraint:crm.lead:0 +#: code:addons/crm_lead_code/models/crm_lead.py:16 sql_constraint:crm.lead:0 #, python-format msgid "The code must be unique!" msgstr "" diff --git a/crm_lead_code/i18n/sl.po b/crm_lead_code/i18n/sl.po index e8d917a77dc..c854c130bc2 100644 --- a/crm_lead_code/i18n/sl.po +++ b/crm_lead_code/i18n/sl.po @@ -20,7 +20,7 @@ msgstr "" "%100==4 ? 2 : 3);\n" #. module: crm_lead_code -#: model:ir.model.fields,field_description:crm_lead_code.field_crm_lead_code +#: model:ir.model.fields,field_description:crm_lead_code.field_crm_lead__code msgid "Lead Number" msgstr "" @@ -30,7 +30,7 @@ msgid "Lead/Opportunity" msgstr "Indic/prilo??nost" #. module: crm_lead_code -#: code:addons/crm_lead_code/models/crm_lead.py:17 sql_constraint:crm.lead:0 +#: code:addons/crm_lead_code/models/crm_lead.py:16 sql_constraint:crm.lead:0 #, python-format msgid "The code must be unique!" msgstr "" diff --git a/crm_lead_code/i18n/tr.po b/crm_lead_code/i18n/tr.po index 776236576e9..7637c4a371f 100644 --- a/crm_lead_code/i18n/tr.po +++ b/crm_lead_code/i18n/tr.po @@ -19,7 +19,7 @@ msgstr "" "Plural-Forms: nplurals=2; plural=(n > 1);\n" #. module: crm_lead_code -#: model:ir.model.fields,field_description:crm_lead_code.field_crm_lead_code +#: model:ir.model.fields,field_description:crm_lead_code.field_crm_lead__code msgid "Lead Number" msgstr "" @@ -29,7 +29,7 @@ msgid "Lead/Opportunity" msgstr "Aday/F??rsat" #. module: crm_lead_code -#: code:addons/crm_lead_code/models/crm_lead.py:17 sql_constraint:crm.lead:0 +#: code:addons/crm_lead_code/models/crm_lead.py:16 sql_constraint:crm.lead:0 #, python-format msgid "The code must be unique!" msgstr "" diff --git a/crm_lead_code/i18n/zh_CN.po b/crm_lead_code/i18n/zh_CN.po index e33b6a244e6..f4e9edd0b2a 100644 --- a/crm_lead_code/i18n/zh_CN.po +++ b/crm_lead_code/i18n/zh_CN.po @@ -20,7 +20,7 @@ msgstr "" "Plural-Forms: nplurals=1; plural=0;\n" #. module: crm_lead_code -#: model:ir.model.fields,field_description:crm_lead_code.field_crm_lead_code +#: model:ir.model.fields,field_description:crm_lead_code.field_crm_lead__code msgid "Lead Number" msgstr "" @@ -30,7 +30,7 @@ msgid "Lead/Opportunity" msgstr "??????/??????" #. module: crm_lead_code -#: code:addons/crm_lead_code/models/crm_lead.py:17 sql_constraint:crm.lead:0 +#: code:addons/crm_lead_code/models/crm_lead.py:16 sql_constraint:crm.lead:0 #, python-format msgid "The code must be unique!" msgstr "" diff --git a/crm_lead_code/models/__init__.py b/crm_lead_code/models/__init__.py index 3c2b59c8609..ed991450bfe 100644 --- a/crm_lead_code/models/__init__.py +++ b/crm_lead_code/models/__init__.py @@ -1,5 +1,4 @@ -# -*- coding: utf-8 -*- -############################################################################## +############################################################################# # For copyright and license notices, see __manifest__.py file in root directory ############################################################################## from . import crm_lead diff --git a/crm_lead_code/models/crm_lead.py b/crm_lead_code/models/crm_lead.py index 28101e426b7..7af4d72f893 100644 --- a/crm_lead_code/models/crm_lead.py +++ b/crm_lead_code/models/crm_lead.py @@ -1,4 +1,3 @@ -# -*- coding: utf-8 -*- ############################################################################## # For copyright and license notices, see __manifest__.py file in root directory ############################################################################## @@ -17,11 +16,12 @@ class CrmLead(models.Model): _('The code must be unique!')), ] - @api.model - def create(self, vals): - if vals.get('code', '/') == '/': - vals['code'] = self.env['ir.sequence'].next_by_code('crm.lead') - return super(CrmLead, self).create(vals) + @api.model_create_multi + def create(self, vals_list): + for vals in vals_list: + if vals.get('code', '/') == '/': + vals['code'] = self.env['ir.sequence'].next_by_code('crm.lead') + return super(CrmLead, self).create(vals_list) @api.multi def copy(self, default=None): diff --git a/crm_lead_code/tests/__init__.py b/crm_lead_code/tests/__init__.py index 7ba686aed97..4982e98fb01 100644 --- a/crm_lead_code/tests/__init__.py +++ b/crm_lead_code/tests/__init__.py @@ -1,4 +1,3 @@ -# -*- coding: utf-8 -*- ############################################################################## # For copyright and license notices, see __manifest__.py file in root directory ############################################################################## diff --git a/crm_lead_code/tests/test_crm_lead_code.py b/crm_lead_code/tests/test_crm_lead_code.py index 44f56694845..9af9b19fd14 100644 --- a/crm_lead_code/tests/test_crm_lead_code.py +++ b/crm_lead_code/tests/test_crm_lead_code.py @@ -1,4 +1,3 @@ -# -*- coding: utf-8 -*- ############################################################################## # For copyright and license notices, see __manifest__.py file in root directory ############################################################################## diff --git a/crm_lead_code/views/crm_lead_view.xml b/crm_lead_code/views/crm_lead_view.xml index 09d7969b990..7d3b4cd4c76 100644 --- a/crm_lead_code/views/crm_lead_view.xml +++ b/crm_lead_code/views/crm_lead_view.xml @@ -7,7 +7,7 @@ - @@ -41,7 +41,7 @@ - From 4b3042b578db7abd642acbc524ab60dd3b4af263 Mon Sep 17 00:00:00 2001 From: Rodrigo Macedo Date: Tue, 3 Sep 2019 01:01:31 +0000 Subject: [PATCH 09/31] Translated using Weblate (Portuguese (Brazil)) Currently translated at 100.0% (3 of 3 strings) Translation: crm-12.0/crm-12.0-crm_lead_code Translate-URL: https://translation.odoo-community.org/projects/crm-12-0/crm-12-0-crm_lead_code/pt_BR/ --- crm_lead_code/i18n/pt_BR.po | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/crm_lead_code/i18n/pt_BR.po b/crm_lead_code/i18n/pt_BR.po index 1a83485410f..bc354e75862 100644 --- a/crm_lead_code/i18n/pt_BR.po +++ b/crm_lead_code/i18n/pt_BR.po @@ -9,20 +9,21 @@ msgstr "" "Project-Id-Version: Odoo Server 10.0\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2017-12-04 15:47+0000\n" -"PO-Revision-Date: 2017-12-04 15:47+0000\n" -"Last-Translator: OCA Transbot , 2017\n" -"Language-Team: Portuguese (Brazil) (https://www.transifex.com/oca/" -"teams/23907/pt_BR/)\n" +"PO-Revision-Date: 2019-09-03 03:23+0000\n" +"Last-Translator: Rodrigo Macedo \n" +"Language-Team: Portuguese (Brazil) (https://www.transifex.com/oca/teams/" +"23907/pt_BR/)\n" "Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: \n" -"Plural-Forms: nplurals=2; plural=(n > 1);\n" +"Plural-Forms: nplurals=2; plural=n > 1;\n" +"X-Generator: Weblate 3.8\n" #. module: crm_lead_code #: model:ir.model.fields,field_description:crm_lead_code.field_crm_lead__code msgid "Lead Number" -msgstr "" +msgstr "Número da ligação" #. module: crm_lead_code #: model:ir.model,name:crm_lead_code.model_crm_lead @@ -33,4 +34,4 @@ msgstr "Prospector/Oportunidade" #: code:addons/crm_lead_code/models/crm_lead.py:16 sql_constraint:crm.lead:0 #, python-format msgid "The code must be unique!" -msgstr "" +msgstr "O código deve ser único!" From df5ac3d0a5049f12b9d5b4fb231e3bc7e8728aa4 Mon Sep 17 00:00:00 2001 From: Murtuza Saleh Date: Mon, 30 Sep 2019 15:10:36 +0530 Subject: [PATCH 10/31] [WIP][13.0][MIG] crm_lead_code --- crm_lead_code/README.rst | 61 ++- crm_lead_code/__manifest__.py | 12 +- crm_lead_code/models/crm_lead.py | 16 +- crm_lead_code/readme/CONTRIBUTORS.rst | 6 + crm_lead_code/readme/DESCRIPTION.rst | 1 + crm_lead_code/static/description/index.html | 425 ++++++++++++++++++++ crm_lead_code/views/crm_lead_view.xml | 122 +++--- 7 files changed, 541 insertions(+), 102 deletions(-) create mode 100644 crm_lead_code/readme/CONTRIBUTORS.rst create mode 100644 crm_lead_code/readme/DESCRIPTION.rst create mode 100644 crm_lead_code/static/description/index.html diff --git a/crm_lead_code/README.rst b/crm_lead_code/README.rst index 8f6dbe16a7d..8606763c028 100644 --- a/crm_lead_code/README.rst +++ b/crm_lead_code/README.rst @@ -1,52 +1,79 @@ -.. image:: https://img.shields.io/badge/licence-AGPL--3-blue.svg - :target: http://www.gnu.org/licenses/agpl-3.0-standalone.html - :alt: License: AGPL-3 - ========================================= -Sequential code for Leads / Opportunities +Sequential Code for Leads / Opportunities ========================================= -* This module adds a sequential code for leads / opportunities. +.. !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + !! This file is generated by oca-gen-addon-readme !! + !! changes will be overwritten. !! + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +.. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png + :target: https://odoo-community.org/page/development-status + :alt: Beta +.. |badge2| image:: https://img.shields.io/badge/licence-AGPL--3-blue.png + :target: http://www.gnu.org/licenses/agpl-3.0-standalone.html + :alt: License: AGPL-3 +.. |badge3| image:: https://img.shields.io/badge/github-OCA%2Fcrm-lightgray.png?logo=github + :target: https://github.com/OCA/crm/tree/13.0/crm_lead_code + :alt: OCA/crm +.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png + :target: https://translation.odoo-community.org/projects/crm-13-0/crm-13-0-crm_lead_code + :alt: Translate me on Weblate +.. |badge5| image:: https://img.shields.io/badge/runbot-Try%20me-875A7B.png + :target: https://runbot.odoo-community.org/runbot/111/13.0 + :alt: Try me on Runbot + +|badge1| |badge2| |badge3| |badge4| |badge5| +This module adds a sequential code for leads / opportunities. -.. 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 +**Table of contents** +.. contents:: + :local: 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 `_. +If you spotted it first, help us smashing it by providing a detailed and welcomed +`feedback `_. +Do not contact contributors directly about support or help with technical issues. Credits ======= +Authors +~~~~~~~ + +* Tecnativa +* AvanzOSC + Contributors ------------- +~~~~~~~~~~~~ * Oihane Crucelaegui * Pedro M. Baeza * Ana Juaristi * Nicol??s Ramos * Mathias Markl +* Serpent Consulting Services Pvt. Ltd. -Maintainer ----------- +Maintainers +~~~~~~~~~~~ + +This module is maintained by the OCA. .. 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. +This module is part of the `OCA/crm `_ project on GitHub. +You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute. diff --git a/crm_lead_code/__manifest__.py b/crm_lead_code/__manifest__.py index 1d90665185d..3a4d7ae828e 100644 --- a/crm_lead_code/__manifest__.py +++ b/crm_lead_code/__manifest__.py @@ -21,25 +21,19 @@ { "name": "Sequential Code for Leads / Opportunities", - "version": "12.0.1.0.0", + "version": "13.0.1.0.0", "category": "Customer Relationship Management", "author": "Tecnativa, " "AvanzOSC, " "Odoo Community Association (OCA)", - "website": "http://www.odoomrp.com", + "website": "https://github.com/OCA/crm", "license": "AGPL-3", - "contributors": [ - "Oihane Crucelaegui ", - "Pedro M. Baeza ", - "Ana Juaristi ", - "Mathias Markl ", - ], "depends": [ "crm", ], "data": [ - "views/crm_lead_view.xml", "data/lead_sequence.xml", + "views/crm_lead_view.xml", ], 'installable': True, "pre_init_hook": "create_code_equal_to_id", diff --git a/crm_lead_code/models/crm_lead.py b/crm_lead_code/models/crm_lead.py index 7af4d72f893..7c742f757cf 100644 --- a/crm_lead_code/models/crm_lead.py +++ b/crm_lead_code/models/crm_lead.py @@ -9,7 +9,8 @@ class CrmLead(models.Model): _inherit = "crm.lead" code = fields.Char( - string='Lead Number', required=True, default="/", readonly=True) + string='Lead Number', required=True, default="/", + readonly=True, copy=False) _sql_constraints = [ ('crm_lead_unique_code', 'UNIQUE (code)', @@ -20,12 +21,7 @@ class CrmLead(models.Model): def create(self, vals_list): for vals in vals_list: if vals.get('code', '/') == '/': - vals['code'] = self.env['ir.sequence'].next_by_code('crm.lead') - return super(CrmLead, self).create(vals_list) - - @api.multi - def copy(self, default=None): - if default is None: - default = {} - default['code'] = self.env['ir.sequence'].next_by_code('crm.lead') - return super(CrmLead, self).copy(default) + vals['code'] = self.env.ref( + 'crm_lead_code.sequence_lead', + raise_if_not_found=False).next_by_id() + return super().create(vals_list) diff --git a/crm_lead_code/readme/CONTRIBUTORS.rst b/crm_lead_code/readme/CONTRIBUTORS.rst new file mode 100644 index 00000000000..6f26601fc1d --- /dev/null +++ b/crm_lead_code/readme/CONTRIBUTORS.rst @@ -0,0 +1,6 @@ +* Oihane Crucelaegui +* Pedro M. Baeza +* Ana Juaristi +* Nicol??s Ramos +* Mathias Markl +* Serpent Consulting Services Pvt. Ltd. diff --git a/crm_lead_code/readme/DESCRIPTION.rst b/crm_lead_code/readme/DESCRIPTION.rst new file mode 100644 index 00000000000..739a2ce6208 --- /dev/null +++ b/crm_lead_code/readme/DESCRIPTION.rst @@ -0,0 +1 @@ +This module adds a sequential code for leads / opportunities. diff --git a/crm_lead_code/static/description/index.html b/crm_lead_code/static/description/index.html new file mode 100644 index 00000000000..f0ac5c79ab1 --- /dev/null +++ b/crm_lead_code/static/description/index.html @@ -0,0 +1,425 @@ + + + + + + +Sequential Code for Leads / Opportunities + + + +
+

Sequential Code for Leads / Opportunities

+ + +

Beta License: AGPL-3 OCA/crm Translate me on Weblate Try me on Runbot

+

This module adds a sequential code for leads / opportunities.

+

Table of contents

+ +
+

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.

+

Do not contact contributors directly about support or help with technical issues.

+
+
+

Credits

+
+

Authors

+
    +
  • Tecnativa
  • +
  • AvanzOSC
  • +
+
+
+

Contributors

+ +
+
+

Maintainers

+

This module is maintained by the OCA.

+Odoo Community Association +

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.

+

This module is part of the OCA/crm project on GitHub.

+

You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.

+
+
+
+ + diff --git a/crm_lead_code/views/crm_lead_view.xml b/crm_lead_code/views/crm_lead_view.xml index 7d3b4cd4c76..c61bda59741 100644 --- a/crm_lead_code/views/crm_lead_view.xml +++ b/crm_lead_code/views/crm_lead_view.xml @@ -1,81 +1,71 @@ - - crm.lead.code.form - crm.lead - - - - - - - - - crm.lead.code.tree - crm.lead - - - - - + + crm.lead.form + crm.lead + + + + + - + + - - crm.lead.code.search - crm.lead - - - - ['|', ('name', 'ilike', self), ('code', 'ilike', self)] - + + crm.lead.tree.lead + crm.lead + + + + - + + - - crm.lead.oppor.code.form - crm.lead - - - - - + + crm.lead.search.lead + crm.lead + + + + ['|', ('name', 'ilike', self), ('code', 'ilike', self)] - + + - - crm.lead.oppor.code.tree - crm.lead - - - - - + + crm.lead.tree.opportunity + crm.lead + + + + - + + - - crm.lead.code.kanban - crm.lead - - - - - + + crm.lead.kanban.lead + crm.lead + + + + - + + - - crm.lead.oppor.code.search - crm.lead - - - - ['|', ('name', 'ilike', self), ('code', 'ilike', self)] - + + crm.lead.search.opportunity + crm.lead + + + + ['|', ('name', 'ilike', self), ('code', 'ilike', self)] - + + + From dbfb34826987ba2da3a08b0e9d8d528580cd7239 Mon Sep 17 00:00:00 2001 From: Murtuza Saleh Date: Tue, 5 May 2020 11:42:33 +0530 Subject: [PATCH 11/31] [FIX] Travis [UPD] Update crm_lead_code.pot [UPD] README.rst --- crm_lead_code/__init__.py | 18 ++++++++---------- crm_lead_code/__manifest__.py | 15 ++++----------- crm_lead_code/data/lead_sequence.xml | 1 - crm_lead_code/i18n/bg.po | 3 ++- crm_lead_code/i18n/crm_lead_code.pot | 11 +++++------ crm_lead_code/i18n/de.po | 3 ++- crm_lead_code/i18n/es.po | 3 ++- crm_lead_code/i18n/fr.po | 3 ++- crm_lead_code/i18n/hr.po | 3 ++- crm_lead_code/i18n/it.po | 3 ++- crm_lead_code/i18n/pt_BR.po | 7 ++++--- crm_lead_code/i18n/sk.po | 3 ++- crm_lead_code/i18n/sl.po | 3 ++- crm_lead_code/i18n/tr.po | 3 ++- crm_lead_code/i18n/zh_CN.po | 3 ++- crm_lead_code/models/crm_lead.py | 17 ++++++++--------- crm_lead_code/static/description/index.html | 2 +- crm_lead_code/tests/test_crm_lead_code.py | 21 ++++++++------------- crm_lead_code/views/crm_lead_view.xml | 16 ++++++---------- 19 files changed, 64 insertions(+), 74 deletions(-) diff --git a/crm_lead_code/__init__.py b/crm_lead_code/__init__.py index 38c315a0f64..164ded0b60d 100644 --- a/crm_lead_code/__init__.py +++ b/crm_lead_code/__init__.py @@ -7,19 +7,17 @@ def create_code_equal_to_id(cr): - cr.execute('ALTER TABLE crm_lead ' - 'ADD COLUMN code character varying;') - cr.execute('UPDATE crm_lead ' - 'SET code = id;') + cr.execute("ALTER TABLE crm_lead " "ADD COLUMN code character varying;") + cr.execute("UPDATE crm_lead " "SET code = id;") def assign_old_sequences(cr, registry): env = api.Environment(cr, SUPERUSER_ID, dict()) - lead_obj = env['crm.lead'] - sequence_obj = env['ir.sequence'] + lead_obj = env["crm.lead"] + sequence_obj = env["ir.sequence"] leads = lead_obj.search([], order="id") for lead_id in leads.ids: - cr.execute('UPDATE crm_lead ' - 'SET code = %s ' - 'WHERE id = %s;', - (sequence_obj.next_by_code('crm.lead'), lead_id, )) + cr.execute( + "UPDATE crm_lead " "SET code = %s " "WHERE id = %s;", + (sequence_obj.next_by_code("crm.lead"), lead_id,), + ) diff --git a/crm_lead_code/__manifest__.py b/crm_lead_code/__manifest__.py index 3a4d7ae828e..aaf7c460441 100644 --- a/crm_lead_code/__manifest__.py +++ b/crm_lead_code/__manifest__.py @@ -23,19 +23,12 @@ "name": "Sequential Code for Leads / Opportunities", "version": "13.0.1.0.0", "category": "Customer Relationship Management", - "author": "Tecnativa, " - "AvanzOSC, " - "Odoo Community Association (OCA)", + "author": "Tecnativa, " "AvanzOSC, " "Odoo Community Association (OCA)", "website": "https://github.com/OCA/crm", "license": "AGPL-3", - "depends": [ - "crm", - ], - "data": [ - "data/lead_sequence.xml", - "views/crm_lead_view.xml", - ], - 'installable': True, + "depends": ["crm"], + "data": ["data/lead_sequence.xml", "views/crm_lead_view.xml"], + "installable": True, "pre_init_hook": "create_code_equal_to_id", "post_init_hook": "assign_old_sequences", } diff --git a/crm_lead_code/data/lead_sequence.xml b/crm_lead_code/data/lead_sequence.xml index 7f54f40f92e..b07eac6c1bf 100644 --- a/crm_lead_code/data/lead_sequence.xml +++ b/crm_lead_code/data/lead_sequence.xml @@ -1,4 +1,3 @@ - Lead Code diff --git a/crm_lead_code/i18n/bg.po b/crm_lead_code/i18n/bg.po index 560eacc1701..8c1b04525ea 100644 --- a/crm_lead_code/i18n/bg.po +++ b/crm_lead_code/i18n/bg.po @@ -29,7 +29,8 @@ msgid "Lead/Opportunity" msgstr "??????????/????????????????????" #. module: crm_lead_code -#: code:addons/crm_lead_code/models/crm_lead.py:16 sql_constraint:crm.lead:0 +#: code:addons/crm_lead_code/models/crm_lead.py:0 +#: model:ir.model.constraint,message:crm_lead_code.constraint_crm_lead_crm_lead_unique_code #, python-format msgid "The code must be unique!" msgstr "" diff --git a/crm_lead_code/i18n/crm_lead_code.pot b/crm_lead_code/i18n/crm_lead_code.pot index 462f8a5bab7..097e9d75745 100644 --- a/crm_lead_code/i18n/crm_lead_code.pot +++ b/crm_lead_code/i18n/crm_lead_code.pot @@ -1,12 +1,12 @@ # Translation of Odoo Server. # This file contains the translation of the following modules: -# * crm_lead_code +# * crm_lead_code # msgid "" msgstr "" -"Project-Id-Version: Odoo Server 12.0\n" +"Project-Id-Version: Odoo Server 13.0\n" "Report-Msgid-Bugs-To: \n" -"Last-Translator: <>\n" +"Last-Translator: \n" "Language-Team: \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" @@ -24,9 +24,8 @@ msgid "Lead/Opportunity" msgstr "" #. module: crm_lead_code -#: code:addons/crm_lead_code/models/crm_lead.py:16 -#: sql_constraint:crm.lead:0 +#: code:addons/crm_lead_code/models/crm_lead.py:0 +#: model:ir.model.constraint,message:crm_lead_code.constraint_crm_lead_crm_lead_unique_code #, python-format msgid "The code must be unique!" msgstr "" - diff --git a/crm_lead_code/i18n/de.po b/crm_lead_code/i18n/de.po index 085e3fcece7..570abdd2c8d 100644 --- a/crm_lead_code/i18n/de.po +++ b/crm_lead_code/i18n/de.po @@ -30,7 +30,8 @@ msgid "Lead/Opportunity" msgstr "Lead/Chance" #. module: crm_lead_code -#: code:addons/crm_lead_code/models/crm_lead.py:16 sql_constraint:crm.lead:0 +#: code:addons/crm_lead_code/models/crm_lead.py:0 +#: model:ir.model.constraint,message:crm_lead_code.constraint_crm_lead_crm_lead_unique_code #, python-format msgid "The code must be unique!" msgstr "Der Schl??ssel muss eindeutig sein!" diff --git a/crm_lead_code/i18n/es.po b/crm_lead_code/i18n/es.po index ea95c5ad1f4..1f94701719e 100644 --- a/crm_lead_code/i18n/es.po +++ b/crm_lead_code/i18n/es.po @@ -29,7 +29,8 @@ msgid "Lead/Opportunity" msgstr "Iniciativa/Oportunidad" #. module: crm_lead_code -#: code:addons/crm_lead_code/models/crm_lead.py:16 sql_constraint:crm.lead:0 +#: code:addons/crm_lead_code/models/crm_lead.py:0 +#: model:ir.model.constraint,message:crm_lead_code.constraint_crm_lead_crm_lead_unique_code #, python-format msgid "The code must be unique!" msgstr "" diff --git a/crm_lead_code/i18n/fr.po b/crm_lead_code/i18n/fr.po index 8e43df9b670..3d765210089 100644 --- a/crm_lead_code/i18n/fr.po +++ b/crm_lead_code/i18n/fr.po @@ -29,7 +29,8 @@ msgid "Lead/Opportunity" msgstr "Piste/Opportunit??" #. module: crm_lead_code -#: code:addons/crm_lead_code/models/crm_lead.py:16 sql_constraint:crm.lead:0 +#: code:addons/crm_lead_code/models/crm_lead.py:0 +#: model:ir.model.constraint,message:crm_lead_code.constraint_crm_lead_crm_lead_unique_code #, python-format msgid "The code must be unique!" msgstr "" diff --git a/crm_lead_code/i18n/hr.po b/crm_lead_code/i18n/hr.po index 67f3ad78044..d2fc8e5be6b 100644 --- a/crm_lead_code/i18n/hr.po +++ b/crm_lead_code/i18n/hr.po @@ -30,7 +30,8 @@ msgid "Lead/Opportunity" msgstr "Potencijalni klijent" #. module: crm_lead_code -#: code:addons/crm_lead_code/models/crm_lead.py:16 sql_constraint:crm.lead:0 +#: code:addons/crm_lead_code/models/crm_lead.py:0 +#: model:ir.model.constraint,message:crm_lead_code.constraint_crm_lead_crm_lead_unique_code #, python-format msgid "The code must be unique!" msgstr "" diff --git a/crm_lead_code/i18n/it.po b/crm_lead_code/i18n/it.po index 3d84e94c2ae..93178b4b0cd 100644 --- a/crm_lead_code/i18n/it.po +++ b/crm_lead_code/i18n/it.po @@ -29,7 +29,8 @@ msgid "Lead/Opportunity" msgstr "Lead/Opportunit??" #. module: crm_lead_code -#: code:addons/crm_lead_code/models/crm_lead.py:16 sql_constraint:crm.lead:0 +#: code:addons/crm_lead_code/models/crm_lead.py:0 +#: model:ir.model.constraint,message:crm_lead_code.constraint_crm_lead_crm_lead_unique_code #, python-format msgid "The code must be unique!" msgstr "" diff --git a/crm_lead_code/i18n/pt_BR.po b/crm_lead_code/i18n/pt_BR.po index bc354e75862..64f9d8e958e 100644 --- a/crm_lead_code/i18n/pt_BR.po +++ b/crm_lead_code/i18n/pt_BR.po @@ -11,8 +11,8 @@ msgstr "" "POT-Creation-Date: 2017-12-04 15:47+0000\n" "PO-Revision-Date: 2019-09-03 03:23+0000\n" "Last-Translator: Rodrigo Macedo \n" -"Language-Team: Portuguese (Brazil) (https://www.transifex.com/oca/teams/" -"23907/pt_BR/)\n" +"Language-Team: Portuguese (Brazil) (https://www.transifex.com/oca/" +"teams/23907/pt_BR/)\n" "Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" @@ -31,7 +31,8 @@ msgid "Lead/Opportunity" msgstr "Prospector/Oportunidade" #. module: crm_lead_code -#: code:addons/crm_lead_code/models/crm_lead.py:16 sql_constraint:crm.lead:0 +#: code:addons/crm_lead_code/models/crm_lead.py:0 +#: model:ir.model.constraint,message:crm_lead_code.constraint_crm_lead_crm_lead_unique_code #, python-format msgid "The code must be unique!" msgstr "O código deve ser único!" diff --git a/crm_lead_code/i18n/sk.po b/crm_lead_code/i18n/sk.po index 658a003d57a..32f8bdc2eee 100644 --- a/crm_lead_code/i18n/sk.po +++ b/crm_lead_code/i18n/sk.po @@ -29,7 +29,8 @@ msgid "Lead/Opportunity" msgstr "Iniciat??va/Pr??le??itos??" #. module: crm_lead_code -#: code:addons/crm_lead_code/models/crm_lead.py:16 sql_constraint:crm.lead:0 +#: code:addons/crm_lead_code/models/crm_lead.py:0 +#: model:ir.model.constraint,message:crm_lead_code.constraint_crm_lead_crm_lead_unique_code #, python-format msgid "The code must be unique!" msgstr "" diff --git a/crm_lead_code/i18n/sl.po b/crm_lead_code/i18n/sl.po index c854c130bc2..c7710beb343 100644 --- a/crm_lead_code/i18n/sl.po +++ b/crm_lead_code/i18n/sl.po @@ -30,7 +30,8 @@ msgid "Lead/Opportunity" msgstr "Indic/prilo??nost" #. module: crm_lead_code -#: code:addons/crm_lead_code/models/crm_lead.py:16 sql_constraint:crm.lead:0 +#: code:addons/crm_lead_code/models/crm_lead.py:0 +#: model:ir.model.constraint,message:crm_lead_code.constraint_crm_lead_crm_lead_unique_code #, python-format msgid "The code must be unique!" msgstr "" diff --git a/crm_lead_code/i18n/tr.po b/crm_lead_code/i18n/tr.po index 7637c4a371f..073b0d580dd 100644 --- a/crm_lead_code/i18n/tr.po +++ b/crm_lead_code/i18n/tr.po @@ -29,7 +29,8 @@ msgid "Lead/Opportunity" msgstr "Aday/F??rsat" #. module: crm_lead_code -#: code:addons/crm_lead_code/models/crm_lead.py:16 sql_constraint:crm.lead:0 +#: code:addons/crm_lead_code/models/crm_lead.py:0 +#: model:ir.model.constraint,message:crm_lead_code.constraint_crm_lead_crm_lead_unique_code #, python-format msgid "The code must be unique!" msgstr "" diff --git a/crm_lead_code/i18n/zh_CN.po b/crm_lead_code/i18n/zh_CN.po index f4e9edd0b2a..01196ed3edc 100644 --- a/crm_lead_code/i18n/zh_CN.po +++ b/crm_lead_code/i18n/zh_CN.po @@ -30,7 +30,8 @@ msgid "Lead/Opportunity" msgstr "??????/??????" #. module: crm_lead_code -#: code:addons/crm_lead_code/models/crm_lead.py:16 sql_constraint:crm.lead:0 +#: code:addons/crm_lead_code/models/crm_lead.py:0 +#: model:ir.model.constraint,message:crm_lead_code.constraint_crm_lead_crm_lead_unique_code #, python-format msgid "The code must be unique!" msgstr "" diff --git a/crm_lead_code/models/crm_lead.py b/crm_lead_code/models/crm_lead.py index 7c742f757cf..631741326bb 100644 --- a/crm_lead_code/models/crm_lead.py +++ b/crm_lead_code/models/crm_lead.py @@ -2,26 +2,25 @@ # For copyright and license notices, see __manifest__.py file in root directory ############################################################################## -from odoo import api, fields, models, _ +from odoo import _, api, fields, models class CrmLead(models.Model): _inherit = "crm.lead" code = fields.Char( - string='Lead Number', required=True, default="/", - readonly=True, copy=False) + string="Lead Number", required=True, default="/", readonly=True, copy=False + ) _sql_constraints = [ - ('crm_lead_unique_code', 'UNIQUE (code)', - _('The code must be unique!')), + ("crm_lead_unique_code", "UNIQUE (code)", _("The code must be unique!")), ] @api.model_create_multi def create(self, vals_list): for vals in vals_list: - if vals.get('code', '/') == '/': - vals['code'] = self.env.ref( - 'crm_lead_code.sequence_lead', - raise_if_not_found=False).next_by_id() + if vals.get("code", "/") == "/": + vals["code"] = self.env.ref( + "crm_lead_code.sequence_lead", raise_if_not_found=False + ).next_by_id() return super().create(vals_list) diff --git a/crm_lead_code/static/description/index.html b/crm_lead_code/static/description/index.html index f0ac5c79ab1..fc0a5ce7cd4 100644 --- a/crm_lead_code/static/description/index.html +++ b/crm_lead_code/static/description/index.html @@ -3,7 +3,7 @@ - + Sequential Code for Leads / Opportunities