Skip to Content
Menú
This question has been flagged
2314 Vistes

Hi, I would like to develop my first module in Odoo. We have a storage positioning lift which has ist's own internal inventory management. This system can be controlled by an API (sending and receiving XML files) which I have already converted to Python - this part is completed and working.


Now I need to integrate this API in Odoo. The process for the users should be the same as manually picking items from storage racks outside the positioning system. First all item transfer records with items that are stored inside the storage lift are sent to the lift controller and after finishing the storage lift will send a response with all item transfers which should update the stock posting order in Odoo.


What would you suggest is the best place to intercept in Odoo's storage logic to trigger the API? There should be as few as possible extra user interactions. I have just started learning Odoo's module programming.


Maybe is there any existing  similar project (on github) to learn from?


Torsten

Avatar
Descartar

Did you finish your module? I`m new in odoo and want to know how to do similar things.

Autor

Hi Mostafa. Yes, I finished my module. Since I wrote this post nearly a half year has passed - within this time I have learned very very much about Odoo's programming - every day. And now I know why nobody has answered my question - because it is much too complex.

However I can throw in some key information how I did it for my case.

First I would suggest to implement the API for your storage system in Python. Maybe your vendor already has some units for you. In my case it is an Haenel System with FTP text file transfer with a lot of regex parsing stuff...

Next it can be helpful to create a configuration model for your api (for storing connection settings, API keys, auth data, ...). To do this, inherit a model from 'res.config.settings', insert your fields and make use of 'config_parameter=' in your fields. To complete this part, create a Form and a Menu for your config model.

For polling my storage system, I inserted an entry in "ir.cron"-table. There you can specify a model (i.e. stock.picking) and a function to call periodically. Within this function you want to use your API for querying tasks.

For sending information to the storage system I inherited the "stock.picking" model, also inserted the API code and replaced the original "Apply picking" buttons in the stock forms to call my own code instead of the original one.

Sorry that I provide only some pieces of information - this was my approach to accomplish this task - I hope to get you some ideas to start with. For implementation details I recommend to learn from Odoo's own modules with the version you are working with.

Related Posts Respostes Vistes Activitat
2
de febr. 16
3446
6
de febr. 16
7612
1
d’ag. 25
462
2
de jul. 25
2880
3
de jul. 25
670