Skip to content

Commit

Permalink
fix: add defaults if mfg/expirty dates are missing
Browse files Browse the repository at this point in the history
  • Loading branch information
ankush committed Mar 24, 2022
1 parent c22dd49 commit ceb72e6
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions ecommerce_integrations/unicommerce/grn.py
Expand Up @@ -150,10 +150,12 @@ def _prepare_grn_import_csv(stock_entry) -> str:
batch_details = frappe.db.get_value(
"Batch", item.batch_no, fieldname=["manufacturing_date", "expiry_date"], as_dict=True
)
manufacturing_date = (
_get_unicommerce_format_date(batch_details.manufacturing_date) if batch_details else ""
manufacturing_date = _get_unicommerce_format_date(
batch_details.manufacturing_date if batch_details else getdate()
)
expiry_date = _get_unicommerce_format_date(
batch_details.expiry_date if batch_details else getdate("2099-01-01")
)
expiry_date = _get_unicommerce_format_date(batch_details.expiry_date) if batch_details else ""

sku = frappe.db.get_value(
"Ecommerce Item",
Expand Down

0 comments on commit ceb72e6

Please sign in to comment.