← Back to team overview

c2c-oerpscenario team mailing list archive

[Bug 495381] Re: Issue when categories are ordered

 

Hello,

I'm not an Magento expert, but it seems to me that these codes may vary
depending on configuration and modules installed on Magento.  Someone
can confirm / infirm that ?

You have to ensure that your configuration of Magento uses the same
codes that the ones defined in the available_sort_by and default_sort_by
fields of product.category.

To know them, you can display the source of the web page in the
magento's administration where the fields are displayed (edit
categories). In the source, check the value attribute of each option.

In our case, we have specific customizations on Magento so we anyway had to modify these codes. 
You can put them in a configuration module just by overriding the columns, something like that : 

class ProductCategory(magerp_osv.magerp_osv):
    """Modify the available magento sorting options."""
    _inherit = "product.category"
    
    SORT_BY_OPTIONS = (
        ('None', 'Use Config Settings'),
        ('position', 'Position'),
        ('price', 'Price'),
        ('custom_default_manufacturer', 'Manufacturer'),
        ('custom_rdc_availability', 'Availability'),
    )
    
    _columns = {
        'available_sort_by': fields.selection(
                            SORT_BY_OPTIONS,
                            'Available Product Listing (Sort By)',
                            size=32),
        'default_sort_by': fields.selection(
                            SORT_BY_OPTIONS,        
                            'Default Product Listing Sort (Sort By)',
                            size=32),    
    }

ProductCategory()

Regards
Guewen

-- 
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/495381

Title:
  Issue when categories are ordered

Status in Magento Open ERP Connector:
  Confirmed

Bug description:
  Hi,

We have detected the flowing issue. If a category is sorted in Magento it gives the following error in OpenERP

ValidateError

The value "['name']" for the field "available_sort_by" is not in the selection





Follow ups