← Back to team overview

c2c-oerpscenario team mailing list archive

[Bug 816097] Re: product do not want default category

 

Hello Leigh,

I have analyse your bug report But I do not totally agree with you for
default product category field to remain empty.

I have checked that the "cat0" record created in data.xml file and in
any case the data must be loaded and this data (product.category) are
tightly coupled(because product category field is required in product
form) with product.template object (product form).

So if you want to delete the dates for the product.category you have
faced the "Integrity Error" and we are nor able to deleted those data.

That's why in any case the problem will never occurs So it is not a bug
, it's your suggestion and we need to more discussion on this point.

This issue may not consider as a generic way as per my opinion, So
currently I am setting this as an "Opinion".

@Experts: Would you please share your views on this.

Thanks for the understanding!

** Changed in: openobject-addons
       Status: New => Opinion

-- 
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):
  Opinion

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