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

Purchase order READONLY_STATES inherit

By
Divyang Jariwala
on 9/8/16, 5:58 AM 197 views

Hello Everyone,

I am customising in purchase order workflow.

i have added three new states in existing states.

i am done with everything but there is "READONLY_STATES" dictionary is declared for make fields readonly in particular states.

READONLY_STATES = {
'purchase': [('readonly', True)],
'done': [('readonly', True)],
'cancel': [('readonly', True)],

for that i write following code.

class PurchaseOrder(models.Model):
        _inherit = "purchase.order"
         READONLY_STATES = {
                    'open': [('readonly', True)],
                    'partial received': [('readonly', True)],
                    'received': [('readonly', True)],
                    'purchase': [('readonly', True)],
                    'done': [('readonly', True)],
                    'cancel': [('readonly', True)],
             }

but its not work.

I tried inherit it by importing class also but that is also not work.

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: 9/8/16, 5:58 AM
Seen: 197 times
Last updated: 9/8/16, 6:44 AM