This commit is contained in:
2026-02-01 17:55:54 +01:00
parent 9a66952f50
commit 88eb890c46
5 changed files with 64 additions and 2 deletions

View File

@@ -235,8 +235,46 @@ class Dashboard(ModelSQL, ModelView):
return round(1/f1,6), round(1/f2,6) if f2 else None, round(1/f3,6) if f3 else None, round(1/f4,6) if f4 else None, round(1/f5,6) if f5 else None, d1, d2, d3, d4, d5
def get_tremor(self,name):
Date = Pool().get('ir.date')
Configuration = Pool().get('gr.configuration')
config = Configuration.search(['id','>',0])[0]
Shipment = Pool().get('stock.shipment.in')
Fee = Pool().get('fee.fee')
WR = Pool().get('weight.report')
if config.automation:
shipment = Shipment.search([('state','!=','received')])
shipment_trend = [sh for sh in shipment if sh.create_date == Date.today()]
controller = Shipment.search([('controller','!=',None)])
controller_trend = [co for co in controller if co.create_date == Date.today()]
instruction = Shipment.search([('send_instruction','=',True)])
instruction_trend = [si for si in instruction if si.create_date == Date.today()]
wr = WR.search([('id','>',0)])
wr_trend = [w for w in wr if w.create_date == Date.today()]
so = Fee.search(['id','=',25])
so_trend = [s for s in so if s.create_date == Date.today()]
return (
config.dashboard +
"/dashboard/index.html?shipment="
+ str(len(shipment))
+ "&shipment_trend="
+ str(len(shipment_trend))
+ "&controller="
+ str(len(controller))
+ "&controller_trend="
+ str(len(controller_trend))
+ "&instruction="
+ str(len(instruction))
+ "&instruction_trend="
+ str(len(instruction_trend))
+ "&wr="
+ str(len(wr))
+ "&wr_trend="
+ str(len(wr_trend))
+ "&so="
+ str(len(so))
+ "&so_trend="
+ str(len(so_trend)))
f1,f2,f3,f4,f5,d1,d2,d3,d4,d5 = self.get_last_five_fx_rates()
Valuation = Pool().get('valuation.valuation')
total_t, total_t1, variation = Valuation.get_totals()
@@ -271,7 +309,7 @@ class Dashboard(ModelSQL, ModelView):
val_s = len(val)
conf = Sale.search(['state','=','confirmed'])
conf_s = len(conf)
Shipment = Pool().get('stock.shipment.in')
draft = Shipment.search(['state','=','draft'])
shipment_d = len(draft)
val = Shipment.search(['state','=','started'])