diff --git a/partner_store/README.rst b/partner_store/README.rst new file mode 100644 index 000000000000..5b6ba2d8b938 --- /dev/null +++ b/partner_store/README.rst @@ -0,0 +1,64 @@ +.. image:: https://img.shields.io/badge/licence-AGPL--3-blue.svg + :target: http://www.gnu.org/licenses/agpl-3.0-standalone.html + :alt: License: AGPL-3 + +============================== +Geospatial support of partners stores +============================== + +Geolocalise your partners stores with the addition of a new type of contact. + + +Installation +============ + +Take a look at the installation section in the description of the module +'base_geoengine'. + +Usage +===== + +* Open a partner form +* Go in `Contacts & Addresses` tab +* Click on add to add a contact. + + + +.. image:: https://odoo-community.org/website/image/ir.attachment/5784_f2813bd/datas + :alt: Try me on Runbot + :target: https://runboat.odoo-community.org/webui/builds.html?repo=oca/partner-contact&target_branch=16.0 + +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 smashing it by providing a detailed and welcomed feedback. + +Credits +======= + +Images +------ + +* Odoo Community Association: `Icon `_. + +Contributors +------------ + +* Hadrien Huvelle + +Maintainer +---------- + +.. image:: https://odoo-community.org/logo.png + :alt: Odoo Community Association + :target: https://odoo-community.org + +This module is maintained by the OCA. + +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. + +To contribute to this module, please visit https://odoo-community.org. diff --git a/partner_store/__init__.py b/partner_store/__init__.py new file mode 100644 index 000000000000..0650744f6bc6 --- /dev/null +++ b/partner_store/__init__.py @@ -0,0 +1 @@ +from . import models diff --git a/partner_store/__manifest__.py b/partner_store/__manifest__.py new file mode 100644 index 000000000000..a29dfd4e869c --- /dev/null +++ b/partner_store/__manifest__.py @@ -0,0 +1,15 @@ +# Copyright 2024 Camptocamp +# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). +{ + "name": "Partner Store", + "summary": "Add store type to Partners", + "author": "Camptocamp, Odoo Community Association (OCA)", + "website": "https://github.com/OCA/partner-contact", + "category": "", + "version": "16.0.1.0.0", + "license": "AGPL-3", + "depends": ["contacts"], + "data": [], + "installable": True, + "maintainers": ["wouitmil"], +} diff --git a/partner_store/models/__init__.py b/partner_store/models/__init__.py new file mode 100644 index 000000000000..91fed54d404e --- /dev/null +++ b/partner_store/models/__init__.py @@ -0,0 +1 @@ +from . import res_partner diff --git a/partner_store/models/res_partner.py b/partner_store/models/res_partner.py new file mode 100644 index 000000000000..f3363704150d --- /dev/null +++ b/partner_store/models/res_partner.py @@ -0,0 +1,18 @@ +# Copyright 2024 Camptocamp +# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). +import logging + +from odoo import fields, models + +_logger = logging.getLogger(__name__) + + +class ResPartner(models.Model): + _inherit = "res.partner" + + type = fields.Selection(selection_add=[("store", "Store Address")]) + + def _avatar_get_placeholder_path(self): + if self.type == "store": + return "partner_store/static/img/store.png" + return super()._avatar_get_placeholder_path() diff --git a/partner_store/static/description/icon.png b/partner_store/static/description/icon.png new file mode 100644 index 000000000000..3a0328b516c4 Binary files /dev/null and b/partner_store/static/description/icon.png differ diff --git a/partner_store/static/img/store.png b/partner_store/static/img/store.png new file mode 100644 index 000000000000..be2d169b43fa Binary files /dev/null and b/partner_store/static/img/store.png differ diff --git a/partner_store/tests/__init__.py b/partner_store/tests/__init__.py new file mode 100644 index 000000000000..d57d215f9086 --- /dev/null +++ b/partner_store/tests/__init__.py @@ -0,0 +1 @@ +from . import test_res_partner diff --git a/partner_store/tests/test_res_partner.py b/partner_store/tests/test_res_partner.py new file mode 100644 index 000000000000..972222dea4db --- /dev/null +++ b/partner_store/tests/test_res_partner.py @@ -0,0 +1,15 @@ +# Copyright 2024 Camptocamp +# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). + +from odoo.tests.common import TransactionCase + + +class TestPartnerStorePartner(TransactionCase): + def test_avatar_path(self): + partner_id = self.env.ref("base.user_root").partner_id + partner_id.type = "store" + + self.assertEqual( + partner_id._avatar_get_placeholder_path(), + "partner_store/static/img/store.png", + ) diff --git a/setup/partner_store/odoo/addons/partner_store b/setup/partner_store/odoo/addons/partner_store new file mode 120000 index 000000000000..962f7ebb351b --- /dev/null +++ b/setup/partner_store/odoo/addons/partner_store @@ -0,0 +1 @@ +../../../../partner_store \ No newline at end of file diff --git a/setup/partner_store/setup.py b/setup/partner_store/setup.py new file mode 100644 index 000000000000..28c57bb64031 --- /dev/null +++ b/setup/partner_store/setup.py @@ -0,0 +1,6 @@ +import setuptools + +setuptools.setup( + setup_requires=['setuptools-odoo'], + odoo_addon=True, +)