Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ addon | version | maintainers | summary
[crm_lead_currency](crm_lead_currency/) | 18.0.1.0.0 | <a href='https://github.com/luisg123v'><img src='https://github.com/luisg123v.png' width='32' height='32' style='border-radius:50%;' alt='luisg123v'/></a> | On leads/opportunities, add the amount in the customer's currency.
[crm_lead_firstname](crm_lead_firstname/) | 18.0.1.0.0 | | Specify split names for contacts in leads
[crm_lead_product](crm_lead_product/) | 18.0.1.0.1 | | Adds a lead line in the lead/opportunity model in odoo
[crm_lead_to_task](crm_lead_to_task/) | 18.0.1.1.0 | | Create Tasks from Leads/Opportunities
[crm_lead_to_task](crm_lead_to_task/) | 18.0.1.1.1 | | Create Tasks from Leads/Opportunities
[crm_lead_vat](crm_lead_vat/) | 18.0.1.0.0 | <a href='https://github.com/EmilioPascual'><img src='https://github.com/EmilioPascual.png' width='32' height='32' style='border-radius:50%;' alt='EmilioPascual'/></a> | Add VAT field to leads
[crm_location](crm_location/) | 18.0.1.0.1 | | CRM location
[crm_partner_assign](crm_partner_assign/) | 18.0.1.0.0 | <a href='https://github.com/Shide'><img src='https://github.com/Shide.png' width='32' height='32' style='border-radius:50%;' alt='Shide'/></a> | Assign a Partner to an Opportunity/Lead/Partner to indicate Partnership
Expand Down
2 changes: 1 addition & 1 deletion crm_lead_to_task/README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ Lead to Task
!! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! source digest: sha256:8c57d1a9a028a904af0b573159693f33a7d05faaefc292afeb1924cfab88c042
!! source digest: sha256:ab2655870e409a1c9e5279f0684407537b10ff81f3b7e3fcdf45b0577d8477d6
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

.. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png
Expand Down
2 changes: 1 addition & 1 deletion crm_lead_to_task/__manifest__.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
"author": "Odoo S.A., Odoo Community Association (OCA), Tecnativa",
"website": "https://github.com/OCA/crm",
"depends": ["crm", "project"],
"version": "18.0.1.1.0",
"version": "18.0.1.1.1",
"license": "LGPL-3",
"installable": True,
"data": [
Expand Down
16 changes: 8 additions & 8 deletions crm_lead_to_task/models/crm_lead.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,14 +51,14 @@ def _create_task_from_lead(self, project):
task = self.env["project.task"].create(vals)

# Move mail thread + attachments
self.message_change_thread(task)

self.env["ir.attachment"].search(
[
("res_model", "=", "crm.lead"),
("res_id", "=", self.id),
]
).write({"res_model": "project.task", "res_id": task.id})
if self.company_id.crm_archive_lead_on_convert:
self.message_change_thread(task)
self.env["ir.attachment"].search(
[
("res_model", "=", "crm.lead"),
("res_id", "=", self.id),
]
).write({"res_model": "project.task", "res_id": task.id})

return task

Expand Down
2 changes: 1 addition & 1 deletion crm_lead_to_task/static/description/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -372,7 +372,7 @@ <h1>Lead to Task</h1>
!! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! source digest: sha256:8c57d1a9a028a904af0b573159693f33a7d05faaefc292afeb1924cfab88c042
!! source digest: sha256:ab2655870e409a1c9e5279f0684407537b10ff81f3b7e3fcdf45b0577d8477d6
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->
<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/lgpl-3.0-standalone.html"><img alt="License: LGPL-3" src="https://img.shields.io/badge/license-LGPL--3-blue.png" /></a> <a class="reference external image-reference" href="https://github.com/OCA/crm/tree/18.0/crm_lead_to_task"><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-18-0/crm-18-0-crm_lead_to_task"><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=18.0"><img alt="Try me on Runboat" src="https://img.shields.io/badge/runboat-Try%20me-875A7B.png" /></a></p>
<p>This module allows you to convert leads or opportunities into project
Expand Down
71 changes: 71 additions & 0 deletions crm_lead_to_task/tests/test_crm_lead_task.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,19 @@ def test_action_view_leads(self):
self.assertEqual(action["name"], _("Lead: %s") % self.lead.name)

def test_create_task_from_lead(self):
"""Test task creation without archiving (no thread/attachment transfer)"""
self.lead.company_id.crm_archive_lead_on_convert = False

# Create an attachment to verify it's not moved
attachment = self.env["ir.attachment"].create(
{
"name": "Attach1",
"datas": "bWlncmF0aW9uIHRlc3Q=",
"res_model": "crm.lead",
"res_id": self.lead.id,
}
)

task = self.lead._create_task_from_lead(self.project)

self.assertEqual(task.name, self.lead.name)
Expand All @@ -73,7 +86,37 @@ def test_create_task_from_lead(self):
self.assertEqual(task.lead_id, self.lead)
self.assertIn(task, self.lead.task_ids)

# Verify attachment was not moved
attachment.invalidate_recordset()
self.assertEqual(attachment.res_model, "crm.lead")
self.assertEqual(attachment.res_id, self.lead.id)

def test_create_task_from_lead_with_archive(self):
"""Test task creation with archiving moves messages and attachments"""
self.lead.company_id.crm_archive_lead_on_convert = True

# Create an attachment on the lead
attachment = self.env["ir.attachment"].create(
{
"name": "Attach2",
"datas": "bWlncmF0aW9uIHRlc3Q=",
"res_model": "crm.lead",
"res_id": self.lead.id,
}
)

task = self.lead._create_task_from_lead(self.project)
self.assertEqual(task.lead_id, self.lead)

# Verify attachment was moved to task
attachment.invalidate_recordset()
self.assertEqual(attachment.res_model, "project.task")
self.assertEqual(attachment.res_id, task.id)

def test_action_create_and_open_task(self):
"""Test action create and open task without archiving"""
self.lead.company_id.crm_archive_lead_on_convert = False

action = self.lead._action_create_and_open_task(self.project)

self.assertEqual(action["type"], "ir.actions.act_window")
Expand All @@ -85,3 +128,31 @@ def test_action_create_and_open_task(self):
self.assertEqual(
action["view_id"], self.lead.env.ref("project.view_task_form2").id
)

def test_action_create_and_open_task_with_archive(self):
"""Test action create and open task with archiving and thread transfer"""
self.lead.company_id.crm_archive_lead_on_convert = True

# Create an attachment to verify thread transfer
attachment = self.env["ir.attachment"].create(
{
"name": "Attach3",
"datas": "bWlncmF0aW9uIHRlc3Q=",
"res_model": "crm.lead",
"res_id": self.lead.id,
}
)
action = self.lead._action_create_and_open_task(self.project)

# Verify action structure
self.assertEqual(action["type"], "ir.actions.act_window")
self.assertEqual(action["res_model"], "project.task")
self.assertTrue(action["res_id"])

# Lead should be archived
self.assertFalse(self.lead.active)

# Attachment should be moved to task
attachment.invalidate_recordset()
self.assertEqual(attachment.res_model, "project.task")
self.assertEqual(attachment.res_id, action["res_id"])
2 changes: 1 addition & 1 deletion crm_phonecall/i18n/am.po
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ msgstr ""
#. module: crm_phonecall
#: model:ir.model.fields,help:crm_phonecall.field_crm_phonecall__partner_state
msgid ""
"Administrative divisions of a country. E.g. Fed. State, Departement, Canton"
"Administrative divisions of a country. E.g. Fed. State, Department, Canton"
msgstr ""

#. module: crm_phonecall
Expand Down
2 changes: 1 addition & 1 deletion crm_phonecall/i18n/ar.po
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ msgstr ""
#. module: crm_phonecall
#: model:ir.model.fields,help:crm_phonecall.field_crm_phonecall__partner_state
msgid ""
"Administrative divisions of a country. E.g. Fed. State, Departement, Canton"
"Administrative divisions of a country. E.g. Fed. State, Department, Canton"
msgstr ""

#. module: crm_phonecall
Expand Down
2 changes: 1 addition & 1 deletion crm_phonecall/i18n/bg.po
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ msgstr ""
#. module: crm_phonecall
#: model:ir.model.fields,help:crm_phonecall.field_crm_phonecall__partner_state
msgid ""
"Administrative divisions of a country. E.g. Fed. State, Departement, Canton"
"Administrative divisions of a country. E.g. Fed. State, Department, Canton"
msgstr ""

#. module: crm_phonecall
Expand Down
2 changes: 1 addition & 1 deletion crm_phonecall/i18n/bs.po
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ msgstr ""
#. module: crm_phonecall
#: model:ir.model.fields,help:crm_phonecall.field_crm_phonecall__partner_state
msgid ""
"Administrative divisions of a country. E.g. Fed. State, Departement, Canton"
"Administrative divisions of a country. E.g. Fed. State, Department, Canton"
msgstr ""

#. module: crm_phonecall
Expand Down
2 changes: 1 addition & 1 deletion crm_phonecall/i18n/ca.po
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ msgstr "Informació addicional"
#. module: crm_phonecall
#: model:ir.model.fields,help:crm_phonecall.field_crm_phonecall__partner_state
msgid ""
"Administrative divisions of a country. E.g. Fed. State, Departement, Canton"
"Administrative divisions of a country. E.g. Fed. State, Department, Canton"
msgstr ""

#. module: crm_phonecall
Expand Down
2 changes: 1 addition & 1 deletion crm_phonecall/i18n/cs.po
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ msgstr ""
#. module: crm_phonecall
#: model:ir.model.fields,help:crm_phonecall.field_crm_phonecall__partner_state
msgid ""
"Administrative divisions of a country. E.g. Fed. State, Departement, Canton"
"Administrative divisions of a country. E.g. Fed. State, Department, Canton"
msgstr ""

#. module: crm_phonecall
Expand Down
2 changes: 1 addition & 1 deletion crm_phonecall/i18n/da.po
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ msgstr ""
#. module: crm_phonecall
#: model:ir.model.fields,help:crm_phonecall.field_crm_phonecall__partner_state
msgid ""
"Administrative divisions of a country. E.g. Fed. State, Departement, Canton"
"Administrative divisions of a country. E.g. Fed. State, Department, Canton"
msgstr ""

#. module: crm_phonecall
Expand Down
2 changes: 1 addition & 1 deletion crm_phonecall/i18n/de.po
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ msgstr "Weitere Informationen"
#. module: crm_phonecall
#: model:ir.model.fields,help:crm_phonecall.field_crm_phonecall__partner_state
msgid ""
"Administrative divisions of a country. E.g. Fed. State, Departement, Canton"
"Administrative divisions of a country. E.g. Fed. State, Department, Canton"
msgstr ""

#. module: crm_phonecall
Expand Down
2 changes: 1 addition & 1 deletion crm_phonecall/i18n/el_GR.po
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ msgstr ""
#. module: crm_phonecall
#: model:ir.model.fields,help:crm_phonecall.field_crm_phonecall__partner_state
msgid ""
"Administrative divisions of a country. E.g. Fed. State, Departement, Canton"
"Administrative divisions of a country. E.g. Fed. State, Department, Canton"
msgstr ""

#. module: crm_phonecall
Expand Down
2 changes: 1 addition & 1 deletion crm_phonecall/i18n/en_GB.po
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ msgstr ""
#. module: crm_phonecall
#: model:ir.model.fields,help:crm_phonecall.field_crm_phonecall__partner_state
msgid ""
"Administrative divisions of a country. E.g. Fed. State, Departement, Canton"
"Administrative divisions of a country. E.g. Fed. State, Department, Canton"
msgstr ""

#. module: crm_phonecall
Expand Down
2 changes: 1 addition & 1 deletion crm_phonecall/i18n/es.po
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ msgstr "Información adicional"
#. module: crm_phonecall
#: model:ir.model.fields,help:crm_phonecall.field_crm_phonecall__partner_state
msgid ""
"Administrative divisions of a country. E.g. Fed. State, Departement, Canton"
"Administrative divisions of a country. E.g. Fed. State, Department, Canton"
msgstr ""

#. module: crm_phonecall
Expand Down
2 changes: 1 addition & 1 deletion crm_phonecall/i18n/es_AR.po
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ msgstr "Información Adicional"
#. module: crm_phonecall
#: model:ir.model.fields,help:crm_phonecall.field_crm_phonecall__partner_state
msgid ""
"Administrative divisions of a country. E.g. Fed. State, Departement, Canton"
"Administrative divisions of a country. E.g. Fed. State, Department, Canton"
msgstr ""

#. module: crm_phonecall
Expand Down
2 changes: 1 addition & 1 deletion crm_phonecall/i18n/es_CL.po
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ msgstr ""
#. module: crm_phonecall
#: model:ir.model.fields,help:crm_phonecall.field_crm_phonecall__partner_state
msgid ""
"Administrative divisions of a country. E.g. Fed. State, Departement, Canton"
"Administrative divisions of a country. E.g. Fed. State, Department, Canton"
msgstr ""

#. module: crm_phonecall
Expand Down
2 changes: 1 addition & 1 deletion crm_phonecall/i18n/es_CO.po
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ msgstr ""
#. module: crm_phonecall
#: model:ir.model.fields,help:crm_phonecall.field_crm_phonecall__partner_state
msgid ""
"Administrative divisions of a country. E.g. Fed. State, Departement, Canton"
"Administrative divisions of a country. E.g. Fed. State, Department, Canton"
msgstr ""

#. module: crm_phonecall
Expand Down
2 changes: 1 addition & 1 deletion crm_phonecall/i18n/es_CR.po
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ msgstr ""
#. module: crm_phonecall
#: model:ir.model.fields,help:crm_phonecall.field_crm_phonecall__partner_state
msgid ""
"Administrative divisions of a country. E.g. Fed. State, Departement, Canton"
"Administrative divisions of a country. E.g. Fed. State, Department, Canton"
msgstr ""

#. module: crm_phonecall
Expand Down
2 changes: 1 addition & 1 deletion crm_phonecall/i18n/es_DO.po
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ msgstr ""
#. module: crm_phonecall
#: model:ir.model.fields,help:crm_phonecall.field_crm_phonecall__partner_state
msgid ""
"Administrative divisions of a country. E.g. Fed. State, Departement, Canton"
"Administrative divisions of a country. E.g. Fed. State, Department, Canton"
msgstr ""

#. module: crm_phonecall
Expand Down
2 changes: 1 addition & 1 deletion crm_phonecall/i18n/es_EC.po
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ msgstr ""
#. module: crm_phonecall
#: model:ir.model.fields,help:crm_phonecall.field_crm_phonecall__partner_state
msgid ""
"Administrative divisions of a country. E.g. Fed. State, Departement, Canton"
"Administrative divisions of a country. E.g. Fed. State, Department, Canton"
msgstr ""

#. module: crm_phonecall
Expand Down
2 changes: 1 addition & 1 deletion crm_phonecall/i18n/es_ES.po
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ msgstr ""
#. module: crm_phonecall
#: model:ir.model.fields,help:crm_phonecall.field_crm_phonecall__partner_state
msgid ""
"Administrative divisions of a country. E.g. Fed. State, Departement, Canton"
"Administrative divisions of a country. E.g. Fed. State, Department, Canton"
msgstr ""

#. module: crm_phonecall
Expand Down
2 changes: 1 addition & 1 deletion crm_phonecall/i18n/es_MX.po
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ msgstr ""
#. module: crm_phonecall
#: model:ir.model.fields,help:crm_phonecall.field_crm_phonecall__partner_state
msgid ""
"Administrative divisions of a country. E.g. Fed. State, Departement, Canton"
"Administrative divisions of a country. E.g. Fed. State, Department, Canton"
msgstr ""

#. module: crm_phonecall
Expand Down
2 changes: 1 addition & 1 deletion crm_phonecall/i18n/es_PE.po
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ msgstr ""
#. module: crm_phonecall
#: model:ir.model.fields,help:crm_phonecall.field_crm_phonecall__partner_state
msgid ""
"Administrative divisions of a country. E.g. Fed. State, Departement, Canton"
"Administrative divisions of a country. E.g. Fed. State, Department, Canton"
msgstr ""

#. module: crm_phonecall
Expand Down
2 changes: 1 addition & 1 deletion crm_phonecall/i18n/es_PY.po
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ msgstr ""
#. module: crm_phonecall
#: model:ir.model.fields,help:crm_phonecall.field_crm_phonecall__partner_state
msgid ""
"Administrative divisions of a country. E.g. Fed. State, Departement, Canton"
"Administrative divisions of a country. E.g. Fed. State, Department, Canton"
msgstr ""

#. module: crm_phonecall
Expand Down
2 changes: 1 addition & 1 deletion crm_phonecall/i18n/es_VE.po
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ msgstr ""
#. module: crm_phonecall
#: model:ir.model.fields,help:crm_phonecall.field_crm_phonecall__partner_state
msgid ""
"Administrative divisions of a country. E.g. Fed. State, Departement, Canton"
"Administrative divisions of a country. E.g. Fed. State, Department, Canton"
msgstr ""

#. module: crm_phonecall
Expand Down
2 changes: 1 addition & 1 deletion crm_phonecall/i18n/et.po
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ msgstr ""
#. module: crm_phonecall
#: model:ir.model.fields,help:crm_phonecall.field_crm_phonecall__partner_state
msgid ""
"Administrative divisions of a country. E.g. Fed. State, Departement, Canton"
"Administrative divisions of a country. E.g. Fed. State, Department, Canton"
msgstr ""

#. module: crm_phonecall
Expand Down
2 changes: 1 addition & 1 deletion crm_phonecall/i18n/eu.po
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ msgstr ""
#. module: crm_phonecall
#: model:ir.model.fields,help:crm_phonecall.field_crm_phonecall__partner_state
msgid ""
"Administrative divisions of a country. E.g. Fed. State, Departement, Canton"
"Administrative divisions of a country. E.g. Fed. State, Department, Canton"
msgstr ""

#. module: crm_phonecall
Expand Down
2 changes: 1 addition & 1 deletion crm_phonecall/i18n/fa.po
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ msgstr ""
#. module: crm_phonecall
#: model:ir.model.fields,help:crm_phonecall.field_crm_phonecall__partner_state
msgid ""
"Administrative divisions of a country. E.g. Fed. State, Departement, Canton"
"Administrative divisions of a country. E.g. Fed. State, Department, Canton"
msgstr ""

#. module: crm_phonecall
Expand Down
2 changes: 1 addition & 1 deletion crm_phonecall/i18n/fi.po
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ msgstr ""
#. module: crm_phonecall
#: model:ir.model.fields,help:crm_phonecall.field_crm_phonecall__partner_state
msgid ""
"Administrative divisions of a country. E.g. Fed. State, Departement, Canton"
"Administrative divisions of a country. E.g. Fed. State, Department, Canton"
msgstr ""

#. module: crm_phonecall
Expand Down
2 changes: 1 addition & 1 deletion crm_phonecall/i18n/fr.po
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ msgstr ""
#. module: crm_phonecall
#: model:ir.model.fields,help:crm_phonecall.field_crm_phonecall__partner_state
msgid ""
"Administrative divisions of a country. E.g. Fed. State, Departement, Canton"
"Administrative divisions of a country. E.g. Fed. State, Department, Canton"
msgstr ""

#. module: crm_phonecall
Expand Down
Loading
Loading