0

Am a newbie in Odoo Development. I created a Module Named Mytransaction. My Module code will be like this:-

 class mytrans(osv.osv):
    _name= "mytrans"
    _description= "My Transaction"

    _coloums = {
        'subject': fields.char("Subject",required=True),
        'date' : fields.date("Date",required=True),
        'note' : fields.text("Notes"),
        'amount' : fields.float("Amount",required=True),
        'type' : fields.selection([
            ('transport','Transport'),
            ('household','Household'),
            ('personal','Personal'),
            ], 'Type',required=True),

    }

When tried to install, its succesfully Installed...But when I activated the developer mode & checked Database structure-> Model fields, its like no fields added in model is showing? How can I resolve this? How can I create fields from model?

Peniel
  • 203
  • 3
  • 5
  • 16
  • 2
    `_columns` is mistyped. – Daniel Reis Feb 28 '16 at 09:57
  • I done it in different way.Actually... What I done is that.. i activated the developer mode & add fields from their... Is that the correct way to do this? – Peniel Feb 28 '16 at 13:57
  • If you did so, you don't have a module to install, as the question states. I'm afraid your question is far from clear. – Daniel Reis Feb 28 '16 at 18:53
  • Actually now its working.... My question is is this the correct way to do it? – Peniel Feb 29 '16 at 05:04
  • No, it is not. You should have corrected the `_columns` mispelling and upgraded the module. – Alessandro Ruffolo Feb 29 '16 at 08:40
  • whats the diff between defining module like class Details(models.Model): _name = 'projectapp.details' _inherit ='project.project' description = fields.Text(string="Description") note = fields.Text(string="Note") amount = fields.Float() regdate =fields.Date() . Here it is not using colums function? is that same? – Peniel Feb 29 '16 at 11:32
  • @Peniel `osv.osv` it is old API. `models.Model` it is new API.You can read about this [HERE](https://www.odoo.com/documentation/9.0/reference/orm.html#compatibility-between-new-api-and-old-api) . – Danila Ganchar Feb 29 '16 at 20:28

0 Answers0