[IMP] point_of_sale: merged start() with renderElement() where possible

bzr revid: fva@openerp.com-20120625100155-3ec0rk2bq61oy0lo
This commit is contained in:
Frédéric van der Essen 2012-06-25 12:01:55 +02:00
parent 40405d11eb
commit 1f0d6e4cb0
2 changed files with 13 additions and 13 deletions

View File

@ -345,7 +345,8 @@ function openerp_pos_screens(instance, module){ //module is instance.point_of_sa
module.ScaleProductScreenWidget = module.BaseScreenWidget.extend({
template:'ScaleProductSelectionScreenWidget',
start: function(){
renderElement: function(){
this._super();
this.product_categories_widget = new module.ProductCategoriesWidget(this,{
pos:this.pos,
product_type: 'weightable',
@ -520,7 +521,8 @@ function openerp_pos_screens(instance, module){ //module is instance.point_of_sa
show_leftpane: true,
show_total: true,
start: function(){
renderElement: function(){
this._super();
this.product_categories_widget = new module.ProductCategoriesWidget(this,{});
this.product_categories_widget.replace($('.placeholder-ProductCategoriesWidget'));
@ -569,7 +571,8 @@ function openerp_pos_screens(instance, module){ //module is instance.point_of_sa
this.company = this.pos.get('company');
this.shop_obj = this.pos.get('shop');
},
start: function() {
renderElement: function() {
this._super();
this.pos.bind('change:selectedOrder', this.change_selected_order, this);
this.change_selected_order();
},

View File

@ -288,9 +288,10 @@ function openerp_pos_widgets(instance, module){ //module is instance.point_of_sa
}
}, this));
},
start: function() {
$('button.select-order', this.$element).click(_.bind(this.selectOrder, this));
$('button.close-order', this.$element).click(_.bind(this.closeOrder, this));
renderElement:function(){
this._super();
this.$('button.select-order').click(_.bind(this.selectOrder, this));
this.$('button.close-order').click(_.bind(this.closeOrder, this));
},
selectOrder: function(event) {
this.pos.set({
@ -318,7 +319,8 @@ function openerp_pos_widgets(instance, module){ //module is instance.point_of_sa
this.template = 'ActionButtonWidgetWithIcon';
}
},
start: function(){
renderElement: function(){
this._super();
if(this.click_action){
this.$element.click(_.bind(this.click_action, this));
}
@ -388,10 +390,6 @@ function openerp_pos_widgets(instance, module){ //module is instance.point_of_sa
this.set_category();
},
start: function(){
this.search_and_categories();
},
// changes the category. if undefined, sets to root category
set_category : function(category){
if(!category){
@ -428,6 +426,7 @@ function openerp_pos_widgets(instance, module){ //module is instance.point_of_sa
self.renderElement();
self.search_and_categories(category);
});
this.search_and_categories();
},
set_product_type: function(type){ // 'all' | 'weightable'
@ -508,8 +507,6 @@ function openerp_pos_widgets(instance, module){ //module is instance.point_of_sa
self.renderElement();
});
},
start: function(){
},
set_weight: function(weight){
for(var i = 0; i < this.product_list.length; i++){
this.product_list[i].set_weight(weight);