← Back to team overview

c2c-oerpscenario team mailing list archive

Re: [Bug 683669] Re: openerp6: SALE_ORDER_MAPPING is not defined

 

2010/12/3 Kyle Waid <683669@xxxxxxxxxxxxxxxxxx>:
> This is not an error or a bug.

If isn't bug, it's a custom project code for a project-instance. ;)
Now, it's necessary custom hardcode and uncomment sale.py line 35

For example, if you have this configurations:

1- Two or more instances magento:
Instance A -> 4 store view
Instance B -> 1 store view

The hardcore it's incompatible.

2. One openerps-server and two or more databases. The same.

> You have to remove the # then go to your magento panel.

Of course but it's hardcore. It's "prototipe" ;)

==how to solve?==
En sale.shop model add new field, magento_order_code (for example). If
it's requiered, it isn't necessary validate after in code (and
recomended some help ;) ).
Sale -> Configuration -> Shop

At sale.py, get values sale.shop model and assign to SALE_ORDER_MAPPING

It's better because you can custom order code in sale shop with
openerp-client or openerp-web and not custom code.

-- 
Raimon Esteve
// OpenERP, gestió empresarial flexible
// Magento, botigues virtuals dinàmiques
// AulaERP, formació online
// easyOERP, tu aplicación OpenERP lista para usar
www.zikzakmedia.com

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

Title:
  openerp6: SALE_ORDER_MAPPING is not defined

Status in Magento Open ERP Connector:
  New

Bug description:
  ==ERRROR==
 File "/home/resteve/openerp-server6/bin/addons/magentoerpconnect/sale.py", line 130, in import_shop_orders
    if SALE_ORDER_MAPPING.get(magento_storeview_id, False):
NameError: global name 'SALE_ORDER_MAPPING' is not defined

==Documentation==
sale.py are comment this line (line 35)

#SALE_ORDER_MAPPING = {1: 100000001, 3: 300000001, 2: 200000001} #Usefull for first import if there is a lot of sale orders! IMPORTANT : Note that this is template, we just let it here for example, working with magento's example data. 

At line 130 get this variable

                    if SALE_ORDER_MAPPING.get(magento_storeview_id, False):
                        ids_or_filter[0]['increment_id'] = {'lt': SALE_ORDER_MAPPING[magento_storeview_id] + SALE_ORDER_IMPORT_STEP}





References