Ir al contenido
Odoo Menú
  • Iniciar sesión
  • Pruébalo gratis
  • Aplicaciones
    Finanzas
    • Contabilidad
    • Facturación
    • Gastos
    • Hoja de cálculo (BI)
    • Documentos
    • Firma electrónica
    Ventas
    • CRM
    • Ventas
    • PdV para tiendas
    • PdV para restaurantes
    • Suscripciones
    • Alquiler
    Sitios web
    • Creador de sitios web
    • Comercio electrónico
    • Blog
    • Foro
    • Chat en vivo
    • eLearning
    Cadena de suministro
    • Inventario
    • Manufactura
    • PLM
    • Compras
    • Mantenimiento
    • Calidad
    Recursos humanos
    • Empleados
    • Reclutamiento
    • Vacaciones
    • Evaluaciones
    • Referencias
    • Flotilla
    Marketing
    • Redes sociales
    • Marketing por correo
    • Marketing por SMS
    • Eventos
    • Automatización de marketing
    • Encuestas
    Servicios
    • Proyectos
    • Registro de horas
    • Servicio externo
    • Soporte al cliente
    • Planeación
    • Citas
    Productividad
    • Conversaciones
    • Aprobaciones
    • IoT
    • VoIP
    • Artículos
    • WhatsApp
    Aplicaciones externas Studio de Odoo Plataforma de Odoo en la nube
  • Industrias
    Venta minorista
    • Librería
    • Tienda de ropa
    • Mueblería
    • Tienda de abarrotes
    • Ferretería
    • Juguetería
    Alimentos y hospitalidad
    • Bar y pub
    • Restaurante
    • Comida rápida
    • Casa de huéspedes
    • Distribuidora de bebidas
    • Hotel
    Bienes inmuebles
    • Agencia inmobiliaria
    • Estudio de arquitectura
    • Construcción
    • Gestión de bienes inmuebles
    • Jardinería
    • Asociación de propietarios
    Consultoría
    • Firma contable
    • Partner de Odoo
    • Agencia de marketing
    • Bufete de abogados
    • Adquisición de talentos
    • Auditorías y certificaciones
    Manufactura
    • Textil
    • Metal
    • Muebles
    • Comida
    • Cervecería
    • Regalos corporativos
    Salud y ejercicio
    • Club deportivo
    • Óptica
    • Gimnasio
    • Especialistas en bienestar
    • Farmacia
    • Peluquería
    Trades
    • Personal de mantenimiento
    • Hardware y soporte de TI
    • Sistemas de energía solar
    • Zapateros y fabricantes de calzado
    • Servicios de limpieza
    • Servicios de calefacción, ventilación y aire acondicionado
    Otros
    • Organización sin fines de lucro
    • Agencia para la protección del medio ambiente
    • Alquiler de anuncios publicitarios
    • Fotografía
    • Alquiler de bicicletas
    • Distribuidor de software
    Descubre todas las industrias
  • Odoo Community
    Aprende
    • Tutoriales
    • Documentación
    • Certificaciones
    • Capacitación
    • Blog
    • Podcast
    Fortalece la educación
    • Programa educativo
    • Scale Up! El juego empresarial
    • Visita Odoo
    Obtén el software
    • Descargar
    • Compara ediciones
    • Versiones
    Colabora
    • GitHub
    • Foro
    • Eventos
    • Traducciones
    • Conviértete en partner
    • Servicios para partners
    • Registra tu firma contable
    Obtén servicios
    • Encuentra un partner
    • Encuentra un contador
    • Contacta a un consultor
    • Servicios de implementación
    • Referencias de clientes
    • Soporte
    • Actualizaciones
    GitHub YouTube Twitter LinkedIn Instagram Facebook Spotify
    +1 (650) 691-3277
    Solicita una demostración
  • Precios
  • Ayuda

Odoo is the world's easiest all-in-one management software.
It includes hundreds of business apps:

  • CRM
  • e-Commerce
  • Contabilidad
  • Inventario
  • PoS
  • Proyectos
  • MRP
All apps
Debe estar registrado para interactuar con la comunidad.
Todas las publicaciones Personas Insignias
Etiquetas (Ver todo)
odoo accounting v14 pos v15
Acerca de este foro
Debe estar registrado para interactuar con la comunidad.
Todas las publicaciones Personas Insignias
Etiquetas (Ver todo)
odoo accounting v14 pos v15
Acerca de este foro
Ayuda

Module creation issues for v17

Suscribirse

Reciba una notificación cuando haya actividad en esta publicación

Se marcó esta pregunta
developmentdevelopementerrorhelp
3 Respuestas
3390 Vistas
Avatar
Justin hul

Hi everyone and thank you in advance for any assistance. Long time odoo user trying out some module creations. I am trying to create a module to hold data from excel. mass data. unfortunately running into issues and I am worried that it is my build - missing dependencies?
Here is my code can someone tell me where I am going wrong?




manifest.py


# -*- coding: utf-8 -*-

{

    'name': 'Alpha Jobs',

    'version': '1.0',

    'summary': 'Manage Alpha Jobs',

    'sequence': 10,

    'category': 'Uncategorized',

    'depends': ['base','contacts'],

    'data': [

        'security/ir.model.access.csv',

        'views/alpha_jobs_menus.xml',

        'views/alpha_jobs_views.xml',

        'views/alpha_jobs_actions.xml',

    ],

    'demo': [],

    'installable': True,

    'auto_install': False,

    'application': True,

}



---------------


alphajobs.py


from odoo import models, fields, api


class AlphaJobs(models.Model):

    _name = 'alpha.jobs'

    _description = 'Alpha Jobs'

    _rec_name = 'job_id'


    job_id = fields.Char(string='Job ID', compute='_compute_job_id', store=True, readonly=True, index=True)

    job_no = fields.Char('Job Number', required=True)

    sub_job_no = fields.Char('Sub Job Number')

    customer = fields.Many2one('res.partner', string='Customer')

    QUOTE_NO = fields.Char('Quote Number')

    QUOTE_SUB_NO = fields.Char('Quote Sub Number')

    ALCONTACT = fields.Char('Contact')

    ALDATE_OPENED = fields.Integer('Date Opened')

    ALDATE_DUE = fields.Integer('Alpha Date Due')

    DATE_SHIPPED = fields.Integer('Date Shipped')

    JOB_STATUS = fields.Char('Job Status')

    CUSTOMER_PO_NO = fields.Char('Customer PO Number')

    ALCLASS = fields.Char('Class')

    ORIENTATION = fields.Char('Orientation')

    CUSTOMER_PO = fields.Char('Customer PO')

    DWG_NO = fields.Char('Drawing Number')

    ALPART_NAME = fields.Char('Alpha Part Name')

    ALPART_CODE = fields.Char('ALpha Part Code')

    ALQTY = fields.Char('Quantity')

    PART_STATUS = fields.Char('Part Status')

    REQUIREMENT = fields.Char('Requirement')

    ALPRICE = fields.Char('Price(al)')

    ALTOTAL = fields.Char('Total(al)')

    ALTOTAL_GST = fields.Char('Including GST')

    SHIPPING_CHECK = fields.Char('Shipping Check')

    PC_SN = fields.Char('PC SN')

    ALSHIP_DATE = fields.Char('Ship Date')

    ALSHIP_QTY = fields.Char('Shipped Quantity')

    MFG_QTY = fields.Char('Manufactured Quantity')

    BO_QTY = fields.Char('Billed Quantity')

    ALSTOCK_QTY = fields.Char('Stock Quantity')

    JOBJOBID = fields.Char('Job job ID')

    MFG_CHECK = fields.Char('Manufacturing Check')

    ALDUE_DATE = fields.Char('Due Date')

    SHP_INV = fields.Char('Shop Invoice')

    INVOICE_QTY = fields.Char('Invoiced Quantity')

    C_OR_V = fields.Char('C or V')

    INV_NUM = fields.Char('Invoice Number')

    INV_DATE = fields.Char('Date Invoiced')

    INV_DUE_DATE = fields.Char('Inv Due Date')

    CUSTOMER_PO_NUM = fields.Char('Customer PO Number main')

    INV_CUSTOMER = fields.Char('Invoice Customer')

    INVOICELINEDESC = fields.Char('Invoice line Description')

    INVOICELINEQUANTITY = fields.Char('Invoice line Quantity')

    INVOICELINEAMOUNT = fields.Char('Invoice line Amount')

    CUSTOMFIELDBLACKLAWJOBNO = fields.Char('BL Job Number')

    INVGST = fields.Char('Invoice GST')

    II_INDEX = fields.Char('II Index')

    INV_ITEM = fields.Char('Invoice Item')

    PS_NO = fields.Char('PS Number')

    PI_INDEX = fields.Char('PI Index')

    PACKINGSLIP_NO = fields.Char('Packing Slip Number')

    ALITEM = fields.Char('Item')

    AL_QTY = fields.Char('AL Quantity')

    AL_DESCRIPTION = fields.Char('Description')

    WT = fields.Char('Weight')

    PURPOSE_AL = fields.Char('Purpose')

    PRICE_Al = fields.Char('Price al')

    PER_UNITS_AL = fields.Char('Per Units')

    T_WT = fields.Char('Total Weight')

    PART_NO_AL = fields.Char('Part Number')

    EXT_PRICE = fields.Char('Extended Price')

    PO_AL = fields.Char('PO Number')

    PART_NAME = fields.Char('Part Name')

    PI_INDEX = fields.Char('PI Index')

    AL_SN = fields.Char('Serial Number')

    SHIP_TO = fields.Char('Ship to')

    CO = fields.Char('CO')

    CUSTOMER_PO = fields.Char('Customer PO')

    SHIPPED_BY = fields.Char('Shipped by')

    CARRIER_AL = fields.Char('Carrier')

    PAYMENT_TYPE = fields.Char('Payment Type')

    DATE_SHIP_AL = fields.Char('Date Shipped AL')

    DWG_NO = fields.Char('Drawing Number')

    PART_CODE = fields.Char('Part Code')

    PART_NAME1 = fields.Char('Part Name1')

    REQUIREMENT = fields.Char('Requirement')

    QTY_AL = fields.Char('Quantity_AL')

    PRICEA = fields.Char('Price')

    AMOUNT_AL = fields.Char('Amount')

    MARKUP = fields.Char('Markup')

    TOTAL_CHARGE = fields.Char('Total Charge')

    PRICE_CHARGE = fields.Char('Price Charge')

    CHECK = fields.Char('Check')

    FINISH_DATE = fields.Char('Finish Date')

    PC_SN = fields.Char('PC_SN')

    JQJ_INDEX = fields.Char('JQJ_INDEX')

    DATE_OPENED = fields.Char('Job Date Opened')

    QUOTE_STS = fields.Char('Quote STS')

    ATTENTION = fields.Char('Attention')

    ATTEN_ID = fields.Char('Attention ID')

    SHIP_VIA = fields.Char('Ship Via')

    FOB = fields.Char('FOB')

    TERMS = fields.Char('Terms')

    DAYS = fields.Char('Days')

    CONTACT_AL = fields.Char('Alpha Contact')

    CONTACT_ID = fields.Char('Contact ID')

    REL_QUOTE_NO = fields.Char('Related Quote NO')

    # Link sub-jobs to their parent jobs

    parent_job_id = fields.Many2one('alpha.jobs', string='Parent Job')


    # One2many fields for purchases and employee entries

    purchase_ids = fields.One2many('alpha.purchase', 'job_id', string='Purchases')

    employee_time_ids = fields.One2many('alpha.employee.time', 'job_id', string='Employee Times')


    @api.depends('job_no', 'sub_job_no')

    def _compute_job_id(self):

        for record in self:

            job_id = record.job_no

            if record.sub_job_no:

                job_id += '-' + record.sub_job_no

            record.job_id = job_id


    @api.constrains('job_id')

    def _check_unique_job_id(self):

        for record in self:

            existing_record = self.search([('job_id', '=', record.job_id)])

            if len(existing_record) > 1 or (len(existing_record) == 1 and existing_record != record):

                raise ValidationError("Job ID '%s' already exists. Please choose a unique Job ID." % record.job_id)



class AlphaEmployeeTime(models.Model):

    _name = 'alpha.employee.time'

    _description = 'Alpha Employee Time'


    # Define fields to store employee entries

    job_id = fields.Many2one('alpha.jobs', string='Job')

    Name = fields.Char(string='Employee Name')

    EMDATE = fields.Date('Date of Work')

    EMPLOYEE_DESCRIPTION = fields.Text('Work Description')

    REGULAR_HOURS = fields.Float('Regular Hours')

    EMPLOYEE_ID = fields.Char('Employee ID')

    EMPLOYEE_STATION = fields.Char('Station')

    EMNAME = fields.Char('Name')

    EMPLYEE_OVERTIME = fields.Float('Overtime')

    EMPLOYEE_REG_HRS = fields.Float('Employee Regular Hours')

    TOTAL_STATION_HRS = fields.Float('Total Station Hours')



class AlphaPurchase(models.Model):

    _name = 'alpha.purchase'

    _description = 'Alpha Purchase'


    # Define fields to store purchase information

    job_id = fields.Many2one('alpha.jobs', string='Job')

    POITEM_INDEX = fields.Char(string='PO Item Index')

    POITEM = fields.Char(string='PO Item')

    PORF_NO = fields.Char(string='PO Reference Number')

    VENDOR = fields.Char(string='Vendor')

    PODATE = fields.Date(string='PO Date')

    SHIPPING_TO = fields.Char(string='Shipping to')

    PO_AL = fields.Char(string='PO Number')

    PART_NO_AL = fields.Char(string='Part Number')

    PART_NAME = fields.Char(string='Part Name')

    QTY_AL = fields.Char(string='Quantity')

    PRICEA = fields.Char(string='Price')

    AMOUNT_AL = fields.Char(string='Amount')

    AL_SN = fields.Char(string='Serial Number')

    SHIP_TO = fields.Char(string='Ship to')

    CO = fields.Char(string='CO')

    CUSTOMER_PO = fields.Char(string='Customer PO')

    SHIPPED_BY = fields.Char(string='Shipped by')

    CARRIER_AL = fields.Char(string='Carrier')

    PAYMENT_TYPE = fields.Char(string='Payment Type')

    DATE_SHIP_AL = fields.Char(string='Date Shipped AL')

    DWG_NO = fields.Char(string='Drawing Number')

    PART_CODE = fields.Char(string='Part Code')

    PART_NAME1 = fields.Char(string='Part Name1')

    REQUIREMENT = fields.Char(string='Requirement')

    PRICE_CHARGE = fields.Char(string='Price Charge')

    CHECK = fields.Char(string='Check')

    FINISH_DATE = fields.Char(string='Finish Date')

    PC_SN = fields.Char(string='PC_SN')

    JQJ_INDEX = fields.Char(string='JQJ_INDEX')




---------------


ir.model.access.csv


id,name,model_id:id,group_id:id,perm_read,perm_write,perm_create,perm_unlink

access_alpha_jobs,model_alpha_jobs,model_alpha_jobs,base.group_user,1,1,1,1


---------------


alpha_jobs_menus.xml

   

 

   

       

           

           

       

   


---------------


alpha_jobs_views.xml


   


       

       

            Alpha Jobs Tree

            alpha.jobs

            tree,form

            []

       


       

       

            Alpha Jobs Kanban

            alpha.jobs

            kanban,form

            []

       


   




   


---------------


alpha_jobs_actions.xml

   

       

       

            Alpha Jobs

            alpha.jobs

            tree,form,kanban

            []

            {}

           

               

                    Click to create a new record.

               

           

       


       

       

            Alpha Jobs Kanban

            alpha.jobs

            kanban,tree,form

            []

            {}

           

               

                    Click to create a new record.

               

           

       

   


   



0
Avatar
Descartar
Justin hul
Autor


alpha_jobs_menus.xml

<?xml version="1.0" encoding="utf-8"?>
<odoo>
<menu id="menu_alpha_jobs_root" name="Alpha Jobs" sequence="10">
<menuitem id="menu_alpha_jobs_tree" name="Alpha Jobs Tree" parent="menu_alpha_jobs_root" action="action_alpha_jobs_tree" sequence="10" />
<menuitem id="menu_alpha_jobs_kanban" name="Alpha Jobs Kanban" parent="menu_alpha_jobs_root" action="action_alpha_jobs_kanban" sequence="20" />
</menu>
</odoo>

---------------

alpha_jobs_views.xml

<?xml version="1.0" encoding="utf-8"?>
<odoo>
<data>

<!-- Action for Tree View -->
<record id="action_alpha_jobs_tree" model="ir.actions.act_window">
<field name="name">Alpha Jobs Tree</field>
<field name="res_model">alpha.jobs</field>
<field name="view_mode">tree,form</field>
<field name="domain">[]</field>
</record>

<!-- Action for Kanban View -->
<record id="action_alpha_jobs_kanban" model="ir.actions.act_window">
<field name="name">Alpha Jobs Kanban</field>
<field name="res_model">alpha.jobs</field>
<field name="view_mode">kanban,form</field>
<field name="domain">[]</field>
</record>

</data>
</odoo>

---------------

alpha_jobs_actions.xml

<?xml version="1.0" encoding="utf-8"?>
<odoo>
<data>
<!-- Action for Tree View -->
<record id="action_alpha_jobs_tree" model="ir.actions.act_window">
<field name="name">Alpha Jobs</field>
<field name="res_model">alpha.jobs</field>
<field name="view_mode">tree,form,kanban</field>
<field name="domain">[]</field>
<field name="context">{}</field>
<field name="help" type="html">
<p class="oe_view_nocontent_create">
Click to create a new record.
</p>
</field>
</record>

<!-- Action for Kanban View -->
<record id="action_alpha_jobs_kanban" model="ir.actions.act_window">
<field name="name">Alpha Jobs Kanban</field>
<field name="res_model">alpha.jobs</field>
<field name="view_mode">kanban,tree,form</field>
<field name="domain">[]</field>
<field name="context">{}</field>
<field name="help" type="html">
<p class="oe_view_nocontent_create">
Click to create a new record.
</p>
</field>
</record>
</data>
</odoo>

won't let me edit my original post

Avatar
Lawrence
Mejor respuesta

Hello.


I've never seen and tried your code before in terms of creating menus in Odoo.

I think you should try to remove the menu tag and don't forget to the end tag.


   

 



try this instead.


<?xml version="1.0" encoding="utf-8"?>

<odoo>

<menuitem id="menu_alpha_jobs_root" name="Alpha Jobs" sequence="10"/>

/cp<menuitem id="menu_alpha_jobs_tree" name="Alpha Jobs Tree" parent="menu_alpha_jobs_root" action="action_alpha_jobs_tree" sequence="10" />

<menuitem id="menu_alpha_jobs_kanban" name="Alpha Jobs Kanban" parent="menu_alpha_jobs_root" action="action_alpha_jobs_kanban" sequence="20" />

</odoo>



menu_alpha_jobs_root is your main menu or root menu, the parent of your menu (Alpha Jobs Tree and Alpha Jobs Kanban)

instead of menu tag make it menuitem

like menuitem id="menu_alpha_jobs_root" 




0
Avatar
Descartar
Justin hul
Autor

Thank you I will try this. will mark as solved if it works.

Justin hul
Autor

ParseError('while parsing %s:%s, somewhere inside\n%s' % (
views/alpha_jobs_menus.xml:5, somewhere inside
<menuitem id="menu_alpha_jobs_tree" name="Alpha Jobs Tree" parent="menu_alpha_jobs_root" action="action_alpha_jobs_tree" sequence="10"/>

in reviewing my code it is all wrong...
going to have to rebuild my views I think.
Can anyone link me to a proper view example for tree form and kanban v17. thanks in advance

Lawrence

ParseError('while parsing %s:%s, somewhere inside\n%s' % (
views/alpha_jobs_menus.xml:5, somewhere inside
<menuitem id="menu_alpha_jobs_tree" name="Alpha Jobs Tree" parent="menu_alpha_jobs_root" action="action_alpha_jobs_tree" sequence="10"/>

I think the error shows because in my given xml code it has extra letters "/cp" before the <menuitem id="menu_alpha_jobs_tree" ~ remove it, don't copy and paste all my code.

Lawrence

<?xml version="1.0" encoding="utf-8"?>

<odoo>

<menuitem id="menu_alpha_jobs_root" name="Alpha Jobs" sequence="10"/>

<menuitem id="menu_alpha_jobs_tree" name="Alpha Jobs Tree" parent="menu_alpha_jobs_root" action="action_alpha_jobs_tree" sequence="10" />

<menuitem id="menu_alpha_jobs_kanban" name="Alpha Jobs Kanban" parent="menu_alpha_jobs_root" action="action_alpha_jobs_kanban" sequence="20" />

</odoo>

try this.

Justin hul
Autor

I actually removed that when trying your code. still parse error.

Avatar
Justin hul
Autor Mejor respuesta

thank you for the reply.

The module installs - up to views and menus

Log error

views/alpha_jobs_menus.xml' does not fit the required schema!

AssertionError: Element odoo has extra content: menu, line 3 


Problem is no matter what I do to change this, removed

changed to , even changed the menu and view structure and load sequence in manifest. will not install the menus/views
0
Avatar
Descartar
Niyas Raphy (Walnut Software Solutions)

the error saying that the file alpha_jobs_menus is not written in proper xml syntax

Justin hul
Autor

alpha_jobs_menus.xml

<?xml version="1.0" encoding="utf-8"?>
<odoo>
<menu id="menu_alpha_jobs_root" name="Alpha Jobs" sequence="10">
<menuitem id="menu_alpha_jobs_tree" name="Alpha Jobs Tree" parent="menu_alpha_jobs_root" action="action_alpha_jobs_tree" sequence="10" />
<menuitem id="menu_alpha_jobs_kanban" name="Alpha Jobs Kanban" parent="menu_alpha_jobs_root" action="action_alpha_jobs_kanban" sequence="20" />
</menu>
</odoo>

indentation is proper in the .xml. I have used this menu structure previous. never with v17
should it be different?

Niyas Raphy (Walnut Software Solutions)

<menu id= its wrong,

the Keyword is menuitem as mentioned by Lawrence

See: https://www.youtube.com/watch?v=kxbPgOLkNxw&list=PLqRRLx0cl0hq0T4SV-BHhCicWOpzyWcHd

Avatar
Niyas Raphy (Walnut Software Solutions)
Mejor respuesta

Hi,
Along with the post try adding the information regarding the issue ? Is it getting installed ? Any exceptions are raised ? such information is missing.

So answering generically, you can refer to this tutorial:  Odoo 17 Development Tutorials

Thanks

0
Avatar
Descartar
¿Le interesa esta conversación? ¡Participe en ella!

Cree una cuenta para poder utilizar funciones exclusivas e interactuar con la comunidad.

Registrarse
Publicaciones relacionadas Respuestas Vistas Actividad
Issue on Account move lline
error help account.move.line
Avatar
Avatar
Avatar
3
dic 23
6733
When i click on Print Button RML get error
development error rml
Avatar
Avatar
1
mar 15
6516
How do I deal with the "Invalid XML for View Architecture!" error?
development error view
Avatar
Avatar
Avatar
2
mar 15
7820
How To Hide User Group From Users Form View In Odoo
development error users group
Avatar
Avatar
Avatar
Avatar
4
sept 25
2683
odoo 15 development error
development error v15 psycopg2.errors
Avatar
Avatar
1
jul 24
4767
Comunidad
  • Tutoriales
  • Documentación
  • Foro
Código abierto
  • Descargar
  • GitHub
  • Runbot
  • Traducciones
Servicios
  • Alojamiento en Odoo.sh
  • Soporte
  • Actualizaciones del software
  • Desarrollos personalizados
  • Educación
  • Encuentra un contador
  • Encuentra un partner
  • Conviértete en partner
Sobre nosotros
  • Nuestra empresa
  • Activos de marca
  • Contáctanos
  • Empleos
  • Eventos
  • Podcast
  • Blog
  • Clientes
  • Legal • Privacidad
  • Seguridad
الْعَرَبيّة Català 简体中文 繁體中文 (台灣) Čeština Dansk Nederlands English Suomi Français Deutsch हिंदी Bahasa Indonesia Italiano 日本語 한국어 (KR) Lietuvių kalba Język polski Português (BR) română русский язык Slovenský jazyk slovenščina Español (América Latina) Español ภาษาไทย Türkçe українська Tiếng Việt

Odoo es un conjunto de aplicaciones de código abierto que cubren todas las necesidades de tu empresa: CRM, comercio electrónico, contabilidad, inventario, punto de venta, gestión de proyectos, etc.

La propuesta única de valor de Odoo es ser muy fácil de usar y estar totalmente integrado.

Website made with

Odoo Experience on YouTube

1. Use the live chat to ask your questions.
2. The operator answers within a few minutes.

Live support on Youtube
Watch now