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

Field created in database but not getting saved

By
Zakir Husain
on 5/3/16, 3:18 PM 260 views

I have create a module in that all fields are created but when i am saving record some field are not getting saved it shows me a warning message that they field are not found. but when i checked in DB those field are created in DB.


this is my model


_columns = {

'name':fields.char('Name', size=240, required=True),

'code':fields.char('Code', size=30, required=True),

'namel2':fields.char('Second Name', size=240),

'company_id':fields.many2one('res.company', 'Company', required=True, copy=False),

'exclude_transfer':fields.boolean('Exclude Transfer'), 

'debit_mainaccount_code': fields.char('Debit Main Account Code', size=20),

'credit_mainaccount_code': fields.char('Credit Main Account Code', size=20),

'is_fixed': fields.boolean('Is Fixed'),

'active':fields.boolean('Active', help="If the active field is set to false, it will allow you to hide the salary component without removing it."),

}

Is Fixed , debit_mainaccount_code, exclude_transfer,debit_mainaccount_code are not found in that module.

can someone help ?

0

Ankit H Gandhi(AHG)

--Ankit H Gandhi(AHG)--
996
| 5 3 6
Rajkot, India
--Ankit H Gandhi(AHG)--

Learning Python..

Ankit H Gandhi(AHG)
On 5/4/16, 7:15 AM

Dear Zakir Husain,

Your code is working good but you need to set value 'True' of active boolean fields.

Like

_defaults = {

'active': True

}

Hope above code help for you.

Cheers,

Ankit H Gandhi.

0

Need more info, is this an inherited model? What model is it? What does the xml look like? or do you create the records in code?

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: 5/3/16, 3:18 PM
Seen: 260 times
Last updated: 5/4/16, 7:15 AM