Import error

Asked by Shaun at hejhog on 2012-06-22

Hello,

I previously had the Magento Connector working with Magento 1.6.2 on my test server but since then my magento install has been updated to 1.7

I am now setting up my Live database.

When importing the attributes in the Magento instances I get the following error:

ValidateError

The value "weight" for the field "magerp_product_attributes.frontend_input" is not in the selection.

Can anyone advise on the problem?

Thanks in advance.

Many Thanks,
Shaun

Question information

Language:
English Edit question
Status:
Solved
For:
Magento OpenERP Connector Edit question
Assignee:
No assignee Edit question
Solved by:
Shaun at hejhog
Solved:
2012-06-28
Last query:
2012-06-28
Last reply:
2012-06-23

You need to add a new selection key value pair for the selection field magerp_product_attributes.frontend_input called ("weight", "Weight")

This is because magento has added this as a new option in Version 1.7

Sharoon Thomas
http://openlabs.co.in

Shaun at hejhog (shau7) said : #2

Hello Sharron,

Thank you for your reply.

Is this added to the product.py file?

approx line 228
'frontend_input':fields.selection([
                                           ('text', 'Text'),
                                           ('textarea', 'Text Area'),
                                           ('select', 'Selection'),
                                           ('multiselect', 'Multi-Selection'),
                                           ('boolean', 'Yes/No'),
                                           ('date', 'Date'),
                                           ('price', 'Price'),
                             ('weight', 'Weight'), # required for magento 1.7

If so I have added and still have the same error.

Many Thanks,
Shaun

Shaun at hejhog (shau7) said : #3

Hello,

Have uploaded the latest files from 6.1-legacy which already has the above weight modification.

This still produces the same ValidateError.

If I add weight as an ignore in attribute.php ( $this->_ignoredAttributeTypes[] = 'weight';) then the module imports attributes no problem - but is not a solution.

Is there a configuration option in Openerp that needs setting?

Many Thanks,
Shaun

Robert Rübner (rruebner) said : #4

@shau7

I had the same problem and tried your solution. First it didn't work too. The problem was I forgot to restart the OpenERP server after changing product.py. After restarting the server it worked. Maybe this was your problem.

There is one difference: I don't use openerp6.1-legacy-module, I use the new one openerp6.1-module.

Shaun at hejhog (shau7) said : #5

Hello Robert,

Thank you for sharing this.

Simple Reboot solved the problem.

Many Thanks,
Shaun

Shaun at hejhog (shau7) said : #6

Solution

Magentoerpconnect - > product.py

find
        'frontend_input':fields.selection([
                                           ('text', 'Text'),
                                           ('textarea', 'Text Area'),
                                           ('select', 'Selection'),
                                           ('multiselect', 'Multi-Selection'),
                                           ('boolean', 'Yes/No'),
                                           ('date', 'Date'),
                                           ('price', 'Price'),
                                           ('media_image', 'Media Image'),
                                           ('gallery', 'Gallery'),
                                           ('weee', 'Fixed Product Tax'),
                                           ('file', 'File'), #this option is not a magento native field it will be better to found a generic solutionto manage this kind of custom option
                                           ], 'Frontend Input'

change to

        'frontend_input':fields.selection([
                                           ('text', 'Text'),
                                           ('textarea', 'Text Area'),
                                           ('select', 'Selection'),
                                           ('multiselect', 'Multi-Selection'),
                                           ('boolean', 'Yes/No'),
                                           ('date', 'Date'),
                                           ('price', 'Price'),
                                           ('media_image', 'Media Image'),
                                           ('gallery', 'Gallery'),
                                           ('weee', 'Fixed Product Tax'),
                                           ('file', 'File'), #this option is not a magento native field it will be better to found a generic solutionto manage this kind of custom option
                                           ('weight', 'Weight'),
                                           ], 'Frontend Input'

****** REBOOT Openerp Server *******

Thanks for solution