Skip to content

Commit

Permalink
[ADD] addon shopinvader_schema_address: init
Browse files Browse the repository at this point in the history
  • Loading branch information
AnizR committed Jun 6, 2023
1 parent e5ea5df commit 752e7d5
Show file tree
Hide file tree
Showing 16 changed files with 159 additions and 0 deletions.
2 changes: 2 additions & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
# generated from manifests external_dependencies
extendable_pydantic
pydantic
1 change: 1 addition & 0 deletions setup/si_schema_address/odoo/addons/si_schema_address
6 changes: 6 additions & 0 deletions setup/si_schema_address/setup.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
import setuptools

setuptools.setup(
setup_requires=['setuptools-odoo'],
odoo_addon=True,
)
1 change: 1 addition & 0 deletions shopinvader_schema_address/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
from . import schema
22 changes: 22 additions & 0 deletions shopinvader_schema_address/__manifest__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# Copyright 2023 ACSONE SA/NV
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).

{
'name': 'Shopinvader Schema Address',
'summary': """
Adds shchema address: address billing_address delivery_address""",
'version': '16.0.1.0.0',
'license': 'AGPL-3',
'author': 'ACSONE SA/NV,Odoo Community Association (OCA)',
'website': 'https://github.com/shopinvader/odoo-shopinvader',
"depends": [
"pydantic",
"extendable",
],
"external_dependencies": {"python": ["extendable_pydantic", "pydantic"]},
'data': [
],
'demo': [
],
"installable": True,
}
10 changes: 10 additions & 0 deletions shopinvader_schema_address/readme/CONFIGURE.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
[ This file is optional, it should explain how to configure
the module before using it; it is aimed at advanced users. ]

To configure this module, you need to:

#. Go to ...

.. figure:: ../static/description/image.png
:alt: alternative description
:width: 600 px
2 changes: 2 additions & 0 deletions shopinvader_schema_address/readme/CONTRIBUTORS.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
* Firstname Lastname <[email protected]> (optional company website url)
* Second Person <[email protected]> (optional company website url)
7 changes: 7 additions & 0 deletions shopinvader_schema_address/readme/CREDITS.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
[ This file is optional and contains additional credits, other than
authors, contributors, and maintainers. ]

The development of this module has been financially supported by:

* Company 1 name
* Company 2 name
5 changes: 5 additions & 0 deletions shopinvader_schema_address/readme/DESCRIPTION.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
[ This file must be max 2-3 paragraphs, and is required. ]

This module extends the functionality of ... to support ...
and to allow you to ...

24 changes: 24 additions & 0 deletions shopinvader_schema_address/readme/HISTORY.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
[ The change log. The goal of this file is to help readers
understand changes between version. The primary audience is
end users and integrators. Purely technical changes such as
code refactoring must not be mentioned here.

This file may contain ONE level of section titles, underlined
with the ~ (tilde) character. Other section markers are
forbidden and will likely break the structure of the README.rst
or other documents where this fragment is included. ]

11.0.x.y.z (YYYY-MM-DD)
~~~~~~~~~~~~~~~~~~~~~~~

* [BREAKING] Breaking changes come first.
(`#70 <https://github.com/OCA/repo/issues/70>`_)
* [ADD] New feature.
(`#74 <https://github.com/OCA/repo/issues/74>`_)
* [FIX] Correct this.
(`#71 <https://github.com/OCA/repo/issues/71>`_)

11.0.x.y.z (YYYY-MM-DD)
~~~~~~~~~~~~~~~~~~~~~~~

* ...
7 changes: 7 additions & 0 deletions shopinvader_schema_address/readme/INSTALL.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
[ This file must only be present if there are very specific
installation instructions, such as installing non-python
dependencies. The audience is systems administrators. ]

To install this module, you need to:

#. Do this ...
5 changes: 5 additions & 0 deletions shopinvader_schema_address/readme/ROADMAP.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
[ Enumerate known caveats and future potential improvements.
It is mostly intended for end-users, and can also help
potential new contributors discovering new features to implement. ]

* ...
11 changes: 11 additions & 0 deletions shopinvader_schema_address/readme/USAGE.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
[ This file must be present and contains the usage instructions
for end-users. As all other rst files included in the README,
it MUST NOT contain reStructuredText sections
only body text (paragraphs, lists, tables, etc). Should you need
a more elaborate structure to explain the addon, please create a
Sphinx documentation (which may include this file as a "quick start"
section). ]

To use this module, you need to:

#. Go to ...
1 change: 1 addition & 0 deletions shopinvader_schema_address/schema/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
from . import address
55 changes: 55 additions & 0 deletions shopinvader_schema_address/schema/address.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
# Copyright 2023 ACSONE SA/NV
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).

import pydantic

from typing import Optional

from extendable_pydantic import ExtendableModelMeta
from pydantic import BaseModel
from odoo.addons.pydantic import utils


class State(BaseModel, metaclass=ExtendableModelMeta):
id: int
name: str
code: str
class Config:
orm_mode = True
getter_dict = utils.GenericOdooGetter

class Country(BaseModel, metaclass=ExtendableModelMeta):
id: int
name: str
code: str
class Config:
orm_mode = True
getter_dict = utils.GenericOdooGetter


class Address(BaseModel, metaclass=ExtendableModelMeta):
name: str
street: str
street2: Optional[str] = None
zip: str
city: str
phone: Optional[str] = None
email: Optional[str] = None
state: Optional[State] = pydantic.Field(alias="state_id") or None
country: Country = pydantic.Field(alias="country_id")

class Config:
orm_mode = True
getter_dict = utils.GenericOdooGetter


class BillingAddress(Address):
"""
Billing Address
"""


class ShippingAddress(Address):
"""
Shipping Address
"""
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 752e7d5

Please sign in to comment.