Odoo Help

--Jignesh Mehta--

Jignesh Mehta
On 5/4/16, 9:15 AM

Hello Vijay,

Inherit the sale Order and replace the partner_id field without attrs.

Try this (In your custom module)  :-

class SaleOrder(models.Model):

    _inherit = "sale.order"

    partner_id = fields.Many2one('res.partner', string='Customer', required=True, track_visibility='always')

Hope this will works for you.



Ankit H Gandhi(AHG)

--Ankit H Gandhi(AHG)--

| 6 5 6
Baroda, India
--Ankit H Gandhi(AHG)--

Learning Python..

Ankit H Gandhi(AHG)
On 5/4/16, 11:08 AM

Dear Vijay,

Please use below code.

class sale_order(osv.Model):

_inherit = 'sale.order'

_columns = {

'partner_id': fields.many2one('res.partner', 'Customer', readonly=True, states={'draft': [('readonly', False)], 'sent': [('readonly', False)], 'manual':[('readonly', False)], 'progress': [('readonly', False)]}, required=True, change_default=True, select=True, track_visibility='always'),


Hope this help for you !!!


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

1 follower(s)


Asked: 5/4/16, 5:15 AM
Seen: 643 times
Last updated: 5/11/16, 8:24 AM