Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[16.0][IMP] shopinvader_schema_address: add field res_partner.company_type on Address Schema #1561

Open
wants to merge 1 commit into
base: 16.0
Choose a base branch
from
Open
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
4 changes: 4 additions & 0 deletions shopinvader_schema_address/schemas.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
# Copyright 2023 ACSONE SA/NV
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).

import typing

from extendable_pydantic import StrictExtendableBaseModel


Expand All @@ -16,6 +18,7 @@ class Address(StrictExtendableBaseModel):
email: str | None = None
state_id: int | None = None
country_id: int | None = None
company_type: typing.Literal["person", "company"] | None

@classmethod
def from_res_partner(cls, odoo_rec):
Expand All @@ -31,6 +34,7 @@ def from_res_partner(cls, odoo_rec):
email=odoo_rec.email or None,
state_id=odoo_rec.state_id.id or None,
country_id=odoo_rec.country_id.id or None,
company_type=odoo_rec.company_type or None,
)


Expand Down