Skip to content

Commit

Permalink
shopinvader_api_delivery_pickup: add with_dropoff_site in schema
Browse files Browse the repository at this point in the history
  • Loading branch information
chafique-delli authored and sebastienbeau committed Sep 6, 2024
1 parent fc80b3c commit 6b93a80
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 1 deletion.
5 changes: 4 additions & 1 deletion shopinvader_api_delivery_pickup/schemas/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,7 @@
DeliveryPickupSearch,
)
from .address import DeliveryAddress
from .delivery_carrier import DeliveryCarrierWithPrice
from .delivery_carrier import (
DeliveryCarrierWithPrice,
DeliveryCarrier,
)
10 changes: 10 additions & 0 deletions shopinvader_api_delivery_pickup/schemas/delivery_carrier.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,13 @@ def from_delivery_carrier(cls, odoo_rec, cart=None):
res = super().from_delivery_carrier(odoo_rec, cart=cart)
res.with_dropoff_site = odoo_rec.with_dropoff_site or None
return res


class DeliveryCarrier(delivery_carrier.DeliveryCarrier, extends=True):
with_dropoff_site: bool | None = None

@classmethod
def from_delivery_carrier(cls, odoo_rec):
res = super().from_delivery_carrier(odoo_rec)
res.with_dropoff_site = odoo_rec.with_dropoff_site or None
return res

0 comments on commit 6b93a80

Please sign in to comment.