Odoo Help


This community is for beginners and experts willing to share their Odoo knowledge. It's not a forum to discuss ideas, but a knowledge base of questions and their answers.


Products inventory storage location, add Field [Closed]

Andreas Marpmann
on 7/24/13, 7:08 AM 3,035 views

The Question has been closed

Andreas Marpmann
on 05/19/2014 02:06:18

On the products inventory page we have physical information for Rack, Row and Case, but not for the Room e. g. Room Number 213 or Basement.

This is only a information field without calculation.


Ray Carnes

--Ray Carnes--
| 9 7 9
Greater Los Angeles, United States
--Ray Carnes--

Senior Odoo Analyst

OpenERP 6.1, 7.0 and Odoo 8.0, 9.0 (Since 2012)

Completed Functional and Technical Training.

Major Skills:

  • Needs Discovery and Requirements Analysis;

  • Function and Technical Specifications;

  • Project Planning;

  • Prototyping and Proof of concepts;

  • Data migration;

  • Configuration & Customization (UI and modules);

  • Integration - data, business logic and service levels;

  • Training and Knowledge transfer;

  • Go Live support;

  • Help desk;

  • Version Migration.

I have over 20 years of experience empowering and enabling users with enterprise information systems that make a real and measurable difference in their ability to proactively manage their businesses and organizations. 

Ray Carnes
On 7/28/13, 12:39 AM

This can be done in two easy steps:

1) Add a field to the relevant OpenERP model, so it gets persisted in the database:

The model that defines the storage locations of a product is product.template

  • Navigate to Settings --> Technical --> Database Structure --> Models, find and open this model
  • Edit it and at the bottom, click Add an Item
  • Name the new Field x_loc_room and make it a char typem, width 75, and give it a label
  • Save the field and save your changes to the model

2) Add the new field to the releveant OpenERP view, so it gets shown to the user:

The view that defines how the loc_* fields are shown to the user is product.normal.procurement.locations.inherit

  • Navigate to Settings --> Technical --> User Interface --> Views, find and open this view
  • Edit it and find the Storage Location group
  • Add the new field to the bottom, hiding it if the product is a service, like this:

    <group name="store" string="Storage Location">
        <field name="company_id" groups="base.group_multi_company" widget="selection"/>
        <field name="loc_rack" attrs="{'invisible':[('type','=','service')]}"/>
        <field name="loc_row" attrs="{'invisible':[('type','=','service')]}"/>
        <field name="loc_case" attrs="{'invisible':[('type','=','service')]}"/>
        <field name="x_loc_room" attrs="{'invisible':[('type','=','service')]}"/>
  • Save your changes

You can now see the new field on the form:

image description

Hi Ray,

Thanks, it works for me.

Unfortunately, the view will be overwritten by upgrade the module "product".

OK, I can rewrite the view after the upgrade, data and field x_loc_room are visible again.

But I would like to understand the logic.

I'm working with Drupal for years. Fields and views by the user, will not be affected by module upgrades.

OpenERP-7.0-20130724 on Ubuntu 12.04

Metrolux Gmbh, Andreas Marpmann
on 7/29/13, 6:17 AM

You make the same changes in a module. Start with https://doc.openerp.com/trunk/server/03_module_dev_05/ - and you will also find plenty of documentation, tutorials and help on doing that via searching the web. Open a new question with specific problems you run into.

Bista Solutions US, Ray Carnes
on 8/2/13, 3:07 PM

About This Community

This community is for professionals and enthusiasts of our products and services. Read Guidelines

Question tools

0 follower(s)


Asked: 7/24/13, 7:08 AM
Seen: 3035 times
Last updated: 3/16/15, 8:10 AM