-
-
Notifications
You must be signed in to change notification settings - Fork 209
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[10.0] migrate connector_magento #255
Conversation
There are conflicts right now. Shouldn't this be better renamed to connector-magento? |
Yep, I'll fix them, but my focus is elsewhere at this moment, will do it soon.
It would be nice, and the right moment to do it, anyway addons that depend on it need changes. |
Because it does not apply for Magento 1.9 Closes OCA#126
It reduces the risk of incompatibility between modules if both replace the product mapper.
So we don't replace the entire sale order mapper which has more chances to provoke conflicts between modules.
… new line character to the returned string. This character is not allowed in in the httprequest header. Use base64.b64encode to avoid trailing new line character in the encoded string
It uses the new OCA/connector#138, OCA/connector#139 feature.
… now possible to the analytic account and the fiscal position to use when creating a sale order from magento. Theses options can be specified at any level of the hierarchy of the backend models according to the needs. In this way it become possible for exemple to specify a fiscal position to use for a specific store and take advantage of the taxes mapping defined for this specific position to map the right taxe on the sale order line
So it doesn't fail when it receives a MagicMock instead of a str
@guewen Except the one failing test, do you think this PR is good enough for merging? That would facilitate further contributions. |
Yes it is and indeed it would make contributions a lot easier, I have to find some time to fix the test. |
This is normal: on its side, Magento creates a new address for every order (and the API doesn't return us ids for them), so we have to replicate the same behavior. The addresses are archived so you can use them on the sales orders and related document but not in the searches/lists. This is the difference between the "address book" (the not archived addresses) and the "sales addresses". |
Makes sense. Regarding the failing test case. Perhaps I am not reading it correctly, but I can't find anywhere where it would appear that you are only looking for the stock on the location given by ref("stock.stock_location_components") (5.0 qty). It would seem that ref("stock.stock_location_components") is inside WH (WH/Stock/Shelf 1), so I would expect its inventory to contribute to WH's inventory (and that is the warehouse assigned to the backend in MagentoTestCase.setUp(). If you want the test to pass, you can put this line after line 192 (my_location_id = ...) That makes the test pass, but only because of the implementation of the implementation. I think changing line 208 to All this said, I'd rather get to select a field (probably optional) for a location, falling back to the WH location if not set. This would allow you to combine or filter stock going out based on views or physical locations. (e.g. if you have more than one warehouse you can send the stock location 'Physical Locations' to send all of them combined) |
if not sync: | ||
return True | ||
record = self.backend_adapter.read(self.magento_id, | ||
record = self.backend_adapter.read(self.external_id, | ||
attributes=['updated_at']) | ||
if not record['updated_at']: | ||
# in rare case it can be empty, in doubt, import it | ||
return False |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shouldn't this be True
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seems so... according to the comment I'd say it should be True.
Thanks @jaredkipe, you're helping me a lot! It turns out this test has been added here guewen#6 so @Cedric-Pigeon might have his say on your proposal for the location field. I'll start by fixing the test so we can move forward :) |
* Rename it because it was shadowing another test * Compute in the location's context
The last commit should fix the test. I took the approach to change the location in the context of the binding, because it seems the test tries to check that we are exporting the value for "this" location. @Cedric-Pigeon your approval would be great :) Thanks again for the help @jaredkipe |
@guewen You are very welcome, thank you for your fantastic work on all of these projects! In my 'customizations' I actually added a location field to use like this. This allowed me to 'group' several warehouses by injecting an intermediate 'view' location. This isn't ideal, I'd prefer to specify multiple locations or warehouses and put those into the context. This should be possible as |
@guewen I'm still being plagued by the imports eventually freezing up. When I go to import 3k products, eventually the process will stop without explicitly failing. Sometimes they fail with a result 'Could not acquire advisory lock'. If this happens I need to restart odoo. Here is a gist of active Postgres activity when I come back after trying to import stuff overnight. https://gist.github.com/jaredkipe/e81599fe5610e5a7f0eb59334d6529ed If I find the 'started' jobs, I can requeue them, sometimes that gets them going again.. but only for so long. I'm testing right now with various timeouts for transactions and and idle sessions in Postgres (9.6). The same problem exists in threaded and worker modes. |
Do you have a magento test database dump to provide or is a private one? |
Can we merge? |
An improvement that could be made to the item import would be to batch the products right after returning from the initial search of product ids as you must wait quite a while between the return (with thousands + product ids) to jobs actually starting to run. (presumably because until the main transaction commits, the queue can't see them). Bear in mind that the contention I have been dealing with is as it is importing individual products. I have never had a problem with the initial import other than thinking it wasn't working while waiting for it to finish.
I think so. I think all of the remaining issues I have will have to wait until later as things like the bind by SKU are now integral to my current workflow and I cannot stop to work on them. |
@guewen I forgot to mention, the dependencies could use updating. Here is the list of modules I needed to install the magento connector and the packages they come from (symlinks)
All of those are out of beta now, and if memory serves, the only one I couldn't find a use for was the |
Okay. After spending more hours working on this. It 'looked' like it was somewhere having to do with downloading the image right after the product is created. It appears that CloudFlare was doing something to make that hang (no timeout?) in This also explains why it was so degenerative, it seemed to only get worse and worse. Well I guess because CloudFlare was limiting/throttling it more and more. |
@jaredkipe thanks for the details, this is very reassuring :) Could you retarget your pull requests on 10.0 now that's merged? So it'll ease the review. |
@guewen Will do! (I asked about that between getting the notice that this was merged and getting this comment. :D ) |
The cache entries for events were including instance of the components, hence, they included the work instance / odoo environment. Only the component class and the events it provides are new cached, the instances of components being instanciated when needed. Reported on: OCA/connector-magento#255 (comment)
The cache entries for events were including instance of the components, hence, they included the work instance / odoo environment. Only the component class and the events it provides are new cached, the instances of components being instanciated when needed. Reported on: OCA/connector-magento#255 (comment)
The cache entries for events were including instance of the components, hence, they included the work instance / odoo environment. Only the component class and the events it provides are new cached, the instances of components being instanciated when needed. Reported on: OCA/connector-magento#255 (comment)
The cache entries for events were including instance of the components, hence, they included the work instance / odoo environment. Only the component class and the events it provides are new cached, the instances of components being instanciated when needed. Reported on: OCA/connector-magento#255 (comment)
The cache entries for events were including instance of the components, hence, they included the work instance / odoo environment. Only the component class and the events it provides are new cached, the instances of components being instanciated when needed. Reported on: OCA/connector-magento#255 (comment)
The cache entries for events were including instance of the components, hence, they included the work instance / odoo environment. Only the component class and the events it provides are new cached, the instances of components being instanciated when needed. Reported on: OCA/connector-magento#255 (comment)
The cache entries for events were including instance of the components, hence, they included the work instance / odoo environment. Only the component class and the events it provides are new cached, the instances of components being instanciated when needed. Reported on: OCA/connector-magento#255 (comment)
The cache entries for events were including instance of the components, hence, they included the work instance / odoo environment. Only the component class and the events it provides are new cached, the instances of components being instanciated when needed. Reported on: OCA/connector-magento#255 (comment)
The cache entries for events were including instance of the components, hence, they included the work instance / odoo environment. Only the component class and the events it provides are new cached, the instances of components being instanciated when needed. Reported on: OCA/connector-magento#255 (comment)
The cache entries for events were including instance of the components, hence, they included the work instance / odoo environment. Only the component class and the events it provides are new cached, the instances of components being instanciated when needed. Reported on: OCA/connector-magento#255 (comment)
Depends on:
[10.0] Reworked components registry connector#231 (merged)
[10.0] Add Components for connector-ecommerce connector-ecommerce#41 (merged)
[10.0] add new module to manage technical user on company server-tools#858 (merged)
main API migration for
magentoerpconnect
update tests
update docs