Skip to content

Commit

Permalink
fix: Ensured fetching imported items searches back 1 year.
Browse files Browse the repository at this point in the history
  • Loading branch information
GichanaMayaka committed Sep 2, 2024
1 parent dadbb0e commit fa87255
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion kenya_compliance/kenya_compliance/apis/apis.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import asyncio
import json
from datetime import datetime
from functools import partial
from secrets import token_hex

Expand All @@ -8,6 +9,7 @@
import frappe
import frappe.defaults
from frappe.model.document import Document
from frappe.utils.dateutils import add_to_date

from ..doctype.doctype_names_mapping import (
COUNTRIES_DOCTYPE_NAME,
Expand Down Expand Up @@ -366,7 +368,7 @@ def perform_import_item_search(request_data: str) -> None:
route_path, last_request_date = get_route_path("ImportItemSearchReq")

if headers and server_url and route_path:
request_date = last_request_date.strftime("%Y%m%d%H%M%S")
request_date = add_to_date(datetime.now(), years=-1).strftime("%Y%m%d%H%M%S")
url = f"{server_url}{route_path}"
payload = {"lastReqDt": request_date}

Expand Down

0 comments on commit fa87255

Please sign in to comment.