[IMP] kanban of picking.type
bzr revid: fp@openerp.com-20130806082356-6ytonu0l2pp0macp
This commit is contained in:
commit
c295eaf098
|
@ -67,9 +67,51 @@
|
|||
margin: 2px 0;
|
||||
}
|
||||
|
||||
.oe_stock_scan_image {
|
||||
opacity: 0.2
|
||||
.openerp .oe_kanban_view .oe_kanban_stock_picking_type {
|
||||
width: 345px;
|
||||
cursor: default;
|
||||
min-height: 250px !important;
|
||||
}
|
||||
.oe_stock_scan_image:hover {
|
||||
.openerp .oe_kanban_view .oe_kanban_stock_picking_type .oe_items_list {
|
||||
position: relative;
|
||||
margin: 10px;
|
||||
}
|
||||
.openerp .oe_kanban_view .oe_kanban_stock_picking_type .oe_items_list div {
|
||||
width: 160px;
|
||||
height: 22px;
|
||||
margin: 0 !important;
|
||||
position: relative;
|
||||
display: inline-block;
|
||||
float: left;
|
||||
}
|
||||
.openerp .oe_kanban_view .oe_kanban_stock_picking_type .oe_items_list a:hover {
|
||||
text-decoration: underline !important;
|
||||
}
|
||||
.openerp .oe_kanban_view .oe_kanban_stock_picking_type .oe_items_list div a:nth-child(2n) {
|
||||
position: absolute;
|
||||
left: 150px;
|
||||
top: 0;
|
||||
}
|
||||
.openerp .oe_kanban_view .oe_kanban_stock_picking_type .oe_items_list div:nth-child(2n) a:nth-child(2n) {
|
||||
left: 150px;
|
||||
}
|
||||
.openerp .oe_kanban_view .oe_kanban_stock_picking_type .oe_sparkline_bar {
|
||||
height: 20px;
|
||||
width: 66px !important;
|
||||
}
|
||||
.openerp .oe_kanban_view .oe_kanban_stock_picking_type .oe_center {
|
||||
text-align: center;
|
||||
}
|
||||
.openerp .oe_kanban_view .oe_stock_justgage {
|
||||
color: black;
|
||||
display: inline-block;
|
||||
bottom: 0px;
|
||||
position: absolute;
|
||||
}
|
||||
.openerp .oe_stock_scan_image {
|
||||
opacity: 0.2;
|
||||
margin: 0 5px 0;
|
||||
}
|
||||
.openerp .oe_stock_scan_image:hover {
|
||||
opacity: 1
|
||||
}
|
||||
|
|
|
@ -12,12 +12,12 @@ openerp.stock = function(openerp) {
|
|||
self.$el.sparkline(value, {
|
||||
type: type,
|
||||
barWidth: 5,
|
||||
tooltipFormat: '{{offset:offset}} {{value}}',
|
||||
tooltipFormat: '{{offset:offset}}: {{value}} Move(s)',
|
||||
tooltipValueLookups: {
|
||||
'offset': tooltips
|
||||
},
|
||||
});
|
||||
self.$el.tipsy({'delayIn': 0, 'html': true, 'title': function(){return title}, 'gravity': 'n'});
|
||||
self.$el.tipsy({'delayIn': 3000, 'html': true, 'title': function(){return title}, 'gravity': 'n'});
|
||||
}, 0);
|
||||
},
|
||||
});
|
||||
|
|
|
@ -2143,19 +2143,22 @@ class stock_picking_type(osv.osv):
|
|||
result[tid]['rate_picking_backorders'] = 0
|
||||
return result
|
||||
|
||||
#TODO: not returning valus in required format to show in sparkline library,just added latest_picking_waiting need to add proper logic.
|
||||
def _get_picking_history(self, cr, uid, ids, field_names, arg, context=None):
|
||||
obj = self.pool.get('stock.picking')
|
||||
result = {}
|
||||
for id in ids:
|
||||
result[id] = {
|
||||
'latest_picking_late': [],
|
||||
'latest_picking_backorders': []
|
||||
'latest_picking_backorders': [],
|
||||
'latest_picking_waiting': []
|
||||
}
|
||||
for type_id in ids:
|
||||
pick_ids = obj.search(cr, uid, [('state', '=','done'), ('picking_type_id','=',type_id)], limit=12, order="date desc", context=context)
|
||||
for pick in obj.browse(cr, uid, pick_ids, context=context):
|
||||
result[type_id]['latest_picking_late'] = cmp(pick.date[:10], time.strftime('%Y-%m-%d'))
|
||||
result[type_id]['latest_picking_backorders'] = bool(pick.backorder_id)
|
||||
result[type_id]['latest_picking_waiting'] = cmp(pick.date[:10], time.strftime('%Y-%m-%d'))
|
||||
return result
|
||||
|
||||
_columns = {
|
||||
|
@ -2192,6 +2195,8 @@ class stock_picking_type(osv.osv):
|
|||
type='string', multi='_get_picking_history'),
|
||||
'latest_picking_backorders': fields.function(_get_picking_history,
|
||||
type='string', multi='_get_picking_history'),
|
||||
'latest_picking_waiting': fields.function(_get_picking_history,
|
||||
type='string', multi='_get_picking_history'),
|
||||
|
||||
}
|
||||
|
||||
|
|
|
@ -1238,6 +1238,7 @@
|
|||
<field name="count_picking_late"/>
|
||||
<field name="count_picking_backorders"/>
|
||||
<field name="latest_picking_late"/>
|
||||
<field name="latest_picking_waiting"/>
|
||||
<field name="latest_picking_backorders"/>
|
||||
<templates>
|
||||
<t t-name="kanban-box">
|
||||
|
@ -1252,19 +1253,17 @@
|
|||
</div>
|
||||
<div class="oe_kanban_content">
|
||||
<h4 class="oe_center"><field name="name"/></h4>
|
||||
|
||||
<div class="oe_right">
|
||||
<a name="%(action_stock_stock_ui)d" type="action">
|
||||
<img src="/stock/static/src/img/scan.png"
|
||||
alt="Click to launch the barcode interface"
|
||||
class="oe_stock_scan_image"/>
|
||||
class="oe_stock_scan_image" title="Click to launch the barcode interface"/>
|
||||
</a>
|
||||
</div>
|
||||
<div class="oe_items_list">
|
||||
<div>
|
||||
<div class="oe_items_list oe_kanban_ellipsis">
|
||||
<div t-if="record.count_picking.raw_value > 0">
|
||||
<a name="%(action_picking_tree)d" type="action">
|
||||
<field name="count_picking"/>
|
||||
<t t-esc="record.name.raw_value"/>
|
||||
<field name="count_picking"/> Ready
|
||||
</a>
|
||||
<a name="%(action_picking_tree)d" type="action">
|
||||
<field name="weekly_picking" widget="stock_sparkline">Weekly Moves</field>
|
||||
|
@ -1272,14 +1271,15 @@
|
|||
</div>
|
||||
<div t-if="record.count_picking_waiting.raw_value > 0">
|
||||
<a name="%(action_picking_tree_waiting)d" type="action">
|
||||
<field name="count_picking_waiting"/>
|
||||
Waiting
|
||||
<field name="count_picking_waiting"/> Waiting
|
||||
</a>
|
||||
<a name="%(action_picking_tree_waiting)d" type="action" class="oe_sparkline_bar_link">
|
||||
<field name="latest_picking_waiting" widget="stock_sparkline" options="{'type': 'tristate'}"/>
|
||||
</a>
|
||||
</div>
|
||||
<div t-if="record.count_picking_late.raw_value > 0">
|
||||
<a name="%(action_picking_tree_late)d" type="action">
|
||||
<field name="count_picking_late"/>
|
||||
Late
|
||||
<field name="count_picking_late"/> Late
|
||||
</a>
|
||||
<a name="%(action_picking_tree_late)d" type="action" class="oe_sparkline_bar_link">
|
||||
<field name="latest_picking_late" widget="stock_sparkline" options="{'type': 'tristate'}"/>
|
||||
|
@ -1287,20 +1287,16 @@
|
|||
</div>
|
||||
<div t-if="record.count_picking_backorders.raw_value > 0">
|
||||
<a name="%(action_picking_tree_backorder)d" type="action">
|
||||
<field name="count_picking_backorders"/>
|
||||
Backorders
|
||||
<field name="count_picking_backorders"/> Backorders
|
||||
</a>
|
||||
<a name="%(action_picking_tree_backorder)d" type="action" class="oe_sparkline_bar_link">
|
||||
<field name="latest_picking_backorders" widget="stock_sparkline" options="{'type': 'tristate'}"/>
|
||||
</a>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="oe_clear"> </div>
|
||||
<div class="oe_center">
|
||||
<field name="rate_picking_late" widget="stock_gage" style="width:160px; height: 120px;">Late</field>
|
||||
<field name="rate_picking_backorders" widget="stock_gage" style="width:160px; height: 120px;">Backorders</field>
|
||||
<div class="oe_center oe_stock_justgage">
|
||||
<field name="rate_picking_late" widget="stock_gage" style="width:160px; height: 120px;">Late (%%)</field>
|
||||
<field name="rate_picking_backorders" widget="stock_gage" style="width:160px; height: 120px;">Backorders (%%)</field>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
|
Loading…
Reference in New Issue