新增排产的时候, 根据胚料的长宽高比对一下机床的最大加工尺寸.不符合就不要分配给这个加工中心(机床).
This commit is contained in:
50
owl_demo/static/src/js/widgets/MyWidget.js
Normal file
50
owl_demo/static/src/js/widgets/MyWidget.js
Normal file
@@ -0,0 +1,50 @@
|
||||
/** @odoo-module **/
|
||||
|
||||
import AbstractField from 'web.AbstractField';
|
||||
import fieldRegistry from 'web.field_registry';
|
||||
|
||||
export const ShowUnitsWidgetField = AbstractField.extend({
|
||||
supportedFieldTypes: ['float','char','datetime'],
|
||||
|
||||
/**
|
||||
* @override
|
||||
*/
|
||||
// init: function () {
|
||||
// this._super.apply(this, arguments);
|
||||
// this.units = this.nodeOptions && this.nodeOptions.units || '';
|
||||
// },
|
||||
|
||||
/**
|
||||
* @override
|
||||
*/
|
||||
_renderReadonly() {
|
||||
this.units = this.nodeOptions && this.nodeOptions.units || '';
|
||||
this.$el.empty().html(this._formatValue(this.value) + " <b>"+this.units+"</b>");
|
||||
},
|
||||
|
||||
});
|
||||
|
||||
fieldRegistry.add('show_units', ShowUnitsWidgetField);
|
||||
|
||||
export const ShowUnitsWidgetField = AbstractField.extend({
|
||||
supportedFieldTypes: ['float','char','datetime'],
|
||||
|
||||
/**
|
||||
* @override
|
||||
*/
|
||||
// init: function () {
|
||||
// this._super.apply(this, arguments);
|
||||
// this.units = this.nodeOptions && this.nodeOptions.units || '';
|
||||
// },
|
||||
|
||||
/**
|
||||
* @override
|
||||
*/
|
||||
_renderReadonly() {
|
||||
this.units = this.nodeOptions && this.nodeOptions.units || '';
|
||||
this.$el.empty().html(this._formatValue(this.value) + " <b>"+this.units+"</b>");
|
||||
},
|
||||
|
||||
});
|
||||
|
||||
fieldRegistry.add('show_units', ShowUnitsWidgetField);
|
||||
Reference in New Issue
Block a user