[13.0][MIG] connector_magento: Migration to 13.0#327
[13.0][MIG] connector_magento: Migration to 13.0#327victoralmau wants to merge 53 commits intoOCA:13.0from
Conversation
* Use vcr.py to record the exchanges instead of a self-made recorder * Use new base Components test case classes * Separate export tests in 2 phases: trigger of the export which check that the jobs are delayed, and test the job itself in a second test
I removed it earlier, but it is required when we import products
… on the wrong one
* Rename it because it was shadowing another test * Compute in the location's context
The wizard is available on the backend.
Updated by "Update PO files to match POT (msgmerge)" hook in Weblate. Translation: connector-magento-12.0/connector-magento-12.0-connector_magento Translate-URL: https://translation.odoo-community.org/projects/connector-magento-12-0/connector-magento-12-0-connector_magento/
9ba05ae to
552364f
Compare
76ae249 to
fca6baa
Compare
fabd1e7 to
b81f49a
Compare
…to amount_percent
…pute qty in products
… paid is added (only if the import of paid orders is used in the payment method and a payment acquirer is defined). If the amount paid is equal to the order total, the transaction will be marked as completed and the order will be auto-confirmed.
b81f49a to
9910c63
Compare
|
Now |
|
|
||
| def _call(self, method, arguments=None, http_method=None, storeview=None): | ||
| try: | ||
| magento_api = getattr(self.work, "magento_api") # noqa: B009 |
There was a problem hiding this comment.
Don's just silence the linter in this case, as it is easy to fix:
| magento_api = getattr(self.work, "magento_api") # noqa: B009 | |
| magento_api = self.work["magento_api"] |
| if not url: | ||
| raise ValueError("No admin URL configured on the backend.") | ||
| if hasattr(self.model, "_get_admin_path"): | ||
| admin_func = getattr(self.model, "_get_admin_path") # noqa: B009 |
There was a problem hiding this comment.
Same here as above:
| admin_func = getattr(self.model, "_get_admin_path") # noqa: B009 | |
| admin_func = self.model["_get_admin_path"] |
| create_invoice = magento_store.create_invoice_on | ||
|
|
||
| if ( | ||
| create_invoice == "paid" |
There was a problem hiding this comment.
I see you compare create_invoice with either "paid" or "open" but, a few lines above, it is asigned the value of create_invoice_on, which would suggest a different sort of value... Can you confirm it is being handled properly and explain a bit more why this change?
| direct = [ | ||
| ("email", "email"), | ||
| ("dob", "birthday"), | ||
| # (normalize_datetime('created_at'), 'created_at'), |
There was a problem hiding this comment.
| # (normalize_datetime('created_at'), 'created_at'), |
| region = record.get("region") | ||
| if isinstance(region, dict): | ||
| region = region.get("region") |
There was a problem hiding this comment.
Just to confirm, this would mean accessing record["region"]["region"]. Is that the expected structure?
| }, # noqa | ||
| { | ||
| "exclude": "0", | ||
| # noqa |
| "types": ["thumbnail"], | ||
| "url": "http://localhost:9100/media/catalog/product/i/n/" | ||
| "ink-eater-krylon-bombear-destroyed-tee-2.jpg", | ||
| }, # noqa |
There was a problem hiding this comment.
| }, # noqa | |
| }, |
| "types": ["small_image"], | ||
| "url": "http://localhost:9100/media/catalog/product/i/n/" | ||
| "ink-eater-krylon-bombear-destroyed-tee-1.jpg", | ||
| }, # noqa |
There was a problem hiding this comment.
| }, # noqa | |
| }, |
| "types": [], | ||
| "url": "http://localhost:9100/media/catalog/product/m/a/" | ||
| "connector_magento_1.png", | ||
| }, # noqa |
There was a problem hiding this comment.
| }, # noqa | |
| }, |
| ) | ||
|
|
||
| def test_import_sale_order_paid(self): | ||
| payment_checkmo = self.env["account.payment.mode"].search( |
There was a problem hiding this comment.
Same doubts here as above
|
For now, we are holding this pull request, as we are going to speed up the transition to Odoo e-commerce, and not needing this, so o more changes should be applied, although we keep it opened as reference for anyone wanting it. |
| def tax_id(self, record): | ||
| tax_percent = float(record["tax_percent"] or 0) | ||
| if tax_percent > 0: | ||
| tax_record = self.env["account.tax"].search( | ||
| [ | ||
| ("type_tax_use", "=", "sale"), | ||
| ("amount_type", "=", "percent"), | ||
| ("amount", "=", tax_percent), | ||
| ] | ||
| ) | ||
| if not tax_record: | ||
| raise FailedJobError("Missing tax for amount: %s" % tax_percent) | ||
| return {"tax_id": [(4, tax_record.id)]} |
There was a problem hiding this comment.
We faced an issue with tax mapping as previous version a tax was set from the product settings and then a fiscal position was applied that handles correctly final taxes.
This code tries to take a tax with the same percentage even if the tax on a product is different. Extra, in case there are more than one tax (for different countries) with the same percentage it will fail as code expect to provide 1 tax, not all of them.
My suggestion is to remove this mapping and leave Odoo default behaviour when a tax is set on the SO line.
|
Hello, I was also working on getting the connector-magento 12.0 branch running for 15.0 and saw this pull request. At the moment I don't know where to start and who is responsible to check PRs. Long story short, who can give me a kickstart on contributing to OCA and how to communicate? |
|
Good day @john-herholz-dt, thanks for your initiation. Hope below steps can help.
|
|
hi @victoralmau do you have any plan to finish this task ? |
|
We are not finally using it, as we switched to Odoo e-commerce, but feel free to take it from this point that is mostly OK. |
Superseed: #317
Migration to 13.0
New features:
Locked by:
connector_ecommerce[13.0][MIG] connector_ecommerce: Migration to 13.0 connector-ecommerce#62Please @pedrobaeza and @joao-p-marques can you review it?
@Tecnativa TT30700