Commit all views

This commit is contained in:
AzureAD\SylvainDUVERNAY
2026-05-11 14:01:13 +02:00
parent 3986882771
commit 3a3e715336
28 changed files with 5546 additions and 111 deletions

View File

@@ -6,6 +6,7 @@ parent_dir = Path(__file__).parent.parent
sys.path.insert(0, str(parent_dir))
import csv
from datetime import datetime
from decimal import Decimal
from proteus import Model
@@ -97,7 +98,11 @@ def import_prices(csv_file):
price_index = index_map[index_name]
# -- Parse fields -----------------------------------
price_date = parse_date(row.get('price_date', ''))
raw_date = row.get('price_date', '').strip()
try:
price_date = datetime.strptime(raw_date, '%m/%d/%Y').date()
except (ValueError, AttributeError):
price_date = parse_date(raw_date)
high_price = parse_decimal(row.get('high_price', ''), 'high_price')
low_price = parse_decimal(row.get('low_price', ''), 'low_price')
open_price = parse_decimal(row.get('open_price', ''), 'open_price')