Showing posts with label open source. Show all posts
Showing posts with label open source. Show all posts

Tuesday, 28 March 2017

How to Define Recurring Entries in odoo ?


Step 1 : Go to Accounting > Periodic Processing > Recurring Entries > Models and Create Model As shown as below.


Step 2 :  Define Recurring Entries and Fill the data as shown in screenshot.


Step 3 : to automatically create entries based on the recurring entries we have set before >> click Generate entries as per the screenshot below.



Step 4 :  you can see the generated entries in “Journal Entries” Tab. as shown in below screenshot.


Wednesday, 22 March 2017

How many widget we can use in odoo v8?

Here are the latest widgets and its following classes usable in odoo js to include or extend also use syntax widget="any_widget_name" with odoo views,
    'char' : 'instance.web.form.FieldChar', 
    'id' : 'instance.web.form.FieldID',
    'email' : 'instance.web.form.FieldEmail',
    'url' : 'instance.web.form.FieldUrl',
    'text' : 'instance.web.form.FieldText',
    'html' : 'instance.web.form.FieldTextHtml',
    'char_domain': 'instance.web.form.FieldCharDomain',
    'date' : 'instance.web.form.FieldDate',
    'datetime' : 'instance.web.form.FieldDatetime', 
    'selection' : 'instance.web.form.FieldSelection', 
    'radio' : 'instance.web.form.FieldRadio',
    'many2one' : 'instance.web.form.FieldMany2One',
    'many2onebutton' : 'instance.web.form.Many2OneButton',
    'many2many' : 'instance.web.form.FieldMany2Many',
    'many2many_tags' : 'instance.web.form.FieldMany2ManyTags',
    'many2many_kanban' : 'instance.web.form.FieldMany2ManyKanban',
    'one2many' : 'instance.web.form.FieldOne2Many',
    'one2many_list' : 'instance.web.form.FieldOne2Many',
    'reference' : 'instance.web.form.FieldReference',
    'boolean' : 'instance.web.form.FieldBoolean',
    'float' : 'instance.web.form.FieldFloat',
    'percentpie': 'instance.web.form.FieldPercentPie',
    'barchart': 'instance.web.form.FieldBarChart',
    'integer': 'instance.web.form.FieldFloat',
    'float_time': 'instance.web.form.FieldFloat',
    'progressbar': 'instance.web.form.FieldProgressBar',
    'image': 'instance.web.form.FieldBinaryImage',
    'binary': 'instance.web.form.FieldBinaryFile',
    'many2many_binary': 'instance.web.form.FieldMany2ManyBinaryMultiFiles',
    'statusbar': 'instance.web.form.FieldStatus',
    'monetary': 'instance.web.form.FieldMonetary',
    'many2many_checkboxes': 'instance.web.form.FieldMany2ManyCheckBoxes',
    'x2many_counter': 'instance.web.form.X2ManyCounter',
    'priority':'instance.web.form.Priority',
    'kanban_state_selection':'instance.web.form.KanbanSelection',
    'statinfo': 'instance.web.form.StatInfo',

Monday, 20 March 2017

Running Odoo 8.0 as a Service

Step 1: Install postgres and pgAdmin.

First execute the below command to update the package lists from the repositories

sudo apt-get update

Execute below command to install postgres and pgAdmin3

sudo apt-get install postgresql-9.1 pgadmin3

Step 2: Start Postgres

sudo su postgres

Step 3: Create user in postgres provide password for that user.

createuser -P -s -e ubuntu (Same as Machine name)

Step 4: Open new terminal and install python requirements by following commands.

sudo apt-get install python-dateutil python-decorator python-docutils python-feedparser \python-gdata python-gevent python-imaging python-jinja2 python-ldap python-libxslt1 python-lxml \python-mako python-mock python-openid python-passlib python-psutil python-psycopg2 python-pybabel \python-pychart python-pydot python-pyparsing python-pypdf python-reportlab python-requests \python-simplejson python-tz python-unittest2 python-vatnumber python-vobject python-werkzeug \python-xlwt python-yaml wkhtmltopdf


Step 5: Download openERP/odoo for Linux platform from the below site.

https://www.odoo.com/page/download

Or you can download source from github which is more preferable options that provides more flexibility during development and deployment of any module.

https://github.com/odoo/odoo/releases

Extract the server and rename it to “odoo”. Copy this folder to “/opt/odoo/” folder(If “odoo” folder in “/opt” does not exists then create this folder).

Step 6: Create configuration file for openerp server.

Create “openerp-server.conf” file and copy and paste below content.

[options]
; This is the password that allows database operations:
admin_passwd = password for admin
db_host = localhost
db_port = 5432
db_user = ubuntu
db_password = password for postgres database user
addons_path = /opt/odoo/odoo/openerp/addons (It may change according to your downloaded bundle)
logfile = /var/log/openerp/openerp-server.log

Provide password in the admin_passwd. Here, db_user = ubuntu and db_password = ***** are for the user created in postgres for ubuntu user.

Copy “openerp-server.conf” file to “/etc” folder, and change odoo server’s folder ownership and permissions by executing below commands. Execute useradd command only if the you want to give other user permission for that folder.

useradd -d /opt/odoo/odoo -s /bin/bash ubuntu
chown ubuntu: -R /opt/odoo/odoo
chown ubuntu: /etc/openerp-server.conf
chmod 640 /etc/openerp-server.conf

Step 7: Install the boot script

Create an “openerp-server” file with the following content and copy-paste this file in “/etc/init.d/” folder.
#!/bin/sh
### BEGIN INIT INFO
# Provides: odoo-server
# Required-Start: $remote_fs $syslog
# Required-Stop: $remote_fs $syslog
# Should-Start: $network
# Should-Stop: $network
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: Business Applications
# Description: ODOO Business Applications.
### END INIT INFO
PATH=/bin:/sbin:/usr/bin
DAEMON=/opt/odoo/odoo/openerp-server (It may change according to your downloaded bundle)
NAME=openerp-server
DESC=openerp-server

# Specify the user name (Default: openerp).
USER=ubuntu

# Specify an alternate config file (Default: /etc/odoo-server.conf).
CONFIGFILE="/etc/openerp-server.conf"

# pidfile
PIDFILE=/var/run/$NAME.pid

# Additional options that are passed to the Daemon.
DAEMON_OPTS="-c $CONFIGFILE"
[ -x $DAEMON ] || exit 0
[ -f $CONFIGFILE ] || exit 0
checkpid() {
[ -f $PIDFILE ] || return 1
pid=`cat $PIDFILE`
[ -d /proc/$pid ] && return 0
return 1
}

case "${1}" in
start)
echo -n "Starting ${DESC}: "
start-stop-daemon --start --quiet --pidfile ${PIDFILE} \
--chuid ${USER} --background --make-pidfile \
--exec ${DAEMON} -- ${DAEMON_OPTS}
echo "${NAME}."
;;
stop)
echo -n "Stopping ${DESC}: "
start-stop-daemon --stop --quiet --pidfile ${PIDFILE} \
--oknodo
echo "${NAME}."
;;

restart|force-reload)
echo -n "Restarting ${DESC}: "
start-stop-daemon --stop --quiet --pidfile ${PIDFILE} \
--oknodo
sleep 1
start-stop-daemon --start --quiet --pidfile ${PIDFILE} \
--chuid ${USER} --background --make-pidfile \
--exec ${DAEMON} -- ${DAEMON_OPTS}
echo "${NAME}."
;;
*)
N=/etc/init.d/${NAME}
echo "Usage: ${NAME} {start|stop|restart|force-reload}" >&2
exit 1
;;

esac
exit 0


Make this file executable using the following commands :
chmod 755 /etc/init.d/openerp-server
chown ubuntu: /etc/init.d/openerp-server

Step 8: Create a log file for the odoo server and make this file executable using the following commands.

mkdir /var/log/openerp
chown ubuntu: /var/log/openerp
touch /var/log/openerp/openerp-server.log
chmod 777 /var/log/openerp/openerp-server.log

Step 9: Start the server

/etc/init.d/openerp-server start

To view logs of the server execute below command.

tail -f /var/log/openerp/openerp-server.log

Now you can access the odoo server by hitting the “localhost:8069” in web browser.

Step 10: Once the server started successfully then make this server start and stop automatically using below command.

sudo update-rc.d openerp-server defaults

How i can create module openerp 7 / Odoo 8 ?

Hi,

Quick Start Guide

For Odoo v8: https://www.odoo.com/documentation/8.0/
1°-Start reading:

Quick start :

Technical_Memento_v0.7.3(En)
Technical_Memento_v 7 (FR)
Official doc : Modules OpenERP v7

2°-Sample module :

Example 1 : Basics of developing a simple module in OpenERP

Example 2 : How to create a module in OpenERP ?

Example 3: Custom Sample Module Development

Example 4:Module structure of OpenERP module

Example 5:Adding additional fields

3°- Videos

Create a module (through interface not with python code)

Tools / IDE OpenERP

1°-IDE : I suggest Eclipse IDE : Eclipse Classic

2°-Python : plugin PyDev for eclipse : Installing the Eclipse PyDev plugin

3°-XML : Editor integrated with eclipse

4°-Templates Openerp :Template for eclipse of openerp code snippets. This snippets are build to help rapid building openerp project with great ease.

For Python Snippets

For XML Snippets

5°-OpenERP in eclipse.

Debug your openERP+python code in eclipse

OpenERP development environment in Windows using Eclipse.

6°-OpenERP V7.0 installation on ubuntu 12.04 x64

How to install OpenERP V7.0 on Ubuntu 12.04 from launchpad repository?

Thursday, 16 March 2017

How to Create service in odoo10

On Ubuntu 16.04, this is how you create a service for Odoo10:

[Unit]
Description=Odoo
Documentation=http://www.odoo.com/
[Service]
# Ubuntu/Debian convention:
Type=simple
User=odoo
ExecStart=/opt/odoo10/odoo-bin -c /etc/odoo-server.conf
[Install]
WantedBy=default.target


You put this in /etc/systemd/system and I called my file odoo10.service so you can then do:

sudo systemctl start odoo10.service (starts service)
sudo systemctl stop odoo10.service (stops service)
sudo systemctl restart odoo10.service (restarts Service)
sudo systemctl status odoo10.service (status of service)
sudo systemctl enable odoo10.service (starts service at boot)
sudo systemctl disable odoo10.service (disables service at boot)

Wednesday, 15 March 2017

ValueError Expected singleton in Odoo

Expected Singleton:

Class methods required single invoking object (Single Browsable Record) to invoke the method and suppose it will call by multiple invoking objects (Browsable Recordsets) then method is not able to identify for which object it should process, therefore it will raise an error Expected Singleton.

New API decorator is used to define method calling pattern whether methods allows only single object or multiple objects to invoke this method.


For Example:


if self.location_id:     #face ValueError Expected singleton because self contains multiple recordset.

    ########

Need to change with following:

for warehouse in self:

    if warehouse.location_id:

        ########


@api.one

This decorator loops automatically on Records of RecordSet for you. Self is redefined as current record

Note:

Caution: the returned value is put in a list. This is not always supported by the web client, e.g. on button action
methods. In that case, you should use @api.multi to decorate your method, and probably call self.ensure_one() in
the method definition.

@api.multi

Self will be the current RecordSet without iteration. It is the default behavior (multiple browsable objects). Methods which returns non premitive type data(list, dictionary, function) must be decorated with @api.multi

@api.model

This decorator will convert old API calls to decorated function to new API signature. It allows to be polite when
migrating code. Self does not contain any record/recordset in methods which are decorated by this decorator.

So simply call like this

self.env['model_name'].method_name(arguments)

one2many, many2many, many2one field in openerp

In OpenERP/Odoo, we have one2many and many2many datatype field. For add, update, delete we have some trick to link with record, which are listed below.

1. (0, 0,  { values })    link to a new record that needs to be created with the given values dictionary

2. (1, ID, { values })    update the linked record with id = ID (write *values* on it)

3. (2, ID)                     remove and delete the linked record with id = ID (calls unlink on ID, that will delete the object completely, and the link to it as well)

4. (3, ID)                     cut the link to the linked record with id = ID (delete the relationship between the two objects but does not delete the target object itself)

5. (4, ID)                     link to existing record with id = ID (adds a relationship)

6. (5)                          unlink all (like using (3,ID) for all linked records)

7. (6, 0, [IDs])             replace the list of linked IDs (like using (5) then (4,ID) for each ID in the list of IDs)

Wednesday, 8 March 2017

How can create a new button in the header of the tree view after the "create button or 'import' "?

<t t-extend="ListView.buttons">

         <t t-jquery="button.oe_list_add" t-operation="after">

                 <t t-if="widget.model=='your.model'">

                         <button class="oe_button  oe_highlight" type="button"> New Buttton</button>

                </t>

         </t>

</t>

Tuesday, 7 March 2017

How to add Facebook Open Graph Tag in the head section?



you can add using this :

        <template id="login_layout_replace1_new" inherit_id="web.layout" name="Web layout">
            <xpath expr="html/head" position="replace">
                <head>
                    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"/>
                    <meta http-equiv="content-type" content="text/html; charset=utf-8" />
                    <title>Odoo</title>
                    <link rel="stylesheet" href="/web/static/src/css/full.css" />
                    <t t-raw="head or ''"/>
                    //you can add your code here.
                </head>
            </xpath>
        </template>

Hope this will help you!!

Tuesday, 2 February 2016

How can I assign Landed Costs to my cost price? | Odoo

landed cost means Product Price + Extra Price (customs, duties, taxes, insurance,..) and from this calculation we can see the actual stock valuation of product.

Lets teke example for this :

I did 2 purchases of the same product with different landed costs:

1st purchase:
Units: 50
Product cost per unit: 200
Landed costs: 400

2nd purchase:
Units 40
Product cost per unit: 300
Landed costs: 200

Now I need to get the Average Cost price of the product + landed costs:

 [(50 x 200 + 400) + (40 x 300 + 200)] / (50 + 40)
 
10,400 + 12,200 / 90 = 251.111


In odoo Landed cost price configuration:



Configuration > Settings:


Go to Setting–>Configuration–>Warehouse
Tick “Generate accounting entries per stock movement” & “Calculate Landed Costs”
Go to Setting–>Configuration–>Purchases
Tick “Use Real Price or Average costing methods”

Configuration > Product 

Start by creating products which indicates your landed costs such as freight charges, Insurance , Custom Duties etc. You can Create the product directly from warehouse. Go to Warehouse–>Configuration–>Landed Cost Type–>Click Create. Make sure that “can constitute landed cost” option is ticked , if not then tick that option. Choose Split Method according to your landed cost type. Make sure to also set “Inventory Valuation” under Accounting Tab.


Now, Calculate Landed Cost:

Go to Warehouse > Landed Cost > Landed Cost > Click Create. Select the pickings to which you want to calculate landed costs. Select the account journal in which to post the landed costs. Once you select the pickings, the product lines will be added automatically to Valuation Adjustment Block. In “Cost Lines” block , select the product indicates landed cost and you want to apply on the selected picking. Click “Compute”.Click “Validate” to confirm the landed costs attribution.


To see updated cost price of your stock :


 Go to Inventory > Reports > Stock Valuation and in Inventory Value you can see the updated cost price.
Here, you can see original inventory value of your business.

Note: Landed cost type have different split methods,

Equal : Equally allocate the landed cost to products
By Quantity : Allocate cost based on the quantity of each products
By current cost : Allocate landed cost based on current cost of each products(after multiplying qty)
By weight : Allocate landed cost based on weight of each products
By Volume : Allocate landed cost based on value of each products


You can also check here how to calculate landed cost :






Wednesday, 25 November 2015

Image data not embedded in manually-sent email in odoo | OpenERP

  • When manually sending am email from OpenERP v7.0 which features the company logo, the image data is not embedded properly.
  • But we can resolve it by added below code in top of the openerp/tools/mail.py File.
# Override the regex as defined in the lxml.html.clean
# module in order to allow the preservation of image data.
clean._is_javascript_scheme = re.compile(
r'(?:javascript|jscript|livescript|vbscript|about|mocha):',
re.I).search

Sunday, 27 September 2015

How to override a global function? | Odoo

There are 2 ways to do this kind of programming.


1) For complete override the global function :


For example, there is one global method "fields_get" into orm file of osv model. In order to override this global method you need to follow below steps,


  •  Define one global function into you custom module. 
  • from osv import orm

    def my_fields_get(....)

        .......

    from osv import orm

    native_fields_get = orm.fields_get

    def my_fields_get(....)

        ....... #custome extension code.

        res = native_fields_get(....)

        ....... #custome extension code.
        return res

  • Write down the following line for the override the basic gloal function.
           orm.fields_get = my_fields_get
          Note : After doing this code, It will override the basic method of the orm file.

2) For made some extension into currently available global function.

For example there is one global method fields_get into orm file of osv model.

  • Define one global function into you custom module. 
  • Write down the following line for the override the basic gloal function.
    orm.fields_get = my_fields_get


How to show Thumbnail image in list view? | Odoo

In sale order line when i select a product it should auto-populate the product image as well. I achieved this functionality to auto-populate the image. And this image is displaying as widget until in form view of sale order line. But once when i click on "save and close" on sale order line form, in the list view of sale order it is showing as some Download(size) like thing. Even i specified as widget="image" in tree view of order line.
Now I want to show this image as widget in list view also.


List view is designed in such a way that will show all binary files as Download(size) format irrespective of the file type and widget specified. To achieve this I have modified the code in web module directly. we can also create module for that.

The code to be added is:
The file need to be modified is: /addons/web/static/src/js/view_list.js:

Line 2066:
'button': 'instance.web.list.Button', +'field.image': 'instance.web.list.FieldBinaryImage', 'field.many2onebutton': 'instance.web.list.Many2OneButton',

Line 2230:
            href: download_url,
            size: instance.web.binary_to_binsize(value),
        });
    }
});
+
+instance.web.list.FieldBinaryImage = instance.web.list.Column.extend({</br>
+       /**
+     * Return a image to the binary field of specified as widget image</br>
+    *
+     * @private
+     */
+    _format: function (row_data, options) {
+            var placeholder= "/web/static/src/img/placeholder.png";
+        var value = row_data[this.id].value;
+        var download_url;
+        if (value && value.substr(0, 10).indexOf(' ') == -1) {
+            download_url = "data:image/png;base64," + value;
+       }
+        else {
+               download_url = placeholder;
+        }
+
+       return _.template('<image src="<%-src%>" width="30px" height="30px"/>', {
+            src: download_url,
+       });
+    }
+});
+
instance.web.list.ProgressBar = instance.web.list.Column.extend({
/**
* Return a formatted progress bar display
*
* @private
*/
_format: function (row_data, options) {

Note:
When you are trying this code to acheive functionality, don't forget to specifywidget="image" in view definition and in this post it is not allowing me to add image tag in code it is converting into image icon.

return _.template('Image tag with src="<%-src%>" and width as 30px and height as 30 px', {


Saturday, 26 September 2015

Switching database in login screen gives Internal server error on server in odoo | OpenERP

Hello,
for this change in below file : 
addons/web/controllers/main.py on line num : 142.
     # always switch the session to the computed db
     if db != request.session.db:
         request.session.logout()
+        request.session.db = db
         abort_and_redirect(request.httprequest.url)
 
-    request.session.db = db
 
 def module_installed():
     # Candidates module the current heuristic is the /static dir

Thursday, 24 September 2015

How to add a custom css? | Odoo

What is the best way to add custom css to openerp 7 without modifying any original file of openerp?



Just create a module and add your css file in __openerp__.py as below.



# __openerp__.py
 {  
   'name': "CSS Example",     'description': "new css example",     'category': 'Generic Modules/Others',     'depends': ['web'],     'data': [],     'css': ['static/src/css/my_css.css'], 
}

<?xml version="1.0" encoding="utf-8"?>
<!-- vim:fdn=3:
-->
<openerp>
    <data>
        <template id="custom_assets_backend" name="custom assets" inherit_id="web.assets_backend">
            <xpath expr="." position="inside">
                <script type="text/javascript" src="modulename/static/src/js/my_js.js"></script>
            </xpath>
        </template>
    </data>
 </openerp>


What is the best way to add custom css and js to odoo ?
Just create a module and add your css file and js file in views/custom_view.xml as below.
<link rel="stylesheet" href="modulename/static/src/css/my_css.css"/>

how do I set the default value for a field from the web interface? | Odoo

First, you have to activate the 'developer mode'.
  1. Click on your name on the upper right corner
  2. Click on 'About OpenERP'
  3. Click on 'Activate the developer mode'

Now, you should see a selection box on the top of each form (above the edit/create buttons). An entry of this selection box is 'Set Defaults'.

You need to display the form view of a record to see it. The selected record should have the value you want as a default.

In the 'Set Defaults' form, you are able to choose the value from the current form which you want as a default value. You can also choose if it is applicable to all users or only to you.

How to remove "Manage Databases" in Odoo? | OpenERP

Your module should also be auto-installable, use the key auto_install in the __openerp__.py of your module:
'auto_install': True,
<templates>
<!-- Templates modified at the web start, before loading of a database. --> <!-- Remove the Manage database link, but keep the Powered by OpenERP-->
<t t-extend="Login">
<t t-jquery="div.oe_login_footer" t-operation="replace">
<div class="oe_login_footer">
<a href="company link" target="_blank">Powered by <span>your Company Name</span></a>
</div>
</t>
</t> </templates>
'qweb' : [
"static/src/xml/base.xml",
],

To remove the Manage database, you'll need to create a file static/src/xml/base.xml:Then you need to load the file in __openerp__.py:
You can edit the logo or other elements interface too.
You can refer to the file addons/web/static/src/xml/base.xml in openerp-web to see the base templates.

What kind of hardware is supported by the Point of Sale? | Odoo

I want to set up a Point of Sale at my shop, and I wonder what kind of hardware is supported ??

Point Of Sale OpenERP Odoo



Standard Hardware



  • Barcode scanners : 

  • any kind of EAN13 usb barcode scanner should be supported. Make sure you configure it to always emit 13 characters. 

  • Touchscreens :

  • Any kind of resistive or multitouch screen should work. In those cases you may want to activate the on screen keyboard in the Point of Sale settings.

  • Printers :

  • In the default settings, the Point of sale will use the browser to print. In this case any laser or inkjet printer supported by your operating system will work. But those kinds of printers are not ideally suited for printing receipts. There is a 'Print by Proxy' settings that enables you to bypass the browser and directly use your printer, but in this case you'll need to develop a driver for your printer or find one provided by the community.

 

Custom Hardware

Because the Point of Sale runs in your browser, it is sandboxed and cannot access your hardware directly. To solve that problem, we developed a custom proxy server that must be run on the client machine while running the point of sale. The Proxy server can access your hardware and forward commands to and from the Point of Sale.
The proxy server is part of a standard Odoo install. All you have to do is install Odoo on the client machine and run it with a default setup. What you'll need to do, however, is to customize the proxy to talk to your hardware.
The proxy is located in addons/point_of_sale/controllers/main.py In that file there are several stub rpc methods that will be called by the point of sale to control the hardware. You will need to implement these methods to use your hardware. There is more documentation available for these methods in the addons/point_of_sale/static/src/js/devices.js file. 

Monday, 21 September 2015

What's the difference between inventory on hand and future inventory? | Odoo

The On Hand Inventory (or quantity on hand) is the quantity physically present in your warehouse.
The Forecasted Inventory (or future or virtual stock) is the actual quantity available, which is calculated according to the following formula: on hand inventory - outgoing + incoming. Virtual or forecasted stock is very useful because it shows what the salespeople can sell. If the forecasted stock is higher than the real stock, this means products will be coming in. If forecasted stock is smaller than on hand stock, certain products are reserved for other sales orders or work orders. 

Difference between inventory odoo openERP


Why these two concepts? 

It is clear that your forecasted inventory will decrease with each sale, but what about the on hand inventory?  If you have 10 products in your stock location and you sell one, your forecasted inventory will be 9, because there's one product less to sell.  However, the product is still physically present in your stock. The On Hand Inventory will remain at 10 until the product leaves your warehouse.  Depending on how many products still need to be shipped, your on hand inventory will usually be higher than your available inventory.
two concepts of inventory in odoo OpenERP
Of course, at some point in time on hand and forecasted quantity will synchronise when you receive and deliver all the orders that have been placed. But yet it is most likely that you want to offer more of a product then you have available, for instance in case of backorders or drop shipping, or that you might not want to sell the full quantity of a product, for instance if you want to use some of the products as samples. Whether you want to sell more than you have, or save some of what you have, these two concepts of On Hand and Forecasted Inventory can be very useful.
The Forecasted quantity is also used for Reordering Rules, meaning that such a rule takes into account the calculation of deliveries and receipts to come. To have Odoo generate stock replenishment proposals according to minimum / maximum stock for you, go to the menu Warehouse ‣ Configuration ‣ Reordering Rules (make sure Procurement is installed).
If the forecasted stock for the given location is lower than the minimum stock indicated in the rule, the system will automatically propose a procurement to increase the level of forecasted stock to the maximum level given in the rule.
In a reordering rule, when you indicate a warehouse, it suggests a stock location by default in that warehouse. You can change that default location when the scheduler completes.