[FIX] point_of_sale: public category became pos category
This commit is contained in:
parent
43977deb71
commit
6e6b5ea15b
|
@ -1353,8 +1353,8 @@ class pos_category(osv.osv):
|
|||
_columns = {
|
||||
'name': fields.char('Name', required=True, translate=True),
|
||||
'complete_name': fields.function(_name_get_fnc, type="char", string='Name'),
|
||||
'parent_id': fields.many2one('product.public.category','Parent Category', select=True),
|
||||
'child_id': fields.one2many('product.public.category', 'parent_id', string='Children Categories'),
|
||||
'parent_id': fields.many2one('pos.category','Parent Category', select=True),
|
||||
'child_id': fields.one2many('pos.category', 'parent_id', string='Children Categories'),
|
||||
'sequence': fields.integer('Sequence', help="Gives the sequence order when displaying a list of product categories."),
|
||||
|
||||
# NOTE: there is no 'default image', because by default we don't show thumbnails for categories. However if we have a thumbnail
|
||||
|
@ -1366,7 +1366,7 @@ class pos_category(osv.osv):
|
|||
'image_medium': fields.function(_get_image, fnct_inv=_set_image,
|
||||
string="Medium-sized image", type="binary", multi="_get_image",
|
||||
store={
|
||||
'product.public.category': (lambda self, cr, uid, ids, c={}: ids, ['image'], 10),
|
||||
'pos.category': (lambda self, cr, uid, ids, c={}: ids, ['image'], 10),
|
||||
},
|
||||
help="Medium-sized image of the category. It is automatically "\
|
||||
"resized as a 128x128px image, with aspect ratio preserved. "\
|
||||
|
@ -1374,7 +1374,7 @@ class pos_category(osv.osv):
|
|||
'image_small': fields.function(_get_image, fnct_inv=_set_image,
|
||||
string="Smal-sized image", type="binary", multi="_get_image",
|
||||
store={
|
||||
'product.public.category': (lambda self, cr, uid, ids, c={}: ids, ['image'], 10),
|
||||
'pos.category': (lambda self, cr, uid, ids, c={}: ids, ['image'], 10),
|
||||
},
|
||||
help="Small-sized image of the category. It is automatically "\
|
||||
"resized as a 64x64px image, with aspect ratio preserved. "\
|
||||
|
|
|
@ -145,7 +145,7 @@ function openerp_pos_db(instance, module){
|
|||
for(var i = 0, len = products.length; i < len; i++){
|
||||
var product = products[i];
|
||||
var search_string = this._product_search_string(product);
|
||||
var categ_id = product.public_categ_id ? product.public_categ_id[0] : this.root_category_id;
|
||||
var categ_id = product.pos_categ_id ? product.pos_categ_id[0] : this.root_category_id;
|
||||
if (product.variants){
|
||||
product.name = product.name+" ("+product.variants+")";
|
||||
}
|
||||
|
|
|
@ -208,13 +208,13 @@ function openerp_pos_models(instance, module){ //module is instance.point_of_sal
|
|||
}).then(function(packagings){
|
||||
self.db.add_packagings(packagings);
|
||||
|
||||
return self.fetch('product.public.category', ['id','name','parent_id','child_id','image'])
|
||||
return self.fetch('pos.category', ['id','name','parent_id','child_id','image'])
|
||||
}).then(function(categories){
|
||||
self.db.add_categories(categories);
|
||||
|
||||
return self.fetch(
|
||||
'product.product',
|
||||
['name', 'list_price','price','public_categ_id', 'taxes_id', 'ean13', 'default_code', 'variants',
|
||||
['name', 'list_price','price','pos_categ_id', 'taxes_id', 'ean13', 'default_code', 'variants',
|
||||
'to_weight', 'uom_id', 'uos_id', 'uos_coeff', 'mes_type', 'description_sale', 'description'],
|
||||
[['sale_ok','=',true],['available_in_pos','=',true]],
|
||||
{pricelist: self.pricelist.id} // context for price
|
||||
|
|
Loading…
Reference in New Issue