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.

0

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

By
Wided
on 7/6/15, 7:30 AM 308 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 community is for professionals and enthusiasts of our products and services. Read Guidelines

Question tools

1 follower(s)

Stats

Asked: 7/6/15, 7:30 AM
Seen: 308 times
Last updated: 7/6/15, 7:30 AM