Skip to content

Commit

Permalink
Init partner store
Browse files Browse the repository at this point in the history
  • Loading branch information
Hadrien Huvelle committed Jul 4, 2024
1 parent 2a9e650 commit 6acda54
Show file tree
Hide file tree
Showing 4 changed files with 73 additions and 15 deletions.
64 changes: 64 additions & 0 deletions partner_store/README.rst
Original file line number Diff line number Diff line change
@@ -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 <https://github.com/OCA/partner-contact/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 <https://github.com/OCA/maintainer-tools/blob/master/template/module/static/description/icon.svg>`_.

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

* Hadrien Huvelle <hadrien.huvelle@camptocamp.com>

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.
4 changes: 1 addition & 3 deletions partner_store/__manifest__.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,7 @@
"version": "16.0.1.0.0",
"license": "AGPL-3",
"depends": ["contacts"],
"data": [

],
"data": [],
"installable": True,
"maintainers": ["wouitmil"],
}
2 changes: 1 addition & 1 deletion partner_store/models/__init__.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
from . import res_partner
from . import res_partner
18 changes: 7 additions & 11 deletions partner_store/models/res_partner.py
Original file line number Diff line number Diff line change
@@ -1,20 +1,16 @@
# -*- coding: utf-8 -*-

import logging
from odoo import api, fields, models, _
from odoo.tools.misc import format_date
from datetime import datetime, timedelta
from odoo.tools import DEFAULT_SERVER_DATE_FORMAT
from odoo.exceptions import UserError

from odoo import fields, models

_logger = logging.getLogger(__name__)


class ResPartner(models.Model):
_inherit = 'res.partner'
_inherit = "res.partner"

type = fields.Selection(selection_add=[('store', 'Store Address')])
type = fields.Selection(selection_add=[("store", "Store Address")])

def _avatar_get_placeholder_path(self):
if self.type == 'store':
if self.type == "store":
return "partner_store/static/img/store.png"

Check warning on line 15 in partner_store/models/res_partner.py

View check run for this annotation

Codecov / codecov/patch

partner_store/models/res_partner.py#L15

Added line #L15 was not covered by tests
return super()._avatar_get_placeholder_path()
return super()._avatar_get_placeholder_path()

0 comments on commit 6acda54

Please sign in to comment.