← Back to team overview

openerp-connector-community team mailing list archive

Re: Cash on delivery

 

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


Follow ups

References