diff --git a/crm_lead_code/README.rst b/crm_lead_code/README.rst index 4b909bedace..a4f2217a140 100644 --- a/crm_lead_code/README.rst +++ b/crm_lead_code/README.rst @@ -17,13 +17,13 @@ Sequential Code for Leads / Opportunities :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/16.0/crm_lead_code + :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-16-0/crm-16-0-crm_lead_code + :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=16.0 + :target: https://runboat.odoo-community.org/builds?repo=OCA/crm&target_branch=17.0 :alt: Try me on Runboat |badge1| |badge2| |badge3| |badge4| |badge5| @@ -41,7 +41,7 @@ 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 to smash it by providing a detailed and welcomed -`feedback `_. +`feedback `_. Do not contact contributors directly about support or help with technical issues. @@ -49,24 +49,27 @@ Credits ======= Authors -~~~~~~~ +------- * Tecnativa * AvanzOSC Contributors -~~~~~~~~~~~~ +------------ -* Oihane Crucelaegui -* Pedro M. Baeza -* Ana Juaristi -* Nicol??s Ramos -* Mathias Markl -* Serpent Consulting Services Pvt. Ltd. -* Tharathip Chaweewongphan +- Oihane Crucelaegui +- Pedro M. Baeza +- Ana Juaristi +- Nicol??s Ramos +- Mathias Markl +- Serpent Consulting Services Pvt. Ltd. +- Tharathip Chaweewongphan +- `APSL `__: + + - Antoni Marroig Maintainers -~~~~~~~~~~~ +----------- This module is maintained by the OCA. @@ -78,6 +81,6 @@ 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. +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/__init__.py b/crm_lead_code/__init__.py index 690380ddae3..bee186a9ea4 100644 --- a/crm_lead_code/__init__.py +++ b/crm_lead_code/__init__.py @@ -6,18 +6,17 @@ 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 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(cr, registry): - env = api.Environment(cr, SUPERUSER_ID, dict()) +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: - cr.execute( + env.cr.execute( "UPDATE crm_lead SET code = %s WHERE id = %s;", ( sequence_obj.next_by_code("crm.lead"), diff --git a/crm_lead_code/__manifest__.py b/crm_lead_code/__manifest__.py index 6436184c864..94ffb7f812e 100644 --- a/crm_lead_code/__manifest__.py +++ b/crm_lead_code/__manifest__.py @@ -21,7 +21,7 @@ { "name": "Sequential Code for Leads / Opportunities", - "version": "16.0.1.0.1", + "version": "17.0.1.0.1", "category": "Customer Relationship Management", "author": "Tecnativa, AvanzOSC, Odoo Community Association (OCA)", "website": "https://github.com/OCA/crm", diff --git a/crm_lead_code/pyproject.toml b/crm_lead_code/pyproject.toml new file mode 100644 index 00000000000..4231d0cccb3 --- /dev/null +++ b/crm_lead_code/pyproject.toml @@ -0,0 +1,3 @@ +[build-system] +requires = ["whool"] +build-backend = "whool.buildapi" diff --git a/crm_lead_code/readme/CONTRIBUTORS.md b/crm_lead_code/readme/CONTRIBUTORS.md new file mode 100644 index 00000000000..35d710e6b0a --- /dev/null +++ b/crm_lead_code/readme/CONTRIBUTORS.md @@ -0,0 +1,9 @@ +- Oihane Crucelaegui \<\> +- Pedro M. Baeza \<\> +- Ana Juaristi \<\> +- Nicol??s Ramos \<\> +- Mathias Markl \<\> +- Serpent Consulting Services Pvt. Ltd. \<\> +- Tharathip Chaweewongphan \<\> +- [APSL](https://apsl.tech): + - Antoni Marroig diff --git a/crm_lead_code/readme/CONTRIBUTORS.rst b/crm_lead_code/readme/CONTRIBUTORS.rst deleted file mode 100644 index 14f295c4a7b..00000000000 --- a/crm_lead_code/readme/CONTRIBUTORS.rst +++ /dev/null @@ -1,7 +0,0 @@ -* Oihane Crucelaegui -* Pedro M. Baeza -* Ana Juaristi -* Nicol??s Ramos -* Mathias Markl -* Serpent Consulting Services Pvt. Ltd. -* Tharathip Chaweewongphan diff --git a/crm_lead_code/readme/DESCRIPTION.rst b/crm_lead_code/readme/DESCRIPTION.md similarity index 100% rename from crm_lead_code/readme/DESCRIPTION.rst rename to crm_lead_code/readme/DESCRIPTION.md diff --git a/crm_lead_code/static/description/index.html b/crm_lead_code/static/description/index.html index ef0118daa35..a21feb8114c 100644 --- a/crm_lead_code/static/description/index.html +++ b/crm_lead_code/static/description/index.html @@ -369,7 +369,7 @@

Sequential Code for Leads / Opportunities

!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! !! source digest: sha256:6b1831d70969cde994b6ee3974356be5904b671bc7e3b1be703ca116aa8ee1a7 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! --> -

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

+

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

This module adds a sequential code for leads / opportunities.

Table of contents

@@ -388,7 +388,7 @@

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 to smash it by providing a detailed and welcomed -feedback.

+feedback.

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

@@ -410,6 +410,10 @@

Contributors

  • Mathias Markl <mathias.markl@mukit.at>
  • Serpent Consulting Services Pvt. Ltd. <support@serpentcs.com>
  • Tharathip Chaweewongphan <tharathipc@ecosoft.co.th>
  • +
  • APSL:
      +
    • Antoni Marroig
    • +
    +
  • @@ -419,7 +423,7 @@

    Maintainers

    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.

    +

    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/tests/test_crm_lead_code.py b/crm_lead_code/tests/test_crm_lead_code.py index 24fcdd7d364..0fbbc0bdfe1 100644 --- a/crm_lead_code/tests/test_crm_lead_code.py +++ b/crm_lead_code/tests/test_crm_lead_code.py @@ -6,12 +6,13 @@ class TestCrmLeadCode(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") + @classmethod + def setUpClass(cls): + super().setUpClass() + cls.crm_lead_model = cls.env["crm.lead"] + cls.ir_sequence_model = cls.env["ir.sequence"] + cls.crm_sequence = cls.env.ref("crm_lead_code.sequence_lead") + cls.crm_lead = cls.env.ref("crm.crm_case_1") def test_old_lead_code_assign(self): crm_leads = self.crm_lead_model.search([])