Browse Source

[FIX] Error Fixed: No Parent Category Error

pull/81/head
SHEREEF PT 8 years ago
parent
commit
db9b4f28a1
  1. 1
      pos_product_category_filter/__init__.py
  2. 6
      pos_product_category_filter/__openerp__.py
  3. 24
      pos_product_category_filter/models/__init__.py
  4. 24
      pos_product_category_filter/models/category.py
  5. 3
      pos_product_category_filter/static/src/js/category.js

1
pos_product_category_filter/__init__.py

@ -1 +1,2 @@
# -*- coding: utf-8 -*-
import models

6
pos_product_category_filter/__openerp__.py

@ -1,17 +1,17 @@
# -*- coding: utf-8 -*-
{
'name': 'POS Product Category Filter',
'version': '1.0',
'version': '9.0.2.0.0',
'category': 'Point of Sale',
'author': 'Cybrosys Techno Solutions',
'company': 'Cybrosys Techno Solutions',
'website': 'http://www.cybrosys.com',
'sequence': 6,
'summary': 'Show only specified categories of product in point of sale ',
'summary': 'Show Only Specified Categories of Product in Point of Sale ',
'description': """
=======================
Customization of produc availablity in PoS.
""",
'depends': ['point_of_sale'],

24
pos_product_category_filter/models/__init__.py

@ -1 +1,23 @@
import category
# -*- coding: utf-8 -*-
##############################################################################
#
# Cybrosys Technologies Pvt. Ltd.
# Copyright (C) 2013-TODAY Cybrosys Technologies(<http://www.cybrosys.com>).
# Author: Cybrosys Technologies(<http://www.cybrosys.com>)
# you can modify it under the terms of the GNU LESSER
# GENERAL PUBLIC LICENSE (LGPL v3), Version 3.
#
# It is forbidden to publish, distribute, sublicense, or sell copies
# of the Software or modified copies of the Software.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU LESSER GENERAL PUBLIC LICENSE (LGPL v3) for more details.
#
# You should have received a copy of the GNU LESSER GENERAL PUBLIC LICENSE
# GENERAL PUBLIC LICENSE (LGPL v3) along with this program.
# If not, see <http://www.gnu.org/licenses/>.
#
##############################################################################
import category

24
pos_product_category_filter/models/category.py

@ -1,9 +1,29 @@
# -*- coding: utf-8 -*-
##############################################################################
#
# Cybrosys Technologies Pvt. Ltd.
# Copyright (C) 2013-TODAY Cybrosys Technologies(<http://www.cybrosys.com>).
# Author: Cybrosys Technologies(<http://www.cybrosys.com>)
# you can modify it under the terms of the GNU LESSER
# GENERAL PUBLIC LICENSE (LGPL v3), Version 3.
#
# It is forbidden to publish, distribute, sublicense, or sell copies
# of the Software or modified copies of the Software.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU LESSER GENERAL PUBLIC LICENSE (LGPL v3) for more details.
#
# You should have received a copy of the GNU LESSER GENERAL PUBLIC LICENSE
# GENERAL PUBLIC LICENSE (LGPL v3) along with this program.
# If not, see <http://www.gnu.org/licenses/>.
#
##############################################################################
from openerp import models, fields
from openerp import models, fields, api
class PosProductCateg(models.Model):
_inherit = 'pos.config'
available_categ = fields.Many2many('pos.category', string='Available Product Categories')

3
pos_product_category_filter/static/src/js/category.js

@ -9,7 +9,6 @@ odoo.define('pos_product_category_filter.pos_product_category_filter', function
var Widget = require('web.Widget');
var QWeb = core.qweb;
var model1 = {
model: 'pos.category',
fields: ['id','name','parent_id','child_id','image'],
@ -45,7 +44,7 @@ odoo.define('pos_product_category_filter.pos_product_category_filter', function
}
for(var i=0, len = categories.length; i < len; i++){
if(categories[i].available === true){
categories[i].parent_id[0] = 0;
categories[i].parent_id = 0;
}
}
for(var i=0, len = categories.length; i < len; i++){

Loading…
Cancel
Save