Skip to content

Commit

Permalink
Merge d6f4283 into 1eac3fc
Browse files Browse the repository at this point in the history
  • Loading branch information
murtuzasaleh committed Oct 1, 2019
2 parents 1eac3fc + d6f4283 commit 0f9e8a4
Show file tree
Hide file tree
Showing 25 changed files with 1,155 additions and 0 deletions.
79 changes: 79 additions & 0 deletions crm_lead_code/README.rst
@@ -0,0 +1,79 @@
=========================================
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.

**Table of contents**

.. contents::
:local:

Bug Tracker
===========

Bugs are tracked on `GitHub Issues <https://github.com/OCA/crm/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 <https://github.com/OCA/crm/issues/new?body=module:%20crm_lead_code%0Aversion:%2013.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_.

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

Credits
=======

Authors
~~~~~~~

* Tecnativa
* AvanzOSC

Contributors
~~~~~~~~~~~~

* Oihane Crucelaegui <oihanecrucelaegi@avanzosc.es>
* Pedro M. Baeza <pedro.baeza@serviciosbaeza.com>
* Ana Juaristi <anajuarist@avanzosc.es>
* Nicol??s Ramos <contacto@difusionvisual.com>
* Mathias Markl <mathias.markl@mukit.at>
* Serpent Consulting Services Pvt. Ltd. <support@serpentcs.com>

Maintainers
~~~~~~~~~~~

This module is maintained by the OCA.

.. image:: https://odoo-community.org/logo.png
:alt: Odoo Community Association
:target: https://odoo-community.org

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 <https://github.com/OCA/crm/tree/13.0/crm_lead_code>`_ project on GitHub.

You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.
25 changes: 25 additions & 0 deletions crm_lead_code/__init__.py
@@ -0,0 +1,25 @@
##############################################################################
# For copyright and license notices, see __manifest__.py file in root directory
##############################################################################

from . import models
from odoo import api, 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):
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 = %s;',
(sequence_obj.next_by_code('crm.lead'), lead_id, ))
41 changes: 41 additions & 0 deletions crm_lead_code/__manifest__.py
@@ -0,0 +1,41 @@
##############################################################################
#
# 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 <http://www.gnu.org/licenses/>.
#
##############################################################################

{
"name": "Sequential Code for Leads / Opportunities",
"version": "13.0.1.0.0",
"category": "Customer Relationship Management",
"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,
"pre_init_hook": "create_code_equal_to_id",
"post_init_hook": "assign_old_sequences",
}
9 changes: 9 additions & 0 deletions crm_lead_code/data/lead_sequence.xml
@@ -0,0 +1,9 @@
<?xml version="1.0" encoding="UTF-8"?>
<odoo noupdate="1">
<record id="sequence_lead" model="ir.sequence">
<field name="name">Lead Code</field>
<field name="code">crm.lead</field>
<field eval="4" name="padding" />
<field name="prefix">LD</field>
</record>
</odoo>
35 changes: 35 additions & 0 deletions 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 <transbot@odoo-community.org>, 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 <transbot@odoo-community.org>, 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"
"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:16 sql_constraint:crm.lead:0
#, python-format
msgid "The code must be unique!"
msgstr ""
32 changes: 32 additions & 0 deletions 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 12.0\n"
"Report-Msgid-Bugs-To: \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
#: 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:16
#: sql_constraint:crm.lead:0
#, python-format
msgid "The code must be unique!"
msgstr ""

36 changes: 36 additions & 0 deletions crm_lead_code/i18n/de.po
@@ -0,0 +1,36 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * crm_lead_code
#
# Translators:
# OCA Transbot <transbot@odoo-community.org>, 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: 2018-12-13 12:58+0000\n"
"Last-Translator: Maria Sparenberg <maria.sparenberg@gmx.net>\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"
"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 "Lead-Nummer"

#. 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:16 sql_constraint:crm.lead:0
#, python-format
msgid "The code must be unique!"
msgstr "Der Schl??ssel muss eindeutig sein!"
35 changes: 35 additions & 0 deletions crm_lead_code/i18n/es.po
@@ -0,0 +1,35 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * crm_lead_code
#
# Translators:
# OCA Transbot <transbot@odoo-community.org>, 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 <transbot@odoo-community.org>, 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"
"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 "Iniciativa/Oportunidad"

#. module: crm_lead_code
#: code:addons/crm_lead_code/models/crm_lead.py:16 sql_constraint:crm.lead:0
#, python-format
msgid "The code must be unique!"
msgstr ""
35 changes: 35 additions & 0 deletions 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 <transbot@odoo-community.org>, 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 <transbot@odoo-community.org>, 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"
"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:16 sql_constraint:crm.lead:0
#, python-format
msgid "The code must be unique!"
msgstr ""
36 changes: 36 additions & 0 deletions crm_lead_code/i18n/hr.po
@@ -0,0 +1,36 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * crm_lead_code
#
# Translators:
# OCA Transbot <transbot@odoo-community.org>, 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 <transbot@odoo-community.org>, 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"
"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:16 sql_constraint:crm.lead:0
#, python-format
msgid "The code must be unique!"
msgstr ""

0 comments on commit 0f9e8a4

Please sign in to comment.