← Back to team overview

c2c-oerpscenario team mailing list archive

[Bug 816097] [NEW] product do not want default category

 

Public bug reported:

OpenERP REQUIRES that there is a DEFAULT product category. I do NOT want
a default product category, I want the field to remain empty (and blue,
because it is required) to force my users to select their product
category.

This is the only place that we have found where a default is required
(the default is hard-coded to be the ALL PRODUCTS category), and this
behavior is not consistent with the rest of OpenERP.

The fix requires a re-write of the following function. The code
containing 'cat0' should not exist at all - it sets the default category
to be (the reference to) cat0 if no default exists - it should return
nothing if no default exists.

 _default_category(self, cr, uid, context=None):
        if context is None:
            context = {}
        if 'categ_id' in context and context['categ_id']:
            return context['categ_id']
        md = self.pool.get('ir.model.data')
        res = False
        try:
            res = md.get_object_reference(cr, uid, 'product', 'cat0')[1]
        except ValueError:
            res = False
        return res

** Affects: openobject-addons
     Importance: Undecided
         Status: New

-- 
You received this bug notification because you are a member of C2C
OERPScenario, which is subscribed to the OpenERP Project Group.
https://bugs.launchpad.net/bugs/816097

Title:
  product do not want default category

Status in OpenERP Modules (addons):
  New

Bug description:
  OpenERP REQUIRES that there is a DEFAULT product category. I do NOT
  want a default product category, I want the field to remain empty (and
  blue, because it is required) to force my users to select their
  product category.

  This is the only place that we have found where a default is required
  (the default is hard-coded to be the ALL PRODUCTS category), and this
  behavior is not consistent with the rest of OpenERP.

  The fix requires a re-write of the following function. The code
  containing 'cat0' should not exist at all - it sets the default
  category to be (the reference to) cat0 if no default exists - it
  should return nothing if no default exists.

   _default_category(self, cr, uid, context=None):
          if context is None:
              context = {}
          if 'categ_id' in context and context['categ_id']:
              return context['categ_id']
          md = self.pool.get('ir.model.data')
          res = False
          try:
              res = md.get_object_reference(cr, uid, 'product', 'cat0')[1]
          except ValueError:
              res = False
          return res

To manage notifications about this bug go to:
https://bugs.launchpad.net/openobject-addons/+bug/816097/+subscriptions


Follow ups

References