ids = self.pool.get('account.chart.template').search(cr, uid, [('visible', '=', True)], context=context)
if ids:
if 'chart_template_id' in fields:
- #in order to set default chart which was last created set max of ids.
+ #in order to get set default chart which was last created set max of ids.
chart_id = max(ids)
if context.get("default_charts"):
- chart_id = self.pool.get('ir.model.data').search_read(cr, uid, [('model','=','account.chart.template'),('module','=',context.get("default_charts"))], ['res_id'], context=context)[0]['res_id']
- data_ids = data_obj.search(cr, uid, [('model', '=', 'account.chart.template'), ('module', '=', context.get("default_charts"))], limit=1, context=context)
- if data_ids:
- chart_id = data_obj.browse(cr, uid, data_ids[0], context=context).res_id
++ model_data = self.pool.get('ir.model.data').search_read(cr, uid, [('model','=','account.chart.template'),('module','=',context.get("default_charts"))], ['res_id'], context=context)
++ if model_data:
++ chart_id = model_data[0]['res_id']
res.update({'only_one_chart_template': len(ids) == 1, 'chart_template_id': chart_id})
if 'sale_tax' in fields:
sale_tax_ids = tax_templ_obj.search(cr, uid, [("chart_template_id"
return self.fetch(
'product.product',
- ['name', 'list_price','price','pos_categ_id', 'taxes_id', 'ean13',
+ ['name', 'list_price','price','pos_categ_id', 'taxes_id', 'ean13', 'default_code',
'to_weight', 'uom_id', 'uos_id', 'uos_coeff', 'mes_type', 'description_sale', 'description'],
[['sale_ok','=',true],['available_in_pos','=',true]],
- {pricelist: self.get('shop').pricelist_id[0]} // context for price
+ {pricelist: self.get('pos_config').pricelist_id[0]} // context for price
);
}).then(function(products){
self.db.add_products(products);
// Write a character to the input zone
writeCharacter: function(character){
- var $input = $(this.input_selector);
- var $input = this.$target;
- if(character === '\n'){
- $input.trigger($.Event('keydown',{which:13}));
- $input.trigger($.Event('keyup',{which:13}));
- }else{
- $input[0].value += character;
- $input.keydown();
- $input.keyup();
- }
++ var $input = this.$target
+ $input[0].value += character;
+ $input.keydown();
+ $input.keyup();
},
// Sends a 'return' character to the input zone. TODO
var category = self.pos.db.get_category_by_id(id);
self.set_category(category);
self.renderElement();
+ self.search_and_categories(category);
});
-
- this.search_and_categories();
-
+ if(this.pos.iface_vkeyboard && this.pos_widget.onscreen_keyboard){
+ this.pos_widget.onscreen_keyboard.connect(this.$('.searchbox input'));
+ }
+ this.search_and_categories();
},
set_product_type: function(type){ // 'all' | 'weightable'