Skip to content

Commit c14f9e9

Browse files
[ADD] crm_lead_phone_secondary
1 parent 795dc0f commit c14f9e9

File tree

11 files changed

+626
-0
lines changed

11 files changed

+626
-0
lines changed
Lines changed: 77 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,77 @@
1+
.. image:: https://odoo-community.org/readme-banner-image
2+
:target: https://odoo-community.org/get-involved?utm_source=readme
3+
:alt: Odoo Community Association
4+
5+
===============================
6+
Secondary phone number on leads
7+
===============================
8+
9+
..
10+
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
11+
!! This file is generated by oca-gen-addon-readme !!
12+
!! changes will be overwritten. !!
13+
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
14+
!! source digest: sha256:61c2b7c02507cc19dd58043a349d386e1292998041430f63f5270adbe1761b84
15+
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
16+
17+
.. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png
18+
:target: https://odoo-community.org/page/development-status
19+
:alt: Beta
20+
.. |badge2| image:: https://img.shields.io/badge/license-AGPL--3-blue.png
21+
:target: http://www.gnu.org/licenses/agpl-3.0-standalone.html
22+
:alt: License: AGPL-3
23+
.. |badge3| image:: https://img.shields.io/badge/github-OCA%2Fpartner--contact-lightgray.png?logo=github
24+
:target: https://github.com/OCA/partner-contact/tree/19.0/crm_lead_phone_secondary
25+
:alt: OCA/partner-contact
26+
.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png
27+
:target: https://translation.odoo-community.org/projects/partner-contact-19-0/partner-contact-19-0-crm_lead_phone_secondary
28+
:alt: Translate me on Weblate
29+
.. |badge5| image:: https://img.shields.io/badge/runboat-Try%20me-875A7B.png
30+
:target: https://runboat.odoo-community.org/builds?repo=OCA/partner-contact&target_branch=19.0
31+
:alt: Try me on Runboat
32+
33+
|badge1| |badge2| |badge3| |badge4| |badge5|
34+
35+
Adds a secondary phone number on leads
36+
37+
**Table of contents**
38+
39+
.. contents::
40+
:local:
41+
42+
Bug Tracker
43+
===========
44+
45+
Bugs are tracked on `GitHub Issues <https://github.com/OCA/partner-contact/issues>`_.
46+
In case of trouble, please check there if your issue has already been reported.
47+
If you spotted it first, help us to smash it by providing a detailed and welcomed
48+
`feedback <https://github.com/OCA/partner-contact/issues/new?body=module:%20crm_lead_phone_secondary%0Aversion:%2019.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_.
49+
50+
Do not contact contributors directly about support or help with technical issues.
51+
52+
Credits
53+
=======
54+
55+
Contributors
56+
------------
57+
58+
- `ForgeFlow <https://forgeflow.com>`__:
59+
60+
- Andreu Orensanz <andreu.orensanz@forgeflow.com>
61+
62+
Maintainers
63+
-----------
64+
65+
This module is maintained by the OCA.
66+
67+
.. image:: https://odoo-community.org/logo.png
68+
:alt: Odoo Community Association
69+
:target: https://odoo-community.org
70+
71+
OCA, or the Odoo Community Association, is a nonprofit organization whose
72+
mission is to support the collaborative development of Odoo features and
73+
promote its widespread use.
74+
75+
This module is part of the `OCA/partner-contact <https://github.com/OCA/partner-contact/tree/19.0/crm_lead_phone_secondary>`_ project on GitHub.
76+
77+
You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
from . import models
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
# Copyright 2026 ForgeFlow S.L. (https://www.forgeflow.com)
2+
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html).
3+
4+
{
5+
"name": "Secondary phone number on leads",
6+
"summary": "Adds a secondary phone number on CRM leads",
7+
"license": "AGPL-3",
8+
"version": "19.0.1.0.0",
9+
"author": "Odoo Community Association (OCA)",
10+
"category": "Customer Relationship Management",
11+
"depends": ["crm", "partner_phone_secondary"],
12+
"website": "https://github.com/OCA/partner-contact",
13+
"data": ["views/crm_lead.xml"],
14+
"installable": True,
15+
}
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
# Translation of Odoo Server.
2+
# This file contains the translation of the following modules:
3+
# * crm_lead_phone_secondary
4+
#
5+
msgid ""
6+
msgstr ""
7+
"Project-Id-Version: Odoo Server 19.0+e\n"
8+
"Report-Msgid-Bugs-To: \n"
9+
"POT-Creation-Date: 2026-01-21 09:35+0000\n"
10+
"PO-Revision-Date: 2026-01-21 09:35+0000\n"
11+
"Last-Translator: \n"
12+
"Language-Team: \n"
13+
"MIME-Version: 1.0\n"
14+
"Content-Type: text/plain; charset=UTF-8\n"
15+
"Content-Transfer-Encoding: \n"
16+
"Plural-Forms: \n"
17+
18+
#. module: crm_lead_phone_secondary
19+
#: model:ir.model.fields,field_description:crm_lead_phone_secondary.field_crm_lead__display_name
20+
msgid "Display Name"
21+
msgstr "Mostrar Nombre"
22+
23+
#. module: crm_lead_phone_secondary
24+
#: model:ir.model.fields,field_description:crm_lead_phone_secondary.field_crm_lead__id
25+
msgid "ID"
26+
msgstr "ID"
27+
28+
#. module: crm_lead_phone_secondary
29+
#: model:ir.model,name:crm_lead_phone_secondary.model_crm_lead
30+
msgid "Lead"
31+
msgstr "Lead"
32+
33+
#. module: crm_lead_phone_secondary
34+
#: model:ir.model.fields,field_description:crm_lead_phone_secondary.field_crm_lead__phone2
35+
msgid "Phone (Secondary)"
36+
msgstr "Teléfono (Secundario)"
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
from . import crm_lead
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
# Copyright 2026 ForgeFlow S.L. (https://www.forgeflow.com)
2+
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html).
3+
4+
from odoo import api, fields, models
5+
6+
7+
class CrmLead(models.Model):
8+
_inherit = "crm.lead"
9+
10+
phone2 = fields.Char(
11+
"Phone (Secondary)",
12+
compute="_compute_phone2",
13+
inverse="_inverse_phone2",
14+
readonly=False,
15+
store=True,
16+
)
17+
18+
def _inverse_phone2(self):
19+
for lead in self:
20+
if getattr(
21+
lead, "_get_partner_phone_update", False
22+
) and lead._get_partner_phone_update(force_void=False):
23+
lead.partner_id.phone2 = lead.phone2
24+
25+
@api.depends("partner_id", "partner_id.phone2", "partner_phone_update")
26+
def _compute_phone2(self):
27+
for lead in self:
28+
lead.phone2 = False
29+
if (
30+
lead.partner_id.phone2
31+
and hasattr(lead, "_get_partner_phone_update")
32+
and lead._get_partner_phone_update()
33+
):
34+
lead.phone2 = lead.partner_id.phone2
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
[build-system]
2+
requires = ["whool"]
3+
build-backend = "whool.buildapi"
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
- [ForgeFlow](https://forgeflow.com):
2+
3+
> - Andreu Orensanz \<<andreu.orensanz@forgeflow.com>\>
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Adds a secondary phone number on leads

0 commit comments

Comments
 (0)