Odoo Help

0

ERROR FIELD

By
Diogenes Ojeda
on 3/9/15, 5:58 PM 740 views

Hello everyone:

Why show me the following error in the following code?

from openerp import models, fields

class silkworm_sale_order(models.Model):
    
    _inherit = 'sale.order'
        
    _columns = {
    x_daterequired: fields.Date(string='Date Required'),
    x_rush: fields.boolean('Rush Order')

}
silkworm_sale_order()

NameError: name 'x_daterequired' is not defined

 

Thanks

 

 

1

Hi,

You have mix two different coding style.

In this you have import 

from openerp import models, fields

and make new class with "models.Model". All this code is new (Odoo V8) style. But you were define column is of old style. So, you just need to change as like below.

from openerp import models, fields

class silkworm_sale_order(models.Model):
    
    _inherit = 'sale.order'

    x_daterequired: fields.Date(string='Date Required'),
    x_rush: fields.Boolean('Rush Order')

I hope now you will get what you want.

 

Hello Empiro, thx, Yesterday I could fix this error, but look, you put that code, not working: Would the error that __name prpiedad missing. Best regard.

Nadie, Diogenes Ojeda
on 3/10/15, 9:50 AM
1
Hardikgiri Goswami
On 3/10/15, 11:39 AM

Hi,

@Emipro is right at the theoratical level. But the mentioned code have syntax error. The code should be something like.

No need to put __name.

class silkworm_sale_order(models.Model):
    
    _inherit = 'sale.order'

    x_daterequired = fields.Date(string='Date Required')
    x_rush = fields.Boolean('Rush Order')

I hope this will work for you.

Feel free to contact : hardikgiri.goswami@gmail.com

Both are right, Thank You

Nadie, Diogenes Ojeda
on 3/10/15, 11:47 AM
0
Diogenes Ojeda
On 3/10/15, 9:50 AM

Hello Empiro,

thx,

Yesterday I could fix this error, but look, you put that code, not working:

Would the error that __name prpiedad missing.


Best regard.

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.

Register

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)

Stats

Asked: 3/9/15, 5:58 PM
Seen: 740 times
Last updated: 3/16/15, 8:10 AM