Skip to content

Commit

Permalink
[MIG] crm_salesperson_planner: Migration to 17.0
Browse files Browse the repository at this point in the history
  • Loading branch information
BernatObrador authored and HeliconiaSolutions committed Feb 24, 2025
1 parent 1fcd38e commit 7b09367
Show file tree
Hide file tree
Showing 13 changed files with 79 additions and 79 deletions.
6 changes: 5 additions & 1 deletion crm_salesperson_planner/README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ Crm Salesperson Planner
!! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! source digest: sha256:ecb19fb91da66e924c1c305af2c747e5d4eb4610309318733cb67f73d68666ed
!! source digest: sha256:e60d63ff13f06b2c57a2250b60f9f85f8347f43ab93c67910098278f63c31858
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
.. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png
Expand Down Expand Up @@ -100,6 +100,10 @@ Contributors

- Víctor Martínez

- `APSL-Nagarro <https://apsl.tech>`__:

- Bernat Obrador <bobrador@apsl.net>

Maintainers
-----------

Expand Down
2 changes: 1 addition & 1 deletion crm_salesperson_planner/__manifest__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html)
{
"name": "Crm Salesperson Planner",
"version": "16.0.2.0.0",
"version": "17.0.1.0.0",
"development_status": "Beta",
"category": "Customer Relationship Management",
"author": "Sygel Technology," "Odoo Community Association (OCA)",
Expand Down
24 changes: 7 additions & 17 deletions crm_salesperson_planner/i18n/crm_salesperson_planner.pot
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 16.0\n"
"Project-Id-Version: Odoo Server 17.0\n"
"Report-Msgid-Bugs-To: \n"
"Last-Translator: \n"
"Language-Team: \n"
Expand Down Expand Up @@ -77,7 +77,6 @@ msgstr ""

#. module: crm_salesperson_planner
#: model:ir.actions.server,name:crm_salesperson_planner.ir_cron_create_visits_ir_actions_server
#: model:ir.cron,cron_name:crm_salesperson_planner.ir_cron_create_visits
msgid "CRM: Create salesperson visits"
msgstr ""

Expand Down Expand Up @@ -406,15 +405,6 @@ msgstr ""
msgid "Last"
msgstr ""

#. module: crm_salesperson_planner
#: model:ir.model.fields,field_description:crm_salesperson_planner.field_crm_salesperson_planner_visit____last_update
#: model:ir.model.fields,field_description:crm_salesperson_planner.field_crm_salesperson_planner_visit_close_reason____last_update
#: model:ir.model.fields,field_description:crm_salesperson_planner.field_crm_salesperson_planner_visit_close_wiz____last_update
#: model:ir.model.fields,field_description:crm_salesperson_planner.field_crm_salesperson_planner_visit_template____last_update
#: model:ir.model.fields,field_description:crm_salesperson_planner.field_crm_salesperson_planner_visit_template_create____last_update
msgid "Last Modified on"
msgstr ""

#. module: crm_salesperson_planner
#: model:ir.model.fields,field_description:crm_salesperson_planner.field_crm_salesperson_planner_visit__write_uid
#: model:ir.model.fields,field_description:crm_salesperson_planner.field_crm_salesperson_planner_visit_close_reason__write_uid
Expand Down Expand Up @@ -453,12 +443,6 @@ msgstr ""
msgid "Let the event automatically repeat at that interval"
msgstr ""

#. module: crm_salesperson_planner
#: model:ir.model.fields,field_description:crm_salesperson_planner.field_crm_salesperson_planner_visit__message_main_attachment_id
#: model:ir.model.fields,field_description:crm_salesperson_planner.field_crm_salesperson_planner_visit_template__message_main_attachment_id
msgid "Main Attachment"
msgstr ""

#. module: crm_salesperson_planner
#: model_terms:ir.ui.view,arch_db:crm_salesperson_planner.crm_salesperson_planner_visit_template_form_view
msgid "Manually Create Visits"
Expand Down Expand Up @@ -616,6 +600,12 @@ msgstr ""
msgid "Phone"
msgstr ""

#. module: crm_salesperson_planner
#: model:ir.model.fields,field_description:crm_salesperson_planner.field_crm_salesperson_planner_visit__rating_ids
#: model:ir.model.fields,field_description:crm_salesperson_planner.field_crm_salesperson_planner_visit_template__rating_ids
msgid "Ratings"
msgstr ""

#. module: crm_salesperson_planner
#: model:ir.model.fields,field_description:crm_salesperson_planner.field_crm_salesperson_planner_visit_close_wiz__reason_id
msgid "Reason"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ class CrmSalespersonPlannerVisit(models.Model):
string="Visit Number",
required=True,
default="/",
readonly=True,
copy=False,
)
partner_id = fields.Many2one(
Expand Down Expand Up @@ -60,7 +59,6 @@ class CrmSalespersonPlannerVisit(models.Model):
state = fields.Selection(
string="Status",
required=True,
readonly=True,
copy=False,
tracking=True,
selection=[
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ class CrmSalespersonPlannerVisitTemplate(models.Model):
name = fields.Char(
string="Visit Template Number",
default="/",
readonly=True,
copy=False,
)
description = fields.Html()
Expand All @@ -48,7 +47,6 @@ class CrmSalespersonPlannerVisitTemplate(models.Model):
comodel_name="res.partner",
string="Scheduled by",
related="user_id.partner_id",
readonly=True,
)
partner_ids = fields.Many2many(
comodel_name="res.partner",
Expand Down Expand Up @@ -107,7 +105,6 @@ class CrmSalespersonPlannerVisitTemplate(models.Model):
tracking=True,
default=lambda self: fields.Datetime.today() + timedelta(hours=1),
compute="_compute_stop",
readonly=False,
store=True,
help="Stop date of an event, without time for full days events",
)
Expand Down
2 changes: 2 additions & 0 deletions crm_salesperson_planner/readme/CONTRIBUTORS.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,5 @@
- Gerardo Marin Parra \<<info@pesol.es>\>
- [Tecnativa](https://www.tecnativa.com):
- Víctor Martínez
- [APSL-Nagarro](<https://apsl.tech>):
- Bernat Obrador \<<bobrador@apsl.net>\>
6 changes: 5 additions & 1 deletion crm_salesperson_planner/static/description/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -367,7 +367,7 @@ <h1 class="title">Crm Salesperson Planner</h1>
!! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! source digest: sha256:ecb19fb91da66e924c1c305af2c747e5d4eb4610309318733cb67f73d68666ed
!! source digest: sha256:e60d63ff13f06b2c57a2250b60f9f85f8347f43ab93c67910098278f63c31858
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->
<p><a class="reference external image-reference" href="https://odoo-community.org/page/development-status"><img alt="Beta" src="https://img.shields.io/badge/maturity-Beta-yellow.png" /></a> <a class="reference external image-reference" href="http://www.gnu.org/licenses/agpl-3.0-standalone.html"><img alt="License: AGPL-3" src="https://img.shields.io/badge/licence-AGPL--3-blue.png" /></a> <a class="reference external image-reference" href="https://github.com/OCA/crm/tree/17.0/crm_salesperson_planner"><img alt="OCA/crm" src="https://img.shields.io/badge/github-OCA%2Fcrm-lightgray.png?logo=github" /></a> <a class="reference external image-reference" href="https://translation.odoo-community.org/projects/crm-17-0/crm-17-0-crm_salesperson_planner"><img alt="Translate me on Weblate" src="https://img.shields.io/badge/weblate-Translate%20me-F47D42.png" /></a> <a class="reference external image-reference" href="https://runboat.odoo-community.org/builds?repo=OCA/crm&amp;target_branch=17.0"><img alt="Try me on Runboat" src="https://img.shields.io/badge/runboat-Try%20me-875A7B.png" /></a></p>
<p>This application allows you to track and schedule salespeople visits to
Expand Down Expand Up @@ -447,6 +447,10 @@ <h2><a class="toc-backref" href="#toc-entry-6">Contributors</a></h2>
<li>Víctor Martínez</li>
</ul>
</li>
<li><a class="reference external" href="https://apsl.tech">APSL-Nagarro</a>:<ul>
<li>Bernat Obrador &lt;<a class="reference external" href="mailto:bobrador&#64;apsl.net">bobrador&#64;apsl.net</a>&gt;</li>
</ul>
</li>
</ul>
</div>
<div class="section" id="maintainers">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -197,27 +197,33 @@ def test_04_cancel_visit(self):
def test_05_repeat_weeks(self):
self.visit_template_base.write(
{
"start_date": "2024-03-08",
"start_date": fields.Date.today(),
"interval": 1,
"rrule_type": "weekly",
"tue": True,
"end_type": "end_date",
"until": "2024-07-02",
"until": fields.Date.today() + timedelta(days=90),
}
)

dates = [
self.visit_template_base.start_date + timedelta(days=i) for i in range(91)
]
filtered_tue_dates = [d for d in dates if d.weekday() == 1]

self.visit_template_base.action_validate()
self.assertFalse(self.visit_template_base.visit_ids)
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-07-02"})
).create({"date_to": filtered_tue_dates[2]})
create_item.create_visits()
self.assertEqual(self.visit_template_base.state, "done")
visit_dates = self.visit_template_base.visit_ids.mapped("date")
self.assertIn(fields.Date.from_string("2024-03-19"), visit_dates)
self.assertIn(fields.Date.from_string(filtered_tue_dates[4]), visit_dates)
self.assertEqual(
self.visit_template_base.last_visit_date,
fields.Date.from_string("2024-07-02"),
fields.Date.from_string(filtered_tue_dates[len(filtered_tue_dates) - 1]),
)

def test_06_repeat_months_count_01(self):
Expand Down
4 changes: 1 addition & 3 deletions crm_salesperson_planner/views/crm_lead.xml
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,7 @@
<field name="arch" type="xml">
<notebook position="inside">
<page string="Salesperson Visits">
<group>
<field name="crm_salesperson_planner_visit_ids" nolabel="1" />
</group>
<field name="crm_salesperson_planner_visit_ids" nolabel="1" />
</page>
</notebook>
</field>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@
<field name="model">crm.salesperson.planner.visit.template</field>
<field name="arch" type="xml">
<tree>
<field name="name" />
<field name="partner_id" />
<field name="name" readonly="1" />
<field name="partner_id" readonly="1" />
<field name="start_date" />
<field name="sequence" />
<field name="user_id" />
Expand All @@ -28,25 +28,25 @@
name="action_validate"
string="Validate"
type="object"
attrs="{'invisible': [('state', '!=', 'draft')]}"
invisible="state != 'draft'"
/>
<button
name="%(crm_salesperson_planner_visit_template_create_action)d"
string="Manually Create Visits"
type="action"
attrs="{'invisible': [('state', '!=', 'in-progress')]}"
invisible="state != 'in-progress'"
/>
<button
name="action_cancel"
string="Cancel"
type="object"
attrs="{'invisible': [('state', '!=', 'in-progress')]}"
invisible="state != 'in-progress'"
/>
<button
name="action_draft"
string="Send to Draft"
type="object"
attrs="{'invisible': [('state', '!=', 'cancel')]}"
invisible="state != 'cancel'"
/>
<field
name="state"
Expand Down Expand Up @@ -76,11 +76,11 @@
</div>
<group>
<group>
<field name="partner_id" invisible="1" />
<field name="partner_id" invisible="1" readonly="1" />
<field name="partner_ids" widget="many2many_tags" />
<field name="start_date" required="1" />
<field name="start" invisible="1" />
<field name="stop" invisible="1" />
<field name="stop" invisible="1" readonly="1" />
<field name="stop_date" invisible="1" />
<field name="start" invisible="1" />
<field name="sequence" />
Expand Down Expand Up @@ -109,7 +109,7 @@
</div>
<widget
name="week_days"
attrs="{'invisible': [('rrule_type', '!=', 'weekly')]}"
invisible="rrule_type != 'weekly'"
/>
</div>
<label string="Until" for="end_type" />
Expand All @@ -118,31 +118,35 @@
<field
name="count"
required="1"
attrs="{'invisible': [('end_type', '!=', 'count')]}"
invisible="end_type != 'count'"
/>
<field
name="until"
attrs="{'invisible': [('end_type', '!=', 'end_date')], 'required': [('end_type', '=', 'end_date')]}"
invisible="end_type != 'end_date'"
required="end_type == 'end_date'"
/>
</div>
</group>
<group attrs="{'invisible': [('rrule_type', '!=', 'monthly')]}">
<group invisible="rrule_type != 'monthly'">
<label string="Day of Month" for="month_by" />
<div class="o_row">
<field name="month_by" />
<field
name="day"
attrs="{'required': [('month_by', '=', 'date'), ('rrule_type', '=', 'monthly')], 'invisible': [('month_by', '!=', 'date')]}"
required="month_by == 'date' and rrule_type == 'monthly'"
invisible="month_by != 'date'"
/>
<field
name="byday"
string="The"
attrs="{'required': [('month_by', '=', 'day'), ('rrule_type', '=', 'monthly')], 'invisible': [('month_by', '!=', 'day')]}"
required="month_by == 'day' and rrule_type == 'monthly'"
invisible="month_by != 'day'"
/>
<field
name="weekday"
nolabel="1"
attrs="{'required': [('month_by', '=', 'day'), ('rrule_type', '=', 'monthly')], 'invisible': [('month_by', '!=', 'day')]}"
required="month_by == 'day' and rrule_type == 'monthly'"
invisible="month_by != 'day'"
/>
</div>
</group>
Expand Down
Loading

0 comments on commit 7b09367

Please sign in to comment.