|
|
@ -28,7 +28,9 @@ class SubscriptionRequestService(Component): |
|
|
|
""" |
|
|
|
|
|
|
|
def get(self, _id): |
|
|
|
sr = self.env["subscription.request"].browse(_id) |
|
|
|
sr = self.env["subscription.request"].search( |
|
|
|
[("external_id", "=", _id)] |
|
|
|
) |
|
|
|
if sr: |
|
|
|
return self._to_dict(sr) |
|
|
|
else: |
|
|
@ -63,7 +65,9 @@ class SubscriptionRequestService(Component): |
|
|
|
|
|
|
|
def update(self, _id, **params): |
|
|
|
params = self._prepare_update(params) |
|
|
|
sr = self.env["subscription.request"].browse(_id) |
|
|
|
sr = self.env["subscription.request"].search( |
|
|
|
[("external_id", "=", _id)] |
|
|
|
) |
|
|
|
if not sr: |
|
|
|
raise wrapJsonException( |
|
|
|
NotFound(_("No subscription request for id %s") % _id) |
|
|
@ -73,8 +77,9 @@ class SubscriptionRequestService(Component): |
|
|
|
|
|
|
|
def _to_dict(self, sr): |
|
|
|
sr.ensure_one() |
|
|
|
|
|
|
|
return { |
|
|
|
"id": sr.id, |
|
|
|
"id": sr.get_external_id(), |
|
|
|
"name": sr.name, |
|
|
|
"email": sr.email, |
|
|
|
"state": sr.state, |
|
|
|