hunk.code_window:     _columns = {
           'name': fields.char('Name', required=True, translate=True),
           'complete_name': fields.function(_name_get_fnc, type="char", string='Name'),
           '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."),
       }
  
hunk.labels: keep keep replace keep keep keep keep keep
hunk.file_path: addons/point_of_sale/models/pos_category.py
hunk.type: replace
file: # -*- coding: utf-8 -*-
  # Part of Odoo. See LICENSE file for full copyright and licensing details.
  
  from openerp import tools
  from openerp.osv import fields, osv
  
  
  class pos_category(osv.osv):
      _name = "pos.category"
      _description = "Public Category"
      _order = "sequence, name"
  
      _constraints = [
          (osv.osv._check_recursion, 'Error ! You cannot create recursive categories.', ['parent_id'])
      ]
  
      def name_get(self, cr, uid, ids, context=None):
          res = []
          for cat in self.browse(cr, uid, ids, context=context):
              names = [cat.name]
              pcat = cat.parent_id
              while pcat:
                  names.append(pcat.name)
                  pcat = pcat.parent_id
              res.append((cat.id, ' / '.join(reversed(names))))
          return res
  
      def _name_get_fnc(self, cr, uid, ids, prop, unknow_none, context=None):
          res = self.name_get(cr, uid, ids, context=context)
          return dict(res)
  
      _columns = {
          'name': fields.char('Name', required=True, translate=True),
          'complete_name': fields.function(_name_get_fnc, type="char", string='Name'),
          '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 for at least one
      # category, then we display a default image on the other, so that the
      # buttons have consistent styling.
      # In this case, the default image is set by the js code.
      image = openerp.fields.Binary("Image", attachment=True,
          help="This field holds the image used as image for the cateogry, limited to 1024x1024px.")
      image_medium = openerp.fields.Binary("Medium-sized image",
          compute='_compute_images', inverse='_inverse_image_medium', store=True, attachment=True,
          help="Medium-sized image of the category. It is automatically "\
               "resized as a 128x128px image, with aspect ratio preserved. "\
               "Use this field in form views or some kanban views.")
      image_small = openerp.fields.Binary("Small-sized image",
          compute='_compute_images', inverse='_inverse_image_small', store=True, attachment=True,
          help="Small-sized image of the category. It is automatically "\
               "resized as a 64x64px image, with aspect ratio preserved. "\
               "Use this field anywhere a small image is required.")
  
      @openerp.api.depends('image')
      def _compute_images(self):
          for rec in self:
              rec.image_medium = tools.image_resize_image_medium(rec.image)
              rec.image_small = tools.image_resize_image_small(rec.image)
  
      def _inverse_image_medium(self):
          for rec in self:
              rec.image = tools.image_resize_image_big(rec.image_medium)
  
      def _inverse_image_small(self):
          for rec in self:
              rec.image = tools.image_resize_image_big(rec.image_small)
  