Odoo Help

0

Products inventory storage location, add Field [Closed]

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

The Question has been closed

by
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.

1
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')]}"/>
    </group>
    
  • 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 platform 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.

Register

Odoo Training Center

Access to our E-learning platform and experience all Odoo Apps through learning videos, exercises and Quizz.

Test it now

Question tools

0 follower(s)

Stats

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