osiell / oerplib

OERPLib is a Python RPC library which aims to provide an easy way to remotely pilot and manage an OpenERP server.
GNU Lesser General Public License v3.0
21 stars 20 forks source link

How to do the equivalent of pressing the "Transfer" button on a picking via OERPlib? #17

Open pjmcdermott opened 9 years ago

pjmcdermott commented 9 years ago

I have successfully created sales orders and confirmed them via OERPlib. I now have a set of picking operations and want to do the equivalent of pressing the "Transfer" button using a script.

On a sales order I can press "Confirm Sale" via oerp.execute('sale.order', 'action_button_confirm', [sales_order_id]).

But for a picking it appears to be more involved, as the transfer button pulls up a "Products to Move" screen, which allows for adjustment of the products and quantities moved.

I've tried reading the source code, and I am looking at openerp/addons/stock/wizard/stock_transfer_details.py and the do_detailed_transfer() method. But I am reaching the limit of my abilities to understand the Odoo code, beyond ascertaining that the tables stock_transfer_details, stock_transfer_details_items and possibly stock_picking are involved.

Can anyone help with the exact set of database entries I would need to do to created a correct transfer? I have a list of actually transferred products and quantities for the shipment, so the ability to modify the transfer from that proposed would be useful.

Thank you.