From fd3731e7b12c7cfcecb81412af92ed6a13af017f Mon Sep 17 00:00:00 2001 From: Heliconia Solutions Date: Thu, 28 Nov 2024 15:31:23 +0530 Subject: [PATCH] [MIG] crm_salesperson_planner: Migration to 18.0 --- crm_salesperson_planner/README.rst | 35 ++++++++++--------- crm_salesperson_planner/__manifest__.py | 2 +- crm_salesperson_planner/data/ir_cron_data.xml | 2 -- .../models/calendar_event.py | 4 +-- .../models/crm_salesperson_planner_visit.py | 18 ++++++---- .../crm_salesperson_planner_visit_template.py | 4 +-- .../readme/CONTRIBUTORS.md | 3 +- .../static/description/index.html | 10 +++--- .../test_crm_salesperson_planner_visit.py | 6 ++-- ..._crm_salesperson_planner_visit_template.py | 6 ++-- ...erson_planner_visit_close_reason_views.xml | 6 ++-- ...lesperson_planner_visit_template_views.xml | 6 ++-- .../crm_salesperson_planner_visit_views.xml | 22 +++++------- ...crm_salesperson_planner_visit_close_wiz.py | 6 ++-- ...lesperson_planner_visit_template_create.py | 4 +-- 15 files changed, 67 insertions(+), 67 deletions(-) diff --git a/crm_salesperson_planner/README.rst b/crm_salesperson_planner/README.rst index f6ebe07d2af..bba19c80b3b 100644 --- a/crm_salesperson_planner/README.rst +++ b/crm_salesperson_planner/README.rst @@ -17,13 +17,13 @@ Crm Salesperson Planner :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_salesperson_planner + :target: https://github.com/OCA/crm/tree/18.0/crm_salesperson_planner :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_salesperson_planner + :target: https://translation.odoo-community.org/projects/crm-18-0/crm-18-0-crm_salesperson_planner :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 + :target: https://runboat.odoo-community.org/builds?repo=OCA/crm&target_branch=18.0 :alt: Try me on Runboat |badge1| |badge2| |badge3| |badge4| |badge5| @@ -49,9 +49,8 @@ Configuration To configure this module, you need to: -- Go to new menu **CRM > Configuration > Salesperson Planner > Close - Reasons** and create a close reason for 'Cancel' and 'Incident' - types. +- Go to new menu **CRM > Configuration > Salesperson Planner > Close + Reasons** and create a close reason for 'Cancel' and 'Incident' types. Usage ===== @@ -72,7 +71,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. @@ -87,22 +86,24 @@ Authors Contributors ------------ -- `Sygel `__: +- `Sygel `__: - - Valentin Vinagre - - Manuel Regidor + - Valentin Vinagre + - Manuel Regidor -- `Pesol `__: +- `Pesol `__: - - Gerardo Marin Parra + - Gerardo Marin Parra -- `Tecnativa `__: +- `Tecnativa `__: - - Víctor Martínez + - Víctor Martínez -- `APSL-Nagarro `__: +- `APSL-Nagarro `__: - - Bernat Obrador + - Bernat Obrador + +- Heliconia Solutions Pvt. Ltd. Maintainers ----------- @@ -117,6 +118,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_salesperson_planner/__manifest__.py b/crm_salesperson_planner/__manifest__.py index fa9bd94e537..3ff72ed3a82 100644 --- a/crm_salesperson_planner/__manifest__.py +++ b/crm_salesperson_planner/__manifest__.py @@ -2,7 +2,7 @@ # License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html) { "name": "Crm Salesperson Planner", - "version": "17.0.1.0.0", + "version": "18.0.1.0.0", "development_status": "Beta", "category": "Customer Relationship Management", "author": "Sygel Technology," "Odoo Community Association (OCA)", diff --git a/crm_salesperson_planner/data/ir_cron_data.xml b/crm_salesperson_planner/data/ir_cron_data.xml index c9bd2385f89..6e10c76c319 100644 --- a/crm_salesperson_planner/data/ir_cron_data.xml +++ b/crm_salesperson_planner/data/ir_cron_data.xml @@ -6,8 +6,6 @@ CRM: Create salesperson visits 1 days - -1 - model._cron_create_visits(days=7) code diff --git a/crm_salesperson_planner/models/calendar_event.py b/crm_salesperson_planner/models/calendar_event.py index 102d7bc1f88..23262c1dcff 100644 --- a/crm_salesperson_planner/models/calendar_event.py +++ b/crm_salesperson_planner/models/calendar_event.py @@ -1,7 +1,7 @@ # Copyright 2021 Sygel - Manuel Regidor # License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html) -from odoo import _, fields, models +from odoo import fields, models from odoo.exceptions import ValidationError @@ -46,7 +46,7 @@ def unlink(self): if salesperson_visit_events: error_msg = "" for event in salesperson_visit_events: - error_msg += _( + error_msg += self.env._( "Event %(event_name)s is related to salesperson visit " "%(partner_name)s. Cancel it to delete this event.\n" ) % { diff --git a/crm_salesperson_planner/models/crm_salesperson_planner_visit.py b/crm_salesperson_planner/models/crm_salesperson_planner_visit.py index d6737a30a86..d1f7ebf5319 100644 --- a/crm_salesperson_planner/models/crm_salesperson_planner_visit.py +++ b/crm_salesperson_planner/models/crm_salesperson_planner_visit.py @@ -2,7 +2,7 @@ # Copyright 2021 Sygel - Manuel Regidor # License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html) -from odoo import _, api, fields, models +from odoo import api, fields, models from odoo.exceptions import ValidationError @@ -102,7 +102,7 @@ def create(self, vals_list): def action_draft(self): if self.state not in ["cancel", "incident", "done"]: raise ValidationError( - _("The visit must be in cancelled, incident or visited state") + self.env._("The visit must be in cancelled, incident or visited state") ) if self.calendar_event_id: self.calendar_event_id.with_context(bypass_cancel_visit=True).unlink() @@ -110,19 +110,21 @@ def action_draft(self): def action_confirm(self): if self.filtered(lambda a: not a.state == "draft"): - raise ValidationError(_("The visit must be in draft state")) + raise ValidationError(self.env._("The visit must be in draft state")) events = self.create_calendar_event() if events: self.browse(events.mapped("res_id")).write({"state": "confirm"}) def action_done(self): if not self.state == "confirm": - raise ValidationError(_("The visit must be in confirmed state")) + raise ValidationError(self.env._("The visit must be in confirmed state")) self.write({"state": "done"}) def action_cancel(self, reason_id, image=None, notes=None): if self.state not in ["draft", "confirm"]: - raise ValidationError(_("The visit must be in draft or validated state")) + raise ValidationError( + self.env._("The visit must be in draft or validated state") + ) if self.calendar_event_id: self.calendar_event_id.with_context(bypass_cancel_visit=True).unlink() self.write( @@ -165,7 +167,9 @@ def create_calendar_event(self): def action_incident(self, reason_id, image=None, notes=None): if self.state not in ["draft", "confirm"]: - raise ValidationError(_("The visit must be in draft or validated state")) + raise ValidationError( + self.env._("The visit must be in draft or validated state") + ) self.write( { "state": "incident", @@ -177,7 +181,7 @@ def action_incident(self, reason_id, image=None, notes=None): def unlink(self): if any(sel.state not in ["draft", "cancel"] for sel in self): - raise ValidationError(_("Visits must be in cancelled state")) + raise ValidationError(self.env._("Visits must be in cancelled state")) return super().unlink() def write(self, values): diff --git a/crm_salesperson_planner/models/crm_salesperson_planner_visit_template.py b/crm_salesperson_planner/models/crm_salesperson_planner_visit_template.py index 5d01c14c2e6..6e27999daac 100644 --- a/crm_salesperson_planner/models/crm_salesperson_planner_visit_template.py +++ b/crm_salesperson_planner/models/crm_salesperson_planner_visit_template.py @@ -5,7 +5,7 @@ from datetime import timedelta -from odoo import _, api, fields, models +from odoo import api, fields, models from odoo.exceptions import ValidationError from odoo.addons.base.models.res_partner import _tz_get @@ -228,7 +228,7 @@ def _inverse_dates(self): def _constrains_partner_ids(self): for item in self: if len(item.partner_ids) > 1: - raise ValidationError(_("Only one customer is allowed")) + raise ValidationError(self.env._("Only one customer is allowed")) @api.onchange("end_type") def _onchange_end_type(self): diff --git a/crm_salesperson_planner/readme/CONTRIBUTORS.md b/crm_salesperson_planner/readme/CONTRIBUTORS.md index 92fef5d95e7..9d48345c5c3 100644 --- a/crm_salesperson_planner/readme/CONTRIBUTORS.md +++ b/crm_salesperson_planner/readme/CONTRIBUTORS.md @@ -6,4 +6,5 @@ - [Tecnativa](https://www.tecnativa.com): - Víctor Martínez - [APSL-Nagarro](): - - Bernat Obrador \<\> \ No newline at end of file + - Bernat Obrador \<\> +- Heliconia Solutions Pvt. Ltd. \<\> diff --git a/crm_salesperson_planner/static/description/index.html b/crm_salesperson_planner/static/description/index.html index 18083c87c19..d82840e4e20 100644 --- a/crm_salesperson_planner/static/description/index.html +++ b/crm_salesperson_planner/static/description/index.html @@ -369,7 +369,7 @@

Crm Salesperson Planner

!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! !! source digest: sha256:e60d63ff13f06b2c57a2250b60f9f85f8347f43ab93c67910098278f63c31858 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! --> -

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 application allows you to track and schedule salespeople visits to your customers, allowing you to determine which opportunities are going to be dealt on each visit. Visits create an all day event in calendar, @@ -399,8 +399,7 @@

Configuration

To configure this module, you need to:

  • Go to new menu CRM > Configuration > Salesperson Planner > Close -Reasons and create a close reason for ‘Cancel’ and ‘Incident’ -types.
  • +Reasons and create a close reason for ‘Cancel’ and ‘Incident’ types.
@@ -420,7 +419,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.

@@ -451,6 +450,7 @@

Contributors

  • Bernat Obrador <bobrador@apsl.net>
  • +
  • Heliconia Solutions Pvt. Ltd. <https://www.heliconia.io>
  • @@ -462,7 +462,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_salesperson_planner/tests/test_crm_salesperson_planner_visit.py b/crm_salesperson_planner/tests/test_crm_salesperson_planner_visit.py index 2de9d090996..7f93d8e37a1 100644 --- a/crm_salesperson_planner/tests/test_crm_salesperson_planner_visit.py +++ b/crm_salesperson_planner/tests/test_crm_salesperson_planner_visit.py @@ -5,7 +5,7 @@ from dateutil.relativedelta import relativedelta -from odoo import _, fields +from odoo import fields from odoo.exceptions import ValidationError from odoo.tests import common from odoo.tools import mute_logger @@ -228,7 +228,7 @@ def test_action_view_salesperson_planner_visit(self): self.assertEqual(action["domain"], [("partner_id", "child_of", partner.id)]) self.assertEqual(action["res_model"], "crm.salesperson.planner.visit") - self.assertIn("tree", action["view_mode"]) + self.assertIn("list", action["view_mode"]) self.assertIn("form", action["view_mode"]) self.assertIn("pivot", action["view_mode"]) @@ -260,7 +260,7 @@ def test_partner_ids_constraint(self): (0, 0, {"name": "Customer 3"}), ] - error_msg = _("Only one customer is allowed") + error_msg = self.env._("Only one customer is allowed") self.assertEqual(str(context.exception), error_msg) def test_action_view_salesperson_planner_visit(self): diff --git a/crm_salesperson_planner/tests/test_crm_salesperson_planner_visit_template.py b/crm_salesperson_planner/tests/test_crm_salesperson_planner_visit_template.py index c1109e92833..b6996a3b918 100644 --- a/crm_salesperson_planner/tests/test_crm_salesperson_planner_visit_template.py +++ b/crm_salesperson_planner/tests/test_crm_salesperson_planner_visit_template.py @@ -243,7 +243,7 @@ def test_06_repeat_months_count_01(self): create_model = self.env["crm.salesperson.planner.visit.template.create"] create_item = create_model.with_context( active_id=self.visit_template_base.id - ).create({"date_to": "2024-12-13"}) + ).create({"date_to": "2025-01-13"}) create_item.create_visits() self.assertEqual(self.visit_template_base.state, "done") self.assertEqual(len(self.visit_template_base.visit_ids), 2) @@ -271,7 +271,7 @@ def test_06_repeat_months_count_02(self): create_model = self.env["crm.salesperson.planner.visit.template.create"] create_item = create_model.with_context( active_id=self.visit_template_base.id - ).create({"date_to": "2024-12-13"}) + ).create({"date_to": "2025-01-13"}) create_item.create_visits() self.assertEqual(self.visit_template_base.state, "done") self.assertEqual(len(self.visit_template_base.visit_ids), 2) @@ -300,7 +300,7 @@ def test_06_repeat_months_count_03(self): create_model = self.env["crm.salesperson.planner.visit.template.create"] create_item = create_model.with_context( active_id=self.visit_template_base.id - ).create({"date_to": "2024-12-13"}) + ).create({"date_to": "2025-01-13"}) create_item.create_visits() self.assertEqual(self.visit_template_base.state, "done") self.assertEqual(len(self.visit_template_base.visit_ids), 2) diff --git a/crm_salesperson_planner/views/crm_salesperson_planner_visit_close_reason_views.xml b/crm_salesperson_planner/views/crm_salesperson_planner_visit_close_reason_views.xml index 765c09bbafb..ff9335ab1bd 100644 --- a/crm_salesperson_planner/views/crm_salesperson_planner_visit_close_reason_views.xml +++ b/crm_salesperson_planner/views/crm_salesperson_planner_visit_close_reason_views.xml @@ -9,12 +9,12 @@ CRM - Salesperson Planner Visit Close Reason Tree crm.salesperson.planner.visit.close.reason - + - + Close Reasons crm.salesperson.planner.visit.close.reason - tree,form + list,form

    Record reason for close commercial visits. diff --git a/crm_salesperson_planner/views/crm_salesperson_planner_visit_template_views.xml b/crm_salesperson_planner/views/crm_salesperson_planner_visit_template_views.xml index b4dcc670a80..d7e9dfcceda 100644 --- a/crm_salesperson_planner/views/crm_salesperson_planner_visit_template_views.xml +++ b/crm_salesperson_planner/views/crm_salesperson_planner_visit_template_views.xml @@ -7,7 +7,7 @@ CRM - Salesperson Planner Visit Template Tree crm.salesperson.planner.visit.template - + @@ -15,7 +15,7 @@ - + @@ -166,7 +166,7 @@ > Visit Templates crm.salesperson.planner.visit.template - tree,form + list,form

    Create and plan commercial visit templates diff --git a/crm_salesperson_planner/views/crm_salesperson_planner_visit_views.xml b/crm_salesperson_planner/views/crm_salesperson_planner_visit_views.xml index dd76f3310c6..32ad73eb4ea 100644 --- a/crm_salesperson_planner/views/crm_salesperson_planner_visit_views.xml +++ b/crm_salesperson_planner/views/crm_salesperson_planner_visit_views.xml @@ -6,7 +6,7 @@ CRM - Salesperson Planner Visit Tree crm.salesperson.planner.visit -