Skip to content

Commit

Permalink
Merge PR #529 into 17.0
Browse files Browse the repository at this point in the history
Signed-off-by pedrobaeza
  • Loading branch information
OCA-git-bot committed Nov 24, 2023
2 parents e9c6594 + 8c9ba75 commit 4b4ac09
Show file tree
Hide file tree
Showing 28 changed files with 1,333 additions and 0 deletions.
86 changes: 86 additions & 0 deletions crm_lead_code/README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
=========================================
Sequential Code for Leads / Opportunities
=========================================

..
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! source digest: sha256:6b1831d70969cde994b6ee3974356be5904b671bc7e3b1be703ca116aa8ee1a7
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
.. |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/17.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-17-0/crm-17-0-crm_lead_code
:alt: Translate me on Weblate
.. |badge5| image:: https://img.shields.io/badge/runboat-Try%20me-875A7B.png
:target: https://runboat.odoo-community.org/builds?repo=OCA/crm&target_branch=17.0
:alt: Try me on Runboat

|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 to smash it by providing a detailed and welcomed
`feedback <https://github.com/OCA/crm/issues/new?body=module:%20crm_lead_code%0Aversion:%2017.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 <[email protected]>
- Pedro M. Baeza <[email protected]>
- Ana Juaristi <[email protected]>
- Nicol??s Ramos <[email protected]>
- Mathias Markl <[email protected]>
- Serpent Consulting Services Pvt. Ltd. <[email protected]>
- Tharathip Chaweewongphan <[email protected]>
- `APSL <https://apsl.tech>`__:

- Antoni Marroig

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/17.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
Original file line number Diff line number Diff line change
@@ -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(env):
env.cr.execute("ALTER TABLE crm_lead ADD COLUMN code character varying;")
env.cr.execute("UPDATE crm_lead SET code = id;")


def assign_old_sequences(env):
lead_obj = env["crm.lead"]
sequence_obj = env["ir.sequence"]
leads = lead_obj.search([], order="id")
for lead_id in leads.ids:
env.cr.execute(
"UPDATE crm_lead SET code = %s WHERE id = %s;",
(
sequence_obj.next_by_code("crm.lead"),
lead_id,
),
)
34 changes: 34 additions & 0 deletions crm_lead_code/__manifest__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
##############################################################################
#
# 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": "17.0.1.0.1",
"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",
}
8 changes: 8 additions & 0 deletions crm_lead_code/data/lead_sequence.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,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>
42 changes: 42 additions & 0 deletions crm_lead_code/i18n/bg.po
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * crm_lead_code
#
# Translators:
# OCA Transbot <[email protected]>, 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 <[email protected]>, 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_terms:ir.ui.view,arch_db:crm_lead_code.crm_case_kanban_view_leads_inherit
msgid "&amp;nbsp;"
msgstr ""

#. 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
#. odoo-python
#: 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 ""
40 changes: 40 additions & 0 deletions crm_lead_code/i18n/ca.po
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * crm_lead_code
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 15.0\n"
"Report-Msgid-Bugs-To: \n"
"PO-Revision-Date: 2022-04-13 11:05+0000\n"
"Last-Translator: Noel estudillo <[email protected]>\n"
"Language-Team: none\n"
"Language: ca\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 4.3.2\n"

#. module: crm_lead_code
#: model_terms:ir.ui.view,arch_db:crm_lead_code.crm_case_kanban_view_leads_inherit
msgid "&amp;nbsp;"
msgstr ""

#. module: crm_lead_code
#: model:ir.model.fields,field_description:crm_lead_code.field_crm_lead__code
msgid "Lead Number"
msgstr "Número de plom"

#. module: crm_lead_code
#: model:ir.model,name:crm_lead_code.model_crm_lead
msgid "Lead/Opportunity"
msgstr "Plom/Oportunitat"

#. module: crm_lead_code
#. odoo-python
#: 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 "El codi ha de ser únic!"
37 changes: 37 additions & 0 deletions crm_lead_code/i18n/crm_lead_code.pot
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * crm_lead_code
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 16.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_terms:ir.ui.view,arch_db:crm_lead_code.crm_case_kanban_view_leads_inherit
msgid "&amp;nbsp;"
msgstr ""

#. 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
#. odoo-python
#: 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 ""
43 changes: 43 additions & 0 deletions crm_lead_code/i18n/de.po
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * crm_lead_code
#
# Translators:
# OCA Transbot <[email protected]>, 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 <[email protected]>\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_terms:ir.ui.view,arch_db:crm_lead_code.crm_case_kanban_view_leads_inherit
msgid "&amp;nbsp;"
msgstr ""

#. 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
#. odoo-python
#: 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!"
43 changes: 43 additions & 0 deletions crm_lead_code/i18n/es.po
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * crm_lead_code
#
# Translators:
# OCA Transbot <[email protected]>, 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: 2023-08-02 14:10+0000\n"
"Last-Translator: Ivorra78 <[email protected]>\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"
"X-Generator: Weblate 4.17\n"

#. module: crm_lead_code
#: model_terms:ir.ui.view,arch_db:crm_lead_code.crm_case_kanban_view_leads_inherit
msgid "&amp;nbsp;"
msgstr "&amp;nbsp;"

#. module: crm_lead_code
#: model:ir.model.fields,field_description:crm_lead_code.field_crm_lead__code
msgid "Lead Number"
msgstr "Número de oportunidad"

#. module: crm_lead_code
#: model:ir.model,name:crm_lead_code.model_crm_lead
msgid "Lead/Opportunity"
msgstr "Iniciativa/Oportunidad"

#. module: crm_lead_code
#. odoo-python
#: 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 "El código debe ser único!"
Loading

0 comments on commit 4b4ac09

Please sign in to comment.