This commit is contained in:
oscar alvarez 2022-12-12 11:28:06 -05:00
parent 39610863da
commit 6c0050050d
3 changed files with 5 additions and 6 deletions

View File

@ -981,9 +981,8 @@ class CropForecastReport(Report):
}
week_range.append((first_date, last_date))
target_crops = data['start_date'] - timedelta(days=300)
crops = Crop.search([
('start_date', '>=', target_crops),
('state', '=', 'production'),
])
records = {}
@ -996,8 +995,8 @@ class CropForecastReport(Report):
for (start_day, end_day) in week_range:
if prod_date >= start_day and prod_date < end_day:
week_n = recs_days[start_day]['week']
recs_days[week_n] = stage.quantity_planned
data['total_' + week_n] += stage.quantity_planned
recs_days[week_n] = int(stage.quantity_planned)
data['total_' + week_n] += int(stage.quantity_planned)
records[crop] = recs_days

Binary file not shown.

View File

@ -10,12 +10,12 @@ this repository contains the full copyright notices and license terms. -->
<field name="location" widget="selection"/>
<label name="seed"/>
<field name="seed"/>
<label name="analytic_account"/>
<field name="analytic_account" widget="selection"/>
<label name="start_date"/>
<field name="start_date"/>
<label name="end_date"/>
<field name="end_date"/>
<label name="analytic_account"/>
<field name="analytic_account" widget="selection"/>
<group id="quantities" col="8" colspan="4">
<label name="total_plants"/>
<field name="total_plants"/>