Comments (6)
You should not modify directly the files in the addon. Instead, you should write an extension addon that modifies this behavior. You should probably extend the ProductMapper and remove the category_id mapping. Use the documentation for how to write this extension addon: http://odoo-magento-connector.com/guides/tutorial_customize.html
from connector-magento.
Hello!
Ok, thank you .. .but maybe you can give me a hint, in which file I found the command, where the connector write the product and category.
Then I could check for a change.
from connector-magento.
Here it is: https://github.com/OCA/connector-magento/blob/8.0/magentoerpconnect/product.py#L464-L491
from connector-magento.
Dear guewen,
many thanks for your support!
But I guess this is the main category import?
This is ok and I need to use.
I only want to disable, that the connector write in odoo the "Internal Category" to the imported products.
Thank you and have a great sunday!
from connector-magento.
Hi,
It is the "Internal Category", the field named categ_id
. (Which is not different from the "Main category" or I miss something.)
from connector-magento.
Hello!
Again thank you for your help ... guess I describe it maybe not good enough:
I want disable, that the connector write the Main category on the products in odoo.
According to your link I try this:
@mapping
def website_ids(self, record):
website_ids = []
binder = self.binder_for('magento.website')
for mag_website_id in record['websites']:
website_id = binder.to_openerp(mag_website_id)
website_ids.append((4, website_id))
return {'website_ids': website_ids}
@mapping
def categories(self, record):
mag_categories = record['categories']
binder = self.binder_for('magento.product.category')
category_ids = []
main_categ_id = None
for mag_category_id in mag_categories:
cat_id = binder.to_openerp(mag_category_id, unwrap=True)
if cat_id is None:
raise MappingError("The product category with "
"magento id %s is not imported." %
mag_category_id)
category_ids.append(cat_id)
# if category_ids:
# main_categ_id = category_ids.pop(0)
# if main_categ_id is None:
# default_categ = self.backend_record.default_category_id
# if default_categ:
# main_categ_id = default_categ.id
# result = {'categ_ids': [(6, 0, category_ids)]}
# if main_categ_id: # OpenERP assign 'All Products' if not specified
# result['categ_id'] = main_categ_id
return result
Maybe I disable the wrong lines, but he write still the Main category on the products.
Did I use the false line or must I disable also the "return result" ?
Thank you!!
from connector-magento.
Related Issues (20)
- Migration to version 12.0 HOT 1
- External ID not found in the system: base.menu_config" HOT 2
- Connector-Magento for Odoo 11 HOT 2
- setting https for the connector HOT 2
- Pylint broken
- Product sync Odoo -> Magento HOT 1
- Migration to version 13.0 HOT 2
- I want to connect odoo 12 to magento 2.3.4 HOT 4
- Discount calculation HOT 1
- Migration to version 14.0
- Magento Odoo HOT 2
- Developer HOT 1
- Why commit "[IMP] Set a pricelist based on the currency of the order" fa27e776b093d3bc3a4998f2ee5a16084e964ef0
- Importing from a regular magento 1.7 gives us a TypeError.
- Who are the ones in charge of the various branchs? HOT 1
- odoo 11/12 - magento 1.9.x magento.product.category error HOT 3
- Migration to version 15.0
- How to stop/delete a Magento Backends
- Migration to version 16.0
- Migration to version 17.0
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from connector-magento.