Skip to content
Draft
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
81 changes: 81 additions & 0 deletions l10n_us_crm_county/README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
.. image:: https://odoo-community.org/readme-banner-image
:target: https://odoo-community.org/get-involved?utm_source=readme
:alt: Odoo Community Association

========================
United States - Counties
========================

..
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! source digest: sha256:3eb5da1de3d3f90e53c68b57bf0229bbd10c3b9596d6a6325142b886ba08efc7
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

.. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png
:target: https://odoo-community.org/page/development-status
:alt: Beta
.. |badge2| image:: https://img.shields.io/badge/license-LGPL--3-blue.png
:target: http://www.gnu.org/licenses/lgpl-3.0-standalone.html
:alt: License: LGPL-3
.. |badge3| image:: https://img.shields.io/badge/github-OCA%2Fl10n--usa-lightgray.png?logo=github
:target: https://github.com/OCA/l10n-usa/tree/19.0/l10n_us_crm_county
:alt: OCA/l10n-usa
.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png
:target: https://translation.odoo-community.org/projects/l10n-usa-19-0/l10n-usa-19-0-l10n_us_crm_county
: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/l10n-usa&target_branch=19.0
:alt: Try me on Runboat

|badge1| |badge2| |badge3| |badge4| |badge5|

Imported from U.S. Census Bureau data.
https://www.census.gov/library/publications/2011/compendia/usa-counties-2011.html

**Table of contents**

.. contents::
:local:

Bug Tracker
===========

Bugs are tracked on `GitHub Issues <https://github.com/OCA/l10n-usa/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 <https://github.com/OCA/l10n-usa/issues/new?body=module:%20l10n_us_crm_county%0Aversion:%2019.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_.

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

Credits
=======

Authors
-------

* MetricWise

Contributors
------------

- Adam Heinz <adam.heinz@metricwise.com>

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

This module is maintained by the OCA.

.. image:: https://odoo-community.org/logo.png
:alt: Odoo Community Association
:target: https://odoo-community.org

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/l10n-usa <https://github.com/OCA/l10n-usa/tree/19.0/l10n_us_crm_county>`_ project on GitHub.

You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.
1 change: 1 addition & 0 deletions l10n_us_crm_county/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
from . import models
17 changes: 17 additions & 0 deletions l10n_us_crm_county/__manifest__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{
"name": "United States - Counties",
"version": "19.0.1.0.0",
"category": "Localization",
"summary": "Add United States counties to leads.",
"author": "MetricWise, Odoo Community Association (OCA)",
"license": "LGPL-3",
"maintainer": "Adam Heinz <adam.heinz@metricwise.com>",
"website": "https://github.com/OCA/l10n-usa",
"depends": [
"crm",
"l10n_us_base_county",
],
"data": [
"views/crm_lead_views.xml",
],
}
25 changes: 25 additions & 0 deletions l10n_us_crm_county/i18n/l10n_us_crm_county.pot
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * l10n_us_crm_county
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 18.0\n"
"Report-Msgid-Bugs-To: \n"
"Last-Translator: \n"
"Language-Team: \n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: \n"
"Plural-Forms: \n"

#. module: l10n_us_crm_county
#: model:ir.model.fields,field_description:l10n_us_crm_county.field_crm_lead__county_id
#: model_terms:ir.ui.view,arch_db:l10n_us_crm_county.crm_lead_view_form
msgid "County"
msgstr ""

#. module: l10n_us_crm_county
#: model:ir.model,name:l10n_us_crm_county.model_crm_lead
msgid "Lead/Opportunity"
msgstr ""
1 change: 1 addition & 0 deletions l10n_us_crm_county/models/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
from . import crm_lead
24 changes: 24 additions & 0 deletions l10n_us_crm_county/models/crm_lead.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
from odoo import fields, models

from odoo.addons.crm.models.crm_lead import PARTNER_ADDRESS_FIELDS_TO_SYNC

PARTNER_ADDRESS_FIELDS_TO_SYNC.extend(["county_id"])


class Lead(models.Model):
_inherit = "crm.lead"

county_id = fields.Many2one(
"res.country.state.county",
compute="_compute_partner_address_values",
domain="[('state_id', '=', state_id)]",
ondelete="restrict",
readonly=False,
store=True,
)

# Override
def _prepare_customer_values(self, partner_name, is_company, parent_id=False):
values = super()._prepare_customer_values(partner_name, is_company, parent_id)
values["county_id"] = self.county_id.id
return values
3 changes: 3 additions & 0 deletions l10n_us_crm_county/pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[build-system]
requires = ["whool"]
build-backend = "whool.buildapi"
1 change: 1 addition & 0 deletions l10n_us_crm_county/readme/CONTRIBUTORS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
- Adam Heinz \<<adam.heinz@metricwise.com>\>
2 changes: 2 additions & 0 deletions l10n_us_crm_county/readme/DESCRIPTION.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
Imported from U.S. Census Bureau data.
https://www.census.gov/library/publications/2011/compendia/usa-counties-2011.html
Binary file added l10n_us_crm_county/static/description/icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Loading