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

AttributeError : Field does not exist

By
ibra
on 3/30/16, 5:08 AM 703 views

Hello guys, 

please i have an attributeError that i don't understan. In fact, i have declared the fields i need in my .py but when executing it says to me AttributeError: Field `motif` does not exist "
My .py looks like this : 

class wizard(models.TransientModel):

    _inherit = "al.validfr.wizard", "al.novalidfr.wizard", "al.agency", "al.ouv.fr"

    _name = "bi.wizard.caisse"

    montant = fields.Integer(string="Mont", help="montant de C")

    motif = fields.Selection([

             ('Ch.Eau', 'water'),

             ('Ch.Electricité', 'Electricity'),

             ('Ch.dép', 'Déplacement'),

             ], help="les charges")

    state = fields.Selection([

             ('active', "Ouverte"),

            ('closed', "Fermée")

            ], default='active')

My View file looks like this : 

<record id="view_charges_tree" model="ir.ui.view">

     <field name="name">charges.tree</field>

    <field name="model">bi.wizard.caisse</field>

    <field name="arch" type="xml">

         <tree string="Les charges par agence">

             <field name="name"/>

             <field name="motif"/>

             <field name="montant"/>

             <field name="state"/>

         </tree>

    </field>

</record>


Thanks in advance.



0

Odoo

--Odoo --
1328
| 5 2 5
kerala, India
--Odoo --

Working as a Odoo Functional and Technical Expert

Odoo
On 3/30/16, 6:10 AM

  class SomeModel(models.Model):

_inherits = 'some.model'

type = fields.Selection(selection_add=[('b', 'B'), ('c', 'C')])   

0
Karim OUBHAT
On 3/30/16, 6:00 AM

first, check the database to see if "motif" is created.

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: 3/30/16, 5:08 AM
Seen: 703 times
Last updated: 3/30/16, 6:10 AM