← Back to team overview

c2c-oerpscenario team mailing list archive

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

 

My rationale is from a functional perspective.  The product category is 
important because it contains (usually) the accounting information.  If 
the user badly sets the category, the accounting will not be correct.  
If the category is set by default, the user has a very good chance that 
they will forget to change it.  If the category, however, is REQUIRED 
but NO DEFAULT given, the user is FORCED to choose the category because 
otherwise they will not be able to save the record.

THis is all that I want - that the category is required, but no default 
is filled in.  Do you agree?

Thanks,
Leigh


On 11-07-26 01:25 AM, Amit Parik (OpenERP) wrote:
> 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