Odoo Help

2

0
4 Answers
1
Avatar

Cyril Gaspard (GEM) France

--Cyril Gaspard (GEM)--
4364
| 6 6 10
Paris, France
--Cyril Gaspard (GEM)--

Forum contributor since 2008

Rank #1 on first OpenERP forum

OpenERP award "Top Contributor" 2011, for my actions on forum

Odoo forum moderator


Cyril Gaspard (GEM) France
3/20/15, 3:47 PM

Hi,

you can override default_get function in your class sale_order like this :


def default_get(self, cr, uid, fields, context=None):

     context = context or {}

     res = super(sale_order, self).default_get(cr, uid, fields, context=context)

     if 'name' in fields:

         res.update({'name': '/'})

     if 'salesman_id' in fields:

         res.update({'salesman_id': uid})

     if 'picking_type_id' in fields:

         res.update({'picking_type_id': False})

     if 'partner_ref' in fields:

         res.update({'partner_ref': 'try'})

    return res

bye


0
samara India
4/30/19, 1:39 AM

thank you for the reply


0
Edy Kendengis Indonesia
3/20/15, 10:39 AM

you must rewrite the code like this in your new module

_columns = {

    'picking_type_id': fields.many2one('stock.picking.type', 'Deliver To', help="This will determine picking type of incoming       shipment", required=True,

states={'confirmed': [('readonly', True)], 'approved': [('readonly', True)], 'done': [('readonly', True)]}),

}

Ask a Question
Writer
Tag
Keep Informed
1 follower(s)
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