Odoo Help

Welcome!

This community 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.

3

Jignesh Mehta

--Jignesh Mehta--
2081
| 6 4 8
Surat, India
--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.

Thanks,

0

Ankit H Gandhi(AHG)

--Ankit H Gandhi(AHG)--
996
| 5 3 6
Rajkot, 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 !!!

Cheers,

Your Answer

Please try to give a substantial answer. If you wanted to comment on the question or answer, just use the commenting tool. Please remember that you can always revise your answers - no need to answer the same question twice. Also, please don't forget to vote - it really helps to select the best questions and answers!

About This Community

This community is for professionals and enthusiasts of our products and services. Read Guidelines

Question tools

1 follower(s)

Stats

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