Skip to content

Commit

Permalink
[IMP] mozaik_sponsorship_rest: add sponsor and godchildren to res.par…
Browse files Browse the repository at this point in the history
…tner GET service
  • Loading branch information
marielejeune committed Nov 20, 2024
1 parent 4cadd34 commit c708e96
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 0 deletions.
6 changes: 6 additions & 0 deletions mozaik_sponsorship_rest/__manifest__.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,13 @@
"depends": [
"mozaik_sponsorship",
"mozaik_membership_rest",
"mozaik_partner_rest",
],
"data": [],
"demo": [],
"external_dependencies": {
"python": [
"pydantic",
]
},
}
1 change: 1 addition & 0 deletions mozaik_sponsorship_rest/pydantic_models/__init__.py
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
from . import membership_request
from . import membership_request_info
from . import partner_info
19 changes: 19 additions & 0 deletions mozaik_sponsorship_rest/pydantic_models/partner_info.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# Copyright 2023 ACSONE SA/NV
# License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl).
from datetime import date
from typing import List

import pydantic

from odoo.addons.partner_rest_api.pydantic_models.partner_info import (
PartnerInfo as BasePartnerInfo,
PartnerShortInfo as BasePartnerShortInfo,
)


class PartnerInfo(BasePartnerInfo, extends=BasePartnerInfo):
sponsor: BasePartnerShortInfo = pydantic.Field(None, alias="sponsor_id")
sponsor_children: List[BasePartnerShortInfo] = pydantic.Field(
[], alias="sponsor_godchild_ids"
)
sponsorship_date: date = None

0 comments on commit c708e96

Please sign in to comment.