Skip to content
Permalink
Browse files

fixup! [IMP] stock, mrp, purchase_stock: RR check forecasted stock

  • Loading branch information
amoyaux committed Dec 2, 2019
1 parent a9c23e3 commit 93a5739057dbab94c3de28f0c7e6107faf24d1a3
Showing with 4 additions and 18 deletions.
  1. +4 −18 addons/stock/static/src/js/stock_orderpoint_lead_days_widget.js
@@ -12,9 +12,6 @@ var time = require('web.time');

var LeadDaysWidget = Widget.extend({
template: 'stock.leadDays',
events: _.extend({}, Widget.prototype.events, {
'click .fa-info-circle': '_onClickButton',
}),

/**
* @override
@@ -46,13 +43,13 @@ var LeadDaysWidget = Widget.extend({
// Private
//--------------------------------------------------------------------------
/**
* Set a bootstrap popover on the current QtyAtDate widget that display available
* quantity.
* Set a bootstrap popover on the orderpoint widget that display the
* forecasted stock and its justification.
*/
_setPopOver: function () {
this.data.lead_days_date = this.data.lead_days_date.add(this.getSession().getTZOffset(this.data.lead_days_date), 'minutes').format(time.getLangDateFormat());
this.data.today = new moment();
this.data.today = this.data.today.add(this.getSession().getTZOffset(this.data.today), 'minutes').format(time.getLangDateFormat());
var today = new moment();
this.data.today = today.add(this.getSession().getTZOffset(today), 'minutes').format(time.getLangDateFormat());
var $content = $(QWeb.render('stock.leadDaysPopOver', {
data: this.data,
}));
@@ -66,17 +63,6 @@ var LeadDaysWidget = Widget.extend({
};
this.$el.popover(options);
},

//--------------------------------------------------------------------------
// Handlers
//--------------------------------------------------------------------------

_onClickButton: function (ev) {
// We add the property special click on the widget link.
// This hack allows us to trigger the popover (see _setPopOver) without
// triggering the _onRowClicked that opens the order line form view.
this.$el.find('.fa-info-circle').prop('special_click', true);
},
});

widget_registry.add('lead_days_widget', LeadDaysWidget);

0 comments on commit 93a5739

Please sign in to comment.
You can’t perform that action at this time.