mirror of
https://gitlab.com/hibou-io/hibou-odoo/suite.git
synced 2025-01-20 12:37:31 +02:00
Merge branch 'imp/12.0/connector_opencart__product_type' into '12.0'
imp/12.0/connector_opencart__product_type into 12.0 See merge request hibou-io/hibou-odoo/suite!955
This commit is contained in:
@@ -20,6 +20,11 @@ class ProductImportMapper(Component):
|
||||
@only_create
|
||||
@mapping
|
||||
def product_type(self, record):
|
||||
# why this check if @only_create?
|
||||
# well because we would turn the binding create into a very real product.template.write
|
||||
existing_product = self.existing_product(record)
|
||||
if existing_product and existing_product.get('odoo_id'):
|
||||
return {'type': self.env['product.template'].browse(existing_product['odoo_id']).type}
|
||||
return {'type': 'product' if record.get('shipping') else 'service'}
|
||||
|
||||
@mapping
|
||||
|
||||
Reference in New Issue
Block a user