Closed StefanRijnhart closed 4 years ago
This is pretty much ready, but I'm waiting for a response from the python-magento project on https://github.com/fulfilio/python-magento/pull/6.
Any update on that?
Ah yes. That was merged actually. Now I just need to add tests for 2.0. To be honest, I have been dreading to do that because it looks quite elaborate. But the work is not complete without it, is it.
This has been running in production for some months now, by the way.
Hi - i'd like to test and use this connector for a odoo 9 <-> magento 2 installation. I have already done several projects with the connector framework - and would be happy to share any improvements i develop - if there is space for improvements. Where can i find the repository for this fork ?
This is now odoo 8 <-> magento2. I can see you are also involved in https://github.com/OCA/connector-magento/pull/210
So is there already a working (or sort of working) solution for odoo9 <-> magento2 ?
If not - what will be less work - start with the odoo9 fork - and try to get it running with magento2 - or start with the magento2 fork - and port it to odoo9 ?
Start with the 9.0 version. Applying this change to that branch is relatively easy. It only has a couple of conflicts.
@wpichler I rebased and squashed my branch to resolve a pending conflict with 8.0.
@StefanRijnhart Does this still need a specific module to be installed on the Magento 2 side, or does it work out of the box?
Also, where is the PR for this?
@thomaspaulb there is no PR but there is a branch https://github.com/stefanrijnhart/connector-magento/tree/8.0-magento2. Waiting for https://github.com/fulfilio/python-magento/pull/16 and help with the tests and write operations.
Hi @StefanRijnhart , (cc: @pedrobaeza ) @saxomanu and I are looking for the fastest way to implement the new OCA v10 connector with magento 2.0. AFAIK we're considering that this repo https://bitbucket.org/davebelais/magento2/src look the most active. Is it an acceptable repository for OCA guidelines or does it MUST be part of github ? Regards
@flotho the addons in this project currently rely on the fulfilio python library just for a very thin abstraction layer. The module you reference does much more, which is not useful in the context of an Odoo module that aims to support both versions. That means you need to be creating a distinct Odoo module for Magento2 if you go that way. I think you are better off if you port this branch to Odoo 10, even if it is a lot of work because of the intermediate refactorings that have taken place.
Currently i am working on the support for magento2 based on the migration to V11 of @hugosantosred and the @StefanRijnhart work. https://github.com/Comunitea/connector-magento/commits/11.0_magento2
Hi, i'm working on support for magento2 odoo v10 based on 10-component of @guewen work. https://github.com/saxomanu/connector-magento/tree/10.0-components-magento2/connector_magento
Hi Stefan, unfortunately I cannot file issues in your repository. The connector does not work for me. I followed the following steps:
When I press "Syncronize Metadata" I get the following warning:
Check your configuration, we can't get the data. Here is the error: call() got an unexpected keyword argument 'http_method'
@alex9434 that would be https://github.com/fulfilio/python-magento/pull/16 that you are missing.
error.log @StefanRijnhart thank you! I uninstalled the version 3.0 (did not realize that your pull request has still not been merged) and installed your version instead. However, I get now the following message:
Check your configuration, we can't get the data. Here is the error:401 Client Error: Unauthorized for url: https://magento2.xxx.xx/index.php/rest/V1/store/websites?fields=id
I have set-up a role "odoo" in Magento2 with "resource access": "all" and user odoo_connector. This user is what I am using in Odoo for the connector. Any idea what I am doing wrong? I have included the nginx error log for the request. Any chance you can see what went wrong?
@alex9434 username: [EMPTY] password: use "Access Token" info from "Integration tokens for Extensions" in magento2.
@atchuthan Thank you so much. That solved my problem. Appreciated!
@StefanRijnhart and @atchuthan I noticed that product variants are imported into Odoo as simple products and not variants (e.g. instead of a T-Shirt with 3 sizes I get 3 different T-Shirs). Is this a limitation of the Magento 2 API interface or the Odoo connector? Or is it possible to import them as variants?
@alex9434 I have no experience with product variants in the connector. Have a look at https://github.com/OCA/connector-magento/pull/219. I think that allows you to match the imported products after you precreated the variants in Odoo with the same product codes.
Comunitea @jesusVMayor @StefanRijnhart I tested https://github.com/Comunitea/connector-magento/tree/11.0_magento2. Importing sale order, product, product category working fine whereas the customer category and update stock qty not working.
while importing customer category the result of the job is " A network error caused the failure of the job: 500 Server Error: Internal Server Error for url: https://test.com/index.php/rest/V1/customerGroups/search?searchCriteria=&fields=items%5Bid%5D"
Update: For everyone that get the following error: File "/usr/local/lib/python2.7/dist-packages/PIL/JpegImagePlugin.py", line 622, in _save raise IOError("cannot write mode %s as JPEG" % im.mode) IOError: cannot write mode RGBA as JPEG Please downgrad pillow to version 4.1.1. This solves the problem.
Hi all,
I get the following error when I import customer orders from magento 2.2.6
Traceback (most recent call last): File "/usr/local/share/oca/connector/connector/queue/worker.py", line 125, in run_job job.perform(session) File "/usr/local/share/oca/connector/connector/queue/job.py", line 512, in perform self.result = self.func(session, *self.args, **self.kwargs) File "/usr/local/share/oca/connector-magento/magentoerpconnect/unit/import_synchronizer.py", line 394, in import_record importer.run(magento_id, force=force) File "/usr/local/share/oca/connector-magento/magentoerpconnect/unit/import_synchronizer.py", line 235, in run record = self._create_data(map_record) File "/usr/local/share/oca/connector-magento/magentoerpconnect/sale.py", line 965, in _create_data**kwargs) File "/usr/local/share/oca/connector-magento/magentoerpconnect/unit/import_synchronizer.py", line 164, in _create_data return map_record.values(for_create=True, **kwargs) File "/usr/local/share/oca/connector/connector/unit/mapper.py", line 953, in values values = self._mapper._apply(self, options=options) File "/usr/local/share/oca/connector/connector/unit/mapper.py", line 737, in _apply return self._apply_with_options(map_record) File "/usr/local/share/oca/connector/connector/unit/mapper.py", line 788, in _apply_with_options return self.finalize(map_record, result) File "/usr/local/share/oca/connector-magento/magentoerpconnect/sale.py", line 546, in finalize return onchange.play(values, values['magento_order_line_ids']) File "/usr/local/share/oca/connector-ecommerce/connector_ecommerce/unit/sale_order_onchange.py", line 203, in play order = self._play_order_onchange(order) File "/usr/local/share/oca/connector-ecommerce/connector_ecommerce/unit/sale_order_onchange.py", line 75, in _play_order_onchange onchange_specs = sale_model._onchange_spec() File "/usr/local/share/v8-server/openerp/api.py", line 266, in wrapper return new_api(self, *args, **kwargs) File "/usr/local/share/v8-server/openerp/models.py", line 5818, in _onchange_spec view_info = self.fields_view_get() File "/usr/local/share/v8-server/openerp/api.py", line 266, in wrapper return new_api(self, *args, **kwargs) File "/usr/local/share/v8-addons/equitania/sale.py", line 137, in fields_view_get res = super(eq_sale_order, self).fields_view_get(view_id=view_id, view_type=view_type, toolbar=toolbar, submenu=submenu) File "/usr/local/share/v8-server/openerp/api.py", line 266, in wrapper return new_api(self, *args, **kwargs) File "/usr/local/share/v8-server/openerp/api.py", line 508, in new_api result = method(self._model, cr, uid, *args, **old_kwargs) File "/usr/local/share/v8-server/addons/mail/mail_thread.py", line 348, in fields_view_get res = super(mail_thread, self).fields_view_get(cr, uid, view_id=view_id, view_type=view_type, context=context, toolbar=toolbar, submenu=submenu) File "/usr/local/share/v8-server/openerp/api.py", line 268, in wrapper return old_api(self, *args, **kwargs) File "/usr/local/share/v8-server/openerp/models.py", line 1506, in fields_view_get view_ref_key = view_type + '_view_ref' TypeError: unsupported operand type(s) for +: 'bool' and 'str'
Any idea what I should do?
Is there someone working on Odoo 10.0 and Magento 2 connector ? We are using the new version of the connector (not magentoerpconnect) for Magento 1 but we will upgrade to Magento 2 soon. Any help will be much appreciated. Thank you!
take a look here: https://github.com/wpichler/connector-magento/tree/10.0-callino-rebase This is the most advanced magento 2 odoo 10 (and also odoo 12) connector available in an oca repo i know about...
Hello Wolfgang, I don't see that I can post as an "issue" but it would be worth updating the Readme to indicate it is for Magento 2.
Readme right now says: " Odoo Magento Connector (also known as MagentoERPconnect) is a bi-directional connector, 100% compatible with the last OpenERP 10.0 and latest Magento versions (1.x)."
If I may get re-inspired for Magento. Thanks for your work here. Landis
From: "Wolfgang Pichler" notifications@github.com To: "OCA" connector-magento@noreply.github.com Cc: "Subscribed" subscribed@noreply.github.com Sent: Monday, January 27, 2020 4:51:34 AM Subject: Re: [OCA/connector-magento] Support for Magento 2.0 (#211)
take a look here: [ https://github.com/wpichler/connector-magento/tree/10.0-callino-rebase | https://github.com/wpichler/connector-magento/tree/10.0-callino-rebase ] This is the most advanced magento 2 odoo 10 (and also odoo 12) connector available in an oca repo i know about...
— You are receiving this because you are subscribed to this thread. Reply to this email directly, [ https://github.com/OCA/connector-magento/issues/211?email_source=notifications&email_token=ABLJD2ANCRDR6ALL4L4C4JTQ73DENA5CNFSM4CEKESBKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEJ7HNNQ#issuecomment-578713270 | view it on GitHub ] , or [ https://github.com/notifications/unsubscribe-auth/ABLJD2GE7TBCII3AVP7TG33Q73DENANCNFSM4CEKESBA | unsubscribe ] .
@wpichler and @l-arnold thank you very much for the info, we will look into it.
thanks - i've updated the readme a bit
Hello @wpichler, how can I use the converter with Odoo 12? In the repository I only see a version for Odoo 10. Does this version also works with 12 or do I need to make changes? Any help would be appreciated!
Hello @alex9434 - in the repository is also the branch for v12 - take a look here: https://github.com/wpichler/connector-magento/tree/12.0
Hallo @wpichler, thank you. Appreciated! Just to double check: readme says that this is for magento 1x but the 12 version is also for magento 2x?
Yes - readme is not updated yet ;-)
@wpichler nice fork you got there. Did you consider proposing your improvements to the OCA project?
@StefanRijnhart I would love to get it back into main OCA - but it still does need quit a bit of work to beautify the code... Also unit tests are not there - or will fail - travis will fail...
OK. I fear that it's not happening any time soon so I'll just continue working on proposing my own branch for Magento 2 x Odoo 12.0. Would love to realign branches later. If all contributors to your branch signed the OCA CLA, we can work on integrating your improvements.
Our branch has many additions to the original branch - like a working product export - and support for product bundles. How far is your branch ? I will create a testing PR to see how many warnings i get...
That's greatly appreciated!
Or, you can let me create the PR and then I can add my tests and merge in my improvements.
How would you like to get all the commits into one branch ?
My Branch is still based on v9 from sodexis - so all the commits wont be able to apply on current odoo v12 branch.
I think a merge will be necessary here - or is there an other way to get the branches in sync without loosing the commit history ?
The commits are from my side and from @flotho - @flotho what do you think about this ?
Flotho: Would it be ok for you to loose commit history ?
That's the problem when you start a fork without feeding back. Also, the work by Sodexis may not be covered by the OCA CLA. In that case, I think we should go ahead with my branch which has a clean history based on the previous OCA branches. We can then pick features (under attribution of you guys) afterwards.
If flotho agree - then we can merge our and flotho's changes into one commit - and cherry-pick this commit into your branch - resolve all the conflicts to get it working. If you didn't change too much until now then it should be possible.
I would rather pick each feature individually, adding tests as we go along.
there are commits with only small fixes - and there are commits with x features in one commit. So this wont be that easy...
Indeed! But it's not going to be easy either way. The conflict of a rebase would be horrendous to solve as well.
What is about a complete new oca repo for connector-magento2 ? My repo is not anymore tested against magento1.x (it should work for the most parts - but i don't know) - so we could consider this as a pure magento2 connector. Or just new connector_magento2 modules in the same repo for it. How far is your repo ? We have around 300 hours work in our repo - and have it working in production at 4 customers
I had another look at your branch, and you took my work without attribution: https://github.com/wpichler/connector-magento/commit/68de81b072eb9649d98cfcd11c852ddc5dc23a17. That does not instill a lot of faith in me. Did you include work from other parties too? That could pose a legal problem in adopting your work back into the OCA.
I see - but it was not me - take a look here: commit 68de81b072eb9649d98cfcd11c852ddc5dc23a17 Author: Emmanuel HURET huret.emmanuel@infoatoutprix.fr Date: Sun Jun 17 16:33:59 2018 +0200
So it was already in the fork where i did forked from...
I am sorry for this - but how would i have been able to check this ?
But i understand the problem here - it would have been better if we had been in contact before i started the work on it.
For all of my commits - all are self made - but i can not promise this for the commits from the original branch where i did forked from...
Thanks for the confirmation! That means that we have to consider the branch you started working on is tainted so we cannot just propose it into the OCA. But at least we can still cherry-pick your improvements (and I am delighted by the state of your work) on top of my Odoo12/Magento2 branch to which I am currently adding the tests.
Just to let you know I am working on Magento 2.0 support, at least for the limited scope of importing sale orders.
The changes to Python-magento have been merged: https://github.com/fulfilio/python-magento/pull/6
Work in progress of the changes to this project: https://github.com/OCA/connector-magento/compare/8.0...StefanRijnhart:8.0-magento2?expand=1
Any preliminary reviews or other comments are welcome.
What currently works is import of the Magento sample data of
Pushing
Challenges out of scope for now:
Any partial product update(cq. stock level update) does not seem possible: https://github.com/magento/magento2/issues/3354. Possible workaround might be to query the product first, then update the result with the new data and sent that back.
The API is not website or store aware. https://github.com/magento/magento2/issues/3864, http://magento.stackexchange.com/questions/116041/product-website-links-list-via-api. Update: github issue now mentions how this should work (http://shop/rest/[store view code]/V1/...)
Update 2017-08-15: adding support to python-magento for writing and creating records and storeview specific operations here: https://github.com/fulfilio/python-magento/pull/16