> from our test side we found also that 'replace' was ignored if you have a
> customer backend setup on top. Is this also a limitation or a bug?
You customer's mapper (or ConnectorUnit) has to inherit from the class that you want to extend. Here, it has to inherit from magentoerpconnect_options_active.product.ProductImportMapper (this is a normal python inheritance).
>
> As i saw that you already merge the is_active method from Jan
> https://code.launchpad.net/~jan-philipp-fischer/openerp-connector-magento/7.0
> -deactivated-products/+merge/211014 to the next release i was playing with the
> 'replace'
>
> A other solution maybe is to have a new backend typ inherits from the
> 'magento' but this also conflicts with other stuff to replace.
>
> Over all, i prefer to remove 'is_active' from the core connector and remove
> replace from my module.
By proposal was to propose a default in the core module, but using a dedicated mapper
In the extension module:
{inherit the specialized mapper instead of the common one}
@magento(replacing=product.IsActiveProductImportMapper)
class IsActiveProductImportMapper(product.IsActiveProductImportMapper):
This is the only way actually to modify a mapper "horizontally" and prevent conflicts between modules.
A way to avoid that could be to implement a mapper pipeline (but it would not resolve the issue for the other ConnectorUnits).
> from our test side we found also that 'replace' was ignored if you have a
> customer backend setup on top. Is this also a limitation or a bug?
You customer's mapper (or ConnectorUnit) has to inherit from the class that you want to extend. Here, it has to inherit from magentoerpconne ct_options_ active. product. ProductImportMa pper (this is a normal python inheritance).
> /code.launchpad .net/~jan- philipp- fischer/ openerp- connector- magento/ 7.0 products/ +merge/ 211014 to the next release i was playing with the
> As i saw that you already merge the is_active method from Jan
> https:/
> -deactivated-
> 'replace'
>
> A other solution maybe is to have a new backend typ inherits from the
> 'magento' but this also conflicts with other stuff to replace.
>
> Over all, i prefer to remove 'is_active' from the core connector and remove
> replace from my module.
By proposal was to propose a default in the core module, but using a dedicated mapper
In the core module:
{new} ImportMapper( ImportMapper) : product. product'
class IsActiveProduct
_model_name = 'magento.
@mapping
def is_active(self, record):
return {default_mapping}
{modify} pper(ImportMapp er): connector_ unit_for_ model(IsActiveP roductImportMap per) map_record( record) .values( )
class ProductImportMa
@mapping
def is_active(self, record):
mapper = self.get_
return mapper.
In the extension module: replacing= product. IsActiveProduct ImportMapper) ImportMapper( product. IsActiveProduct ImportMapper) :
{inherit the specialized mapper instead of the common one}
@magento(
class IsActiveProduct
This is the only way actually to modify a mapper "horizontally" and prevent conflicts between modules.
A way to avoid that could be to implement a mapper pipeline (but it would not resolve the issue for the other ConnectorUnits).