[IMP] stock: Act windows from dashboard should have a name corresponding to the picking type and current inventory should be by location first
This commit is contained in:
@@ -4418,6 +4418,32 @@ class stock_picking_type(osv.osv):
|
||||
result[tid]['rate_picking_backorders'] = 0
|
||||
return result
|
||||
|
||||
def _get_action(self, cr, uid, ids, action, context=None):
|
||||
mod_obj = self.pool.get('ir.model.data')
|
||||
act_obj = self.pool.get('ir.actions.act_window')
|
||||
result = mod_obj.xmlid_to_res_id(cr, uid, action, raise_if_not_found=True)
|
||||
result = act_obj.read(cr, uid, [result], context=context)[0]
|
||||
if ids:
|
||||
picking_type = self.browse(cr, uid, ids[0], context=context)
|
||||
result['display_name'] = picking_type.display_name
|
||||
return result
|
||||
|
||||
def get_action_picking_tree_late(self, cr, uid, ids, context=None):
|
||||
return self._get_action(cr, uid, ids, 'stock.action_picking_tree_late', context=context)
|
||||
|
||||
def get_action_picking_tree_backorder(self, cr, uid, ids, context=None):
|
||||
return self._get_action(cr, uid, ids, 'stock.action_picking_tree_backorder', context=context)
|
||||
|
||||
def get_action_picking_tree_waiting(self, cr, uid, ids, context=None):
|
||||
return self._get_action(cr, uid, ids, 'stock.action_picking_tree_waiting', context=context)
|
||||
|
||||
def get_action_picking_tree_ready(self, cr, uid, ids, context=None):
|
||||
return self._get_action(cr, uid, ids, 'stock.action_picking_tree_ready', context=context)
|
||||
|
||||
def get_stock_picking_action_picking_type(self, cr, uid, ids, context=None):
|
||||
return self._get_action(cr, uid, ids, 'stock.stock_picking_action_picking_type', context=context)
|
||||
|
||||
|
||||
def onchange_picking_code(self, cr, uid, ids, picking_code=False):
|
||||
if not picking_code:
|
||||
return False
|
||||
|
||||
@@ -27,7 +27,7 @@
|
||||
<div class="container o_kanban_card_content o_visible">
|
||||
<div class="row">
|
||||
<div class="col-xs-6 o_kanban_primary_left">
|
||||
<button class="btn btn-primary" name="%(action_picking_tree_ready)d" type="action">
|
||||
<button class="btn btn-primary" name="get_action_picking_tree_ready" type="object">
|
||||
<span t-if="record.code.raw_value =='incoming'"><t t-esc="record.count_picking_ready.value"/> To Receive</span>
|
||||
<span t-if="record.code.raw_value =='outgoing'"><t t-esc="record.count_picking_ready.value"/> To Do</span>
|
||||
<span t-if="record.code.raw_value =='internal'"><t t-esc="record.count_picking_ready.value"/> Transfers</span>
|
||||
@@ -39,7 +39,7 @@
|
||||
|
||||
<div t-if="record.count_picking_waiting.raw_value > 0" class="row">
|
||||
<div class="col-xs-9">
|
||||
<a name="%(action_picking_tree_waiting)d" type="action">
|
||||
<a name="get_action_picking_tree_waiting" type="object">
|
||||
Waiting
|
||||
</a>
|
||||
</div>
|
||||
@@ -50,7 +50,7 @@
|
||||
|
||||
<div t-if="record.count_picking_late.raw_value > 0" class="row">
|
||||
<div class="col-xs-9">
|
||||
<a class="oe_kanban_stock_picking_type_list" name="%(action_picking_tree_late)d" type="action">
|
||||
<a class="oe_kanban_stock_picking_type_list" name="get_action_picking_tree_late" type="object">
|
||||
Late
|
||||
</a>
|
||||
</div>
|
||||
@@ -61,7 +61,7 @@
|
||||
|
||||
<div t-if="record.count_picking_backorders.raw_value > 0" class="row">
|
||||
<div class="col-xs-9">
|
||||
<a class="oe_kanban_stock_picking_type_list" name="%(action_picking_tree_backorder)d" type="action">
|
||||
<a class="oe_kanban_stock_picking_type_list" name="get_action_picking_tree_backorder" type="object">
|
||||
Back Orders
|
||||
</a>
|
||||
</div>
|
||||
@@ -78,13 +78,14 @@
|
||||
<span>View</span>
|
||||
</div>
|
||||
<div>
|
||||
<a name="%(stock_picking_action_picking_type)d" type="action">All</a>
|
||||
<a name="get_stock_picking_action_picking_type" type="object">All</a>
|
||||
</div>
|
||||
<div>
|
||||
<a name="%(action_picking_tree_ready)d" type="action">Ready</a>
|
||||
</div>
|
||||
<div>
|
||||
<a name="%(action_picking_tree_waiting)d" type="action">Waiting</a>
|
||||
<a name="get_action_picking_tree_waiting" type="object">Waiting</a>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-xs-6 o_kanban_card_manage_section o_kanban_manage_new">
|
||||
|
||||
@@ -1940,9 +1940,8 @@
|
||||
<field name="model">stock.quant</field>
|
||||
<field name="arch" type="xml">
|
||||
<pivot string="Inventory">
|
||||
<field name="product_id" type="row"/>
|
||||
<field name="location_id" type="row"/>
|
||||
<field name="qty" type="measure"/>
|
||||
<field name="inventory_value" type="measure"/>
|
||||
</pivot>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
Reference in New Issue
Block a user