Comment 9 for bug 495381

Revision history for this message
Raphaƫl Valyi - http://www.akretion.com (rvalyi) wrote : Re: [Bug 495381] Re: Issue when categories are ordered

Guewen,

I confirm we have to use those kind of hacks. So far I've seen no better way
than what you say. We also sometimes patch magentoerpconnect instead to
match these new options that indeed depend on the exact modules that are
installed on your Magento.

On Thu, Jan 6, 2011 at 1:08 PM, Guewen Baconnier @ Camptocamp <
<email address hidden>> wrote:

> 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 subscribed to Magento
> Open ERP Connector.
> 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
>
>
>