Odoo Help


How to make a field required only for one company in multi-company environment?

on 7/6/15, 7:30 AM 350 views

I have two companies and I'd like that the field analytic account in the invoice lines becomes a required field only for one company.

I did this:

class account_invoice_line(osv.osv):

_inherit = 'account.invoice.line'

_columns = {

'account_analytic_id': fields.many2one('account.analytic.account', 'Analytic Account', required=True),


The field is now required for my two companies, but I don't have analytic accounting for both of my companies.

In settings > Configuration > accounting, when I uncheck "Analytic accounting for sales ", it is unchecked in both companies. When I check it, it is checked in both companies!

If that field would not appear for one of the companies, that would be good too.

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 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: 7/6/15, 7:30 AM
Seen: 350 times
Last updated: 7/6/15, 7:30 AM