FIX REPORT
This commit is contained in:
parent
97fa09e347
commit
103601deac
|
@ -1 +0,0 @@
|
|||
,presik,presik,05.11.2022 11:37,file:///home/presik/.config/libreoffice/4;
|
Binary file not shown.
15
crop.py
15
crop.py
|
@ -327,7 +327,7 @@ class FarmingCrop(Workflow, ModelSQL, ModelView):
|
|||
stage = stage.stage.id,
|
||||
production_rate = stage.production_rate,
|
||||
week = stage.start_time,
|
||||
effective_date = date.today() + timedelta(weeks = stage.start_time),
|
||||
effective_date = crop.planned_date + timedelta(weeks = stage.start_time),
|
||||
)
|
||||
lines.append(line)
|
||||
Line.save(lines)
|
||||
|
@ -366,8 +366,8 @@ class FarmingCrop(Workflow, ModelSQL, ModelView):
|
|||
workforce_price = 0,
|
||||
uom = None,
|
||||
week = activity.time_of_realization,
|
||||
planned_date = date.today() + timedelta(weeks = activity.time_of_realization),
|
||||
effective_date = date.today() + timedelta(weeks = activity.time_of_realization),
|
||||
planned_date = crop.planned_date + timedelta(weeks = activity.time_of_realization),
|
||||
effective_date = crop.planned_date + timedelta(weeks = activity.time_of_realization),
|
||||
)
|
||||
lines.append(line)
|
||||
Line.save(lines)
|
||||
|
@ -1162,7 +1162,6 @@ class CropActivitiesReport(Report):
|
|||
Crop = pool.get('farming.crop')
|
||||
crops = Crop.search([
|
||||
('location', '=', location.id),
|
||||
('start_date', '<=', date_start),
|
||||
('end_date', '>=', date_end),
|
||||
('activities', '!=', None)
|
||||
])
|
||||
|
@ -1189,10 +1188,8 @@ class CropActivitiesReport(Report):
|
|||
}
|
||||
lots_report.append(lot_dict)
|
||||
crop_report['lots'] = lots_report
|
||||
Activity = pool.get('farming.crop.activity')
|
||||
activities = Activity.search(['crop', "=", crop.id])
|
||||
|
||||
for activity in activities:
|
||||
for activity in crop.activities:
|
||||
activity_week = activity.planned_date.isocalendar()[1]
|
||||
for week in week_list:
|
||||
act = {
|
||||
|
@ -1299,7 +1296,6 @@ class CropSuppliesReport(Report):
|
|||
Crop = pool.get('farming.crop')
|
||||
crops = Crop.search([
|
||||
('location', '=', location.id),
|
||||
('start_date', '<=', date_start),
|
||||
('end_date', '>=', date_end),
|
||||
('activities', '!=', None)
|
||||
])
|
||||
|
@ -1435,7 +1431,6 @@ class CropForecastWeekReport(Report):
|
|||
Crop = pool.get('farming.crop')
|
||||
crops = Crop.search([
|
||||
('location', '=', location.id),
|
||||
#('start_date', '<=', date_start),
|
||||
('end_date', '>=', date_end),
|
||||
('activities', '!=', None)
|
||||
])
|
||||
|
@ -1491,8 +1486,6 @@ class CropForecastWeekReport(Report):
|
|||
|
||||
report_context['weeks'] = week_list
|
||||
report_context['records'] = location_list
|
||||
#report_context['totals'] = total_report
|
||||
#report_context['company'] = .party.name
|
||||
report_context['company'] = Company(data['company'])
|
||||
report_context['date_start'] = date_start
|
||||
report_context['date_end'] = date_end
|
||||
|
|
Binary file not shown.
Loading…
Reference in New Issue