← Back to team overview

openerp-connector-community team mailing list archive

Re: Cash on delivery

 

Thanks Guewen

I try this but not result
My customer use magento 1.6

i have backend:
magento_myversion = backend.Backend(parent=magento_backend.magento,
                                    version='1.6')

- your custom module calls
openerp.addons.connector.connector.install_in_connector()

I have connector.py with:
from openerp.addons.connector.connector import install_in_connector

install_in_connector()

¿ Some other thing can I do?




El 12/06/14 08:55, Guewen Baconnier escribió:
On 06/12/2014 08:46 AM, Alberto Garcia wrote:
Thanks Guewen

What can I do if i want create a new method? And to be executed. Need some decorator before method?

A new mapping method should be decorated with @mapping [0].

But the cash on delivery line is special, it should be called in the
'finalize' method of the Mapper (see the one in
magentoerpconnect/sale.py). You may want to inherit
SaleOrderImportMapper.finalize to call your method.

If you want to check that you custom Mapper is correctly loaded, you can
use such a mapping:

     def debug(self, record):
         import pdb
         pdb.set_trace()

And run an import. If it does not stop in the debugger, that means that
your Mapper is not used.
If it is not used, you will need to check that:
  - your custom module calls
openerp.addons.connector.connector.install_in_connector()
  - you python module is imported
  - the setup of you Magento Backend use the same version than
'magento_myversion'


[0]
http://openerp-connector.com/api/api_mapper.html#connector.unit.mapper.Mapper
[1]
http://openerp-connector.com/api/api_mapper.html#connector.unit.mapper.Mapper.finalize


--
Alberto Garcia
Consultor Funcional / Jefe Proyecto



Follow ups

References