Community mailing list archives

Re: Problem extending state

by Anders Wallenquist <> - 08/27/2014 07:39:08
Den 2014-08-27 12:49, Kalpana Hemnani skrev:
<blockquote cite="" type="cite">
Hello Anders,

Put field name(instead of field string) as {'state': 'submitted'} instead {'status': 'submitted'}.

Hope this helps.
Thank you!

Your eyes are the first you get blind at ;-)

First error down. I still get the same error message...

Anders Wallenquist
<blockquote cite="" type="cite">

On Wed, Aug 27, 2014 at 4:03 PM, Anders Wallenquist <> wrote:
I'm trying to extend state in account.invoice.

class account_invoice(osv.osv):
     _inherit = "account.invoice"
     _columns = {
         'state': fields.selection([
             ],'Status', select=True, readonly=True, 
             help=' * The \'Draft\' status is used when a user is 
encoding a new and unconfirmed Invoice. \
             \n* The \'Submitted\' when invoice is in submitted 
status,invoice does not have an invoice number and waits for approval. \
             \n* The \'Pro-forma\' when invoice is in Pro-forma 
status,invoice does not have an invoice number. \
             \n* The \'Open\' status is used when user create invoice,a 
invoice number is generated.Its in open status till user does not pay 
invoice. \
             \n* The \'Paid\' status is set automatically when the 
invoice is paid. Its related journal entries may or may not be reconciled. \
             \n* The \'Cancelled\' status is used when user cancel 

     def invoice_submitted(self, cr, uid, ids, context=None,):
         for inv in self.browse(cr, uid, ids, context=context):
             self.pool.get('account.invoice').write(cr, uid, [], 
{'status': 'submitted'})
         return True
     'depends': ['account'],
import account_invoice

I get this error message:

The value "submitted" for the field "account.invoice.state" is not in 
the selection

What is my wrong doing?

Anders Wallenquist

Post to:

Thank You,
Kalpana Hemnani
Software Engineer

Post to: