How to do it...

In order to call the export_stock_level() method from the Odoo shell, you need to perform the following steps:

  1. Start the Odoo shell and specify your project configuration file:
    $ ./odoo-bin shell -c project.conf --log-level=error  
  1. Check for error messages and read the information text that's displayed before the usual Python command-line prompt:
env: <odoo.api.Environment object at 0x10e3277f0>
odoo: <module 'odoo' from '/home/parth/community/odoo/__init__.py'>
openerp: <module 'odoo' from '/home/parth/community/odoo/__init__.py'>
self: res.users(1,)
Python 3.6.5 (default, Apr 25 2018, 14:23:58)
[GCC 9.3.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>>
  1. Get a recordset for product.product:
    >>> product = env['product.product']  
  1. Get the main stock location record:
    >>> location_stock = env.ref('stock.stock_location_stock')
  1. Call the export_stock_level() method:
    >>> product.export_stock_level(location_stock)
  1. Commit the transaction before exiting:
    >>> env.cr.commit()
  1. Exit the shell by pressing Ctrl + D.
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset