Connectors mailing list archives

connectors@odoo-community.org

Avatar

Re: Inventory Sync after Mass Inventory Adjustments

by
Guewen Baconnier
- 02/05/2016 16:25:29
Hi,

The first thing to do is to verify that you don't have a wrong stock field selected on the backend [0]. If the field is empty, "Quantity Available" is used.

Then, the mechanism is as follows:

1. On the Magento Binding, a 'magento_qty' field [1] contains the last value exported to Magento
2. A method on the backend [2] looks for all the products exported to Magento and compare the current stock value with the last exported value
3. When there is a difference, an export is triggered (a new job is created for each product)

Usually the exportation synchronisations are triggered on the update of the records (invoices, picking, ...). Stock moves are a special case because if you have thousands of products and you export the quantities each time a quantity changes, you'll just kill Magento with way too much requests.

So this diff between the last exported value is executed periodically by the cron : "Magento - Update Stock Quantities" [3] so you have to check that this cron is enabled and executed often enough. You can also trigger an update manually using the button on the Magento backend.

You could also consider to add a call to "magento_backend.update_product_stock_qty()" right after a mass inventory adjustment if you need it faster than the regular cron job.

[0] https://github.com/OCA/connector-magento/blob/8.0/magentoerpconnect/magento_model.py#L153
[1] https://github.com/OCA/connector-magento/blob/8.0/magentoerpconnect/magento_model.py#L293
[2] https://github.com/OCA/connector-magento/blob/8.0/magentoerpconnect/magento_model.py#L293
[3] https://github.com/OCA/connector-magento/blob/8.0/magentoerpconnect/magentoerpconnect_data.xml#L73-L84

--
Guewen Baconnier
Business Solutions Software Developer

Camptocamp SA
PSE A, CH-1015 Lausanne
Phone: +41 21 619 10 39
Office: +41 21 619 10 10
http://www.camptocamp.com/

On Mon, May 2, 2016 at 1:08 PM, Michael Aigner <michael@stilnest.com> wrote:

Hi Andrea,


yes, we have a Magento Online Shop that we sync with Odoo and we use Odoo for Purchase Orders and Inventory Management, so if I do Mass Inventory Adjustments (Update QTY On-Hand) to our Products I expect Odoo also to sync them to Magento so that the Shop can display the correct data!

Thanks,
Michael

On May 2, 2016, at 12:53 PM, Andrea Colangelo <andreacolangelo@openforce.it> wrote:

Hi Michael,

just to clarify: are you talking about products quantities updates? I
guess that's the only information from Product Inventories you might
want to import on Magento.

Best,
Andrea.

On Mon, May 2, 2016 at 12:07 PM, Michael Aigner <michael@stilnest.com> wrote:
> Hi,
>
> we just did some Mass Inventory Adjustments in Odoo and I noticed that they
> are not synced back to Magento. Can you explain the logic to me how Odoo
> decides that it needs to sync the inventory and is there a way to retrigger
> all inventory levels?
>
> Thanks,
> Michael
>
> _______________________________________________
> Mailing-List: http://odoo-community.org/groups/connectors-30



-- 
Andrea Colangelo
CTO | http://www.openforce.it
andreacolangelo@openforce.it | Skype: andrea.colangelo | Mobile:
(+39)348 231 6991

_______________________________________________
Mailing-List: http://odoo-community.org/groups/connectors-30
Post to: mailto:connectors@odoo-community.org
Unsubscribe: http://odoo-community.org/groups?unsubscribe


_______________________________________________
Mailing-List: http://odoo-community.org/groups/connectors-30
Post to: mailto:connectors@odoo-community.org
Unsubscribe: http://odoo-community.org/groups?unsubscribe


Reference