Odoo Help


Customize by views inheritance Stock.picking.out search view v7

Yassine TEIMI
on 1/6/15, 5:36 AM 1,979 views

I want to add a Group by filter on stock_picking_out, on a custom field "commercial".

First of all I added this field on a custom module like this : 

import time
from openerp.osv import fields, osv, orm
from openerp.tools.translate import _

class StockPickingOut(orm.Model):

    _inherit = 'stock.picking.out'
    _name = 'stock.picking.out'
    _columns = {
       'commercial': fields.many2one('res.users','Commercial',readonly= True, required= True, ondelete='cascade'),
    _defaults = {
        'commercial': lambda s, cr, uid, c: uid,

class StockPicking(orm.Model):
    _inherit = 'stock.picking'
    _name = 'stock.picking'
    _columns = {
        'commercial': fields.many2one('res.users', 'Commercial', readonly= True, required= True, ondelete='cascade'),
    _defaults = {
        'commercial': lambda s, cr, uid, c: uid,


On XML side : 

        <record id="filter_per_commercial" model="ir.ui.view">
            <field name="name">picking.custom.search</field>
            <field name="model">stock.picking</field>
            <field name="inherit_id" ref="stock.view_picking_out_search"/>
            <field name="arch" type="xml">
                <xpath expr="//search/group/filter[@string='Status']" position="after">
                    <filter string="Commercial" icon="terp-stock_effects-object-colorize" domain="[]" context="{'group_by':'commercial'}"/>


There is no errors while loading my custom module, but the field Commercial doesn't appear on the Group by filter.

Any suggestions please.


Dhinesh - Technical Consultant, Sodexis Inc

--Dhinesh - Technical Consultant, Sodexis Inc--
| 5 4 9
Pondicherry, India
--Dhinesh - Technical Consultant, Sodexis Inc--

Passionate coder in Python/OpenERP. Knows Django/Flask MVC frameworks. Did code in Java, PHP.

Contact me at: dvdhinesh.mail@gmail.com

Dhinesh - Technical Consultant, Sodexis Inc
On 1/6/15, 5:47 AM

Change <field name="model">stock.picking</field> to <field name="model">stock.picking.out</field> in xml.

Yes thanks it was as simple as that. why the original view is makin stock.picking a source model ?

Yassine TEIMI
on 1/6/15, 5:53 AM

You might want to check if you have sale_journal module installed. It changed the model of view_picking_out_search from stock.picking to stock.picking.out.

on 1/6/15, 6:20 AM

@ivan : No it's not installed.

Yassine TEIMI
on 1/6/15, 7:20 AM

I think its not related to sale_journal. Take a look at stock.picking.in search view. It has correct model. I hope this is a bug https://bugs.launchpad.net/openobject-addons/+bug/1243640 if i m right.

Dhinesh - Technical Consultant, Sodexis Inc
on 1/6/15, 7:37 AM

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

3 follower(s)


Asked: 1/6/15, 5:36 AM
Seen: 1979 times
Last updated: 3/16/15, 8:10 AM