main #7
@@ -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
|
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):
|
def get_tremor(self,name):
|
||||||
|
Date = Pool().get('ir.date')
|
||||||
Configuration = Pool().get('gr.configuration')
|
Configuration = Pool().get('gr.configuration')
|
||||||
config = Configuration.search(['id','>',0])[0]
|
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()
|
f1,f2,f3,f4,f5,d1,d2,d3,d4,d5 = self.get_last_five_fx_rates()
|
||||||
Valuation = Pool().get('valuation.valuation')
|
Valuation = Pool().get('valuation.valuation')
|
||||||
total_t, total_t1, variation = Valuation.get_totals()
|
total_t, total_t1, variation = Valuation.get_totals()
|
||||||
@@ -271,7 +309,7 @@ class Dashboard(ModelSQL, ModelView):
|
|||||||
val_s = len(val)
|
val_s = len(val)
|
||||||
conf = Sale.search(['state','=','confirmed'])
|
conf = Sale.search(['state','=','confirmed'])
|
||||||
conf_s = len(conf)
|
conf_s = len(conf)
|
||||||
Shipment = Pool().get('stock.shipment.in')
|
|
||||||
draft = Shipment.search(['state','=','draft'])
|
draft = Shipment.search(['state','=','draft'])
|
||||||
shipment_d = len(draft)
|
shipment_d = len(draft)
|
||||||
val = Shipment.search(['state','=','started'])
|
val = Shipment.search(['state','=','started'])
|
||||||
|
|||||||
@@ -17,3 +17,4 @@ class GRConfiguration(ModelSingleton, ModelSQL, ModelView):
|
|||||||
pnl_id = fields.Integer("Pnl ID")
|
pnl_id = fields.Integer("Pnl ID")
|
||||||
forex_id = fields.Integer("Forex ID")
|
forex_id = fields.Integer("Forex ID")
|
||||||
payload = fields.Char("Metabase payload")
|
payload = fields.Char("Metabase payload")
|
||||||
|
automation = fields.Boolean("Automation")
|
||||||
@@ -420,6 +420,12 @@ class ShipmentIn(metaclass=PoolMeta):
|
|||||||
'Container'
|
'Container'
|
||||||
)
|
)
|
||||||
shipment_wr = fields.One2Many('shipment.wr','shipment_in',"WR")
|
shipment_wr = fields.One2Many('shipment.wr','shipment_in',"WR")
|
||||||
|
controller = fields.Many2One('party.party',"Controller")
|
||||||
|
send_instruction = fields.Boolean("Send instruction")
|
||||||
|
instructions = fields.Text("Instructions")
|
||||||
|
add_bl = fields.Boolean("Add BL")
|
||||||
|
add_invoice = fields.Boolean("Add invoice")
|
||||||
|
returned_id = fields.Char("Returned ID")
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
def __setup__(cls):
|
def __setup__(cls):
|
||||||
|
|||||||
@@ -11,4 +11,6 @@
|
|||||||
<field name="forex_id"/>
|
<field name="forex_id"/>
|
||||||
<label name="payload"/>
|
<label name="payload"/>
|
||||||
<field name="payload"/>
|
<field name="payload"/>
|
||||||
|
<label name="automation"/>
|
||||||
|
<field name="automation"/>
|
||||||
</form>
|
</form>
|
||||||
@@ -111,6 +111,21 @@ this repository contains the full copyright notices and license terms. -->
|
|||||||
</xpath>
|
</xpath>
|
||||||
<xpath expr="//page[@id='other']" position="after">
|
<xpath expr="//page[@id='other']" position="after">
|
||||||
<page string="Weight Report" col="4" id="wr">
|
<page string="Weight Report" col="4" id="wr">
|
||||||
|
<label name="controller"/>
|
||||||
|
<field name="controller"/>
|
||||||
|
<label name="send_instruction"/>
|
||||||
|
<field name="send_instruction"/>
|
||||||
|
<newline/>
|
||||||
|
<label name="instructions"/>
|
||||||
|
<field name="instructions"/>
|
||||||
|
<label name="add_bl"/>
|
||||||
|
<field name="add_bl"/>
|
||||||
|
<label name="add_invoice"/>
|
||||||
|
<field name="add_invoice"/>
|
||||||
|
<newline/>
|
||||||
|
<label name="returned_id"/>
|
||||||
|
<field name="returned_id"/>
|
||||||
|
<newline/>
|
||||||
<field name="shipment_wr" colspan="4" mode="tree" view_ids="purchase_trade.shipment_wr_view_tree"/>
|
<field name="shipment_wr" colspan="4" mode="tree" view_ids="purchase_trade.shipment_wr_view_tree"/>
|
||||||
</page>
|
</page>
|
||||||
</xpath>
|
</xpath>
|
||||||
|
|||||||
Reference in New Issue
Block a user