Odoo Help


Why is my new selection not saving?

AJ Schrafel Paper Corp
on 9/27/13, 7:48 PM 1,087 views

I want to add a new selection option above the supplier in the stock_picking_in form. It shows up and can be selected but it is not writing to the database, what am i doing wrong?

My Python:

class stock_picking_in(osv.osv):
    _inherit = "stock.picking.in"
    _table = "stock_picking"

    _columns = {
        'prod_type': fields.selection([('itemized','Itemized Product'),('product','Stockable Product'),('consu', 'Consumable'),('service','Service')], 'Product Type', required=True, help="Itemized: Every unit of this product is assigned a unique item number and can have unique attributes. \nConsumable: Will not imply stock management for this product. \nStockable product: Will imply stock management for this product."),        

    _defaults = {
        'prod_type': 'itemized',


<record id="view_picking_in_form_items" model="ir.ui.view">
        <field name="name">stock.picking.in.form</field>
        <field name="model">stock.picking.in</field>
        <field name="inherit_id" ref="stock.view_picking_in_form"/>
        <field name="arch" type="xml">
            <xpath expr="//field[@name='partner_id']" position="replace">
                    <field name="prod_type" string="Inventory Type"/>
                <field name="partner_id" on_change="onchange_partner_in(partner_id)" string="Supplier" domain="[('supplier','=',True)]" />
                <xpath expr="//field[@name='move_lines']" position="replace">
                <field name="move_lines" attrs="{'invisible': [('prod_type','=','itemized')]}" context="{'address_in_id': partner_id, 'picking_type': 'in', 'form_view_ref':'view_move_picking_form', 'tree_view_ref':'view_move_picking_tree'}" options='{"reload_on_button": true}'/>
                    <field name="move_lines" string="Itemized" attrs="{'invisible': [('prod_type','&lt;&gt;','itemized')]}" context="{'address_in_id': partner_id, 'picking_type': 'in', 'form_view_ref':'view_move_picking_form', 'tree_view_ref':'view_move_picking_tree'}" options='{"reload_on_button": true}'/>

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.


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)


Asked: 9/27/13, 7:48 PM
Seen: 1087 times
Last updated: 3/16/15, 8:10 AM