Pular para o conteúdo
Menu
Esta pergunta foi sinalizada
4052 Visualizações

I have a custom module. As soon as i try to put 'name' field in any of the views, it gives error that Field 'name' does not exist. No idea where am i going wrong



from openerp import models, fields, api
class Employee(models.Model):
    _name = 'afemployee'    _inherit = 'mail.thread'
    name = fields.Char(required=True, track_visibility='onchange')    state = fields.Selection([('active', 'Active'),('termed', 'Termed')], default='active', track_visibility='onchange')    empid = fields.Integer(required=True, track_visibility='onchange')



<?xml version="1.0" encoding="UTF-8"?><openerp>    <data>
        <menuitem name="Afiniti" id="menu_root" sequence="110"/>
        <menuitem name="Employee Info" id="menu_employee_info" parent="menu_root"/>
        <record model="ir.actions.act_window" id="action_employee">            <field name="name">Employee</field>            <field name="res_model">afemployee</field>            <field name="view_mode">tree,form</field>        </record>
        <menuitem name="Employee" id="menu_employee" parent="menu_employee_info"            sequence="1" action="action_employee"/>


        <record model="ir.ui.view" id="employee_tree">            
        <field name="name">employee_tree_view</field>
        <field name="model">afemployee</field>
        <field name="arch" type="xml">
            <tree string="Employee">
                <field name='empid'/>
                <field name='designation'/>
                <field name='team'/>
            </tree>
        </field>
 </record>



Avatar
Cancelar

Nothing is wrong with your code. I think you are doing something wrong at other place. Try to find out and solve it. Because i tested your code and nothing is wrong with it.

Publicações relacionadas Respostas Visualizações Atividade
7
fev. 19
13406
2
dez. 19
2522
0
nov. 18
3092
0
dez. 19
4388
2
nov. 23
7194