ello,
I'm a beginner, but I want to customize myself some odoo module.
First, I want to add a field maned "NISS" in to the employee module.
This field must be located after the field "name"
My code is wrong, but i don't no why :
_manifest_.py
# -*- coding: utf-8 -*-
{
'name': 'Gestion du personnel ',
'version': '1.0',
'category': '',
'sequence': 5,
'summary': 'Module gestion personnel pour - modification du module employé existant',
'description': "Module de gestion du personnel et sous traitants",
'website': 'https://www.dimdim.be',
'depends':['base','hr',],
'data': [
#
'views/custom_employees_view.xml',
],
'demo': [
'',
],
'css': [''],
'installable': True,
'application': False,
'auto_install': False
}
_init_.py
# -*- coding: utf-8 -*-
from . import custom_employees
custom_employees.py
from odoo import models, fields
class custom_info(models.Model):
_inherit = 'hr.employee'
NISS = fields.Char(string="NISS : ", required=True)
custom_employees_view.xml
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<record id="viewcustom_employee" model="ir.ui.view">
<field name="name">viewcustom.employee</field>
<field name="model">hr.employee</field>
<field name="inherit_id" ref="hr.view_employee_form"/>
<field name="arch" type="xml">
<field name="name" position="after"/>
<field name="NISS"/>
</field>
</record>
</odoo>
Error message when installing :
odoo.tools.convert.ParseError: "L'élément '<field name="NISS">' ne peut être localisé dans la vue parente Contexte de l'erreur : Vue `viewcustom.employee` [view_id: 466, xml_id: n/a, model: hr.employee, parent_id: 418]" while parsing /opt/odoo13/odoo-custom-addons/custom_employees/views/custom_employees_view.xml:2, near <odoo> <record id="viewcustom_employee" model="ir.ui.view"> <field name="name">viewcustom.employee</field> <field name="model">hr.employee</field> <field name="inherit_id" ref="hr.view_employee_form"/> <field name="arch" type="xml"> <data><field name="name" position="after"/> <field name="NISS"/> </data></field> </record> </odoo>
Somebody can help me ?
Thanks
If you are new to odoo development, check this out: https://www.youtube.com/watch?v=z1Tx7EGkPy0&list=PLqRRLx0cl0hoJhjFWkFYowveq2Zn55dhM&index=11