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 'coef' does not exist in object 'browse_record(school.matiere, 1)'"

By
oumaima
on 6/19/13, 12:43 PM 2,277 views

Hi everyone i have this error when i try to add a new item: AttributeError: "Field 'coef' does not exist in object 'browse_record(school.matiere, 1)'"

any idea please

Class school_matiere(osv.osv):
''' matiere '''
_description ='Information sur les matieres'
_name = 'school.matiere'

_columns = {
    'name': fields.char('libelle matiere', size=64, required=True, select=1),
    'code': fields.char('Code matiere', size=20, required=True, select=1),
    'coef_mat': fields.integer('coefficient matiere'),
    'teacher_id': fields.many2one('hr.employee', 'Professeur'),
}
school_matiere()

.xml

<record model="ir.ui.view" id="view_school_matiere_form">
        <field name="name">school.matiere.form</field>
        <field name="model">school.matiere</field>
        <field name="type">form</field>
        <field name="arch" type="xml">
            <form string="Matiere" version="7.0">
            <sheet>
                <group col="6" colspan="4">
                    <field name="teacher_id" domain="[('job_id.name','=','prof')]"/>
                    <field name="name" />
                    <field name="code" />
                     <field name="coef_mat"/>
                </group>
                 </sheet>
            </form>
        </field>
    </record>
     <record model="ir.ui.view" id="view_school_matiere_tree">
        <field name="name">school.matiere.tree</field>
        <field name="model">school.matiere</field>
        <field name="type">tree</field>
        <field name="arch" type="xml">
            <tree string="classe Information" editable="bottom">
                <field name="name" />
                <field name="code" />
            </tree>
        </field>
    </record>
        <record model="ir.ui.view" id="view_school_matiere_search">
        <field name="name">school.matiere.search</field>
        <field name="model">school.matiere</field>
        <field name="type">search</field>
        <field name="arch" type="xml">
            <search string="Search">
            <group col="10" colspan="4">
                <field name="name" select="1"/>
                <separator orientation="vertical"/>
                <field name="code" select="1"/>
            </group>
            <newline/>
            <group expand="0" string="Group By" colspan="12" col="10">
                <filter icon="terp-stock_symbol-selection" string="Matiere" help="Matiere"  context="{'group_by':'name'}"/>
                <separator orientation="vertical"/>
                <filter icon="terp-personal" string="Code" help="code" context="{'group_by':'code'}"/>
                <separator orientation="vertical"/>

            </group>
            </search>
        </field>
    </record>
    <!-- Niveau Information Action -->
    <record model="ir.actions.act_window" id="action_school_matiere_form">
        <field name="name">Matiere</field>
        <field name="res_model">school.matiere</field>
        <field name="view_type">form</field>
        <field name="view_mode">tree,form</field>
    </record>
 <menuitem name="matiere" action="action_school_matiere_form" id="matiere" parent="menu_base" />
1

patrick

--patrick--
1958
| 5 4 7
Baarn, Netherlands
--patrick--
patrick
On 6/20/13, 4:59 PM

The message is about the module school_matiere not having a field called coef.

Your class school_matiere has defined the field 'coef_mat'. In all your code, I do not see coef.

Have you used coef in the past as field name? If so, reinstalling your module will fix this issue (what Ghanshyam Prajapati already said).

If you call some where else in a module the class school_matiere, have a look at that code.

Hi thank you for your reply,as i said to Ghanshyam Prajapati i updated my module and resolve the problem

oumaima
on 6/20/13, 5:31 PM
1

Ghanshyam Prajapati

--Ghanshyam Prajapati--
1377
| 4 4 8
Pune, India
--Ghanshyam Prajapati--
OpenERP Developer
Ghanshyam Prajapati
On 6/19/13, 1:44 PM

Hi, Oumaima

Please reinstall your module by command line like this :

-Go to your server path in command prompt(Terminal)

-Restart your server with following command for 7.0

python open-server --addons-path=your_addons_path -d database_name -u app_name

Hope this work for you.

Hi thank you for your reply; i tried this solution but it doesn't work.Finally i updated my module and get around the problem

oumaima
on 6/20/13, 5:29 PM

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

0 follower(s)

Stats

Asked: 6/19/13, 12:43 PM
Seen: 2277 times
Last updated: 3/16/15, 8:10 AM