Odoo Help


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

on 7/6/15, 7:30 AM 675 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.

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