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',
}
stock_picking_in()
My XML:
<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>
<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','<>','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}'/>
</xpath>
</field>
</record>
Does the new field exist in table
stock_picking
? Are there any error messages?