Se rendre au contenu
Odoo Menu
  • Se connecter
  • Essai gratuit
  • Applications
    Finance
    • Comptabilité
    • Facturation
    • Notes de frais
    • Feuilles de calcul (BI)
    • Documents
    • Signature
    Ventes
    • CRM
    • Ventes
    • PdV Boutique
    • PdV Restaurant
    • Abonnements
    • Location
    Sites web
    • Site Web
    • eCommerce
    • Blog
    • Forum
    • Live Chat
    • eLearning
    Chaîne d'approvisionnement
    • Inventaire
    • Fabrication
    • PLM
    • Achats
    • Maintenance
    • Qualité
    Ressources Humaines
    • Employés
    • Recrutement
    • Congés
    • Évaluations
    • Recommandations
    • Parc automobile
    Marketing
    • Marketing Social
    • E-mail Marketing
    • SMS Marketing
    • Événements
    • Marketing Automation
    • Sondages
    Services
    • Projet
    • Feuilles de temps
    • Services sur Site
    • Assistance
    • Planification
    • Rendez-vous
    Productivité
    • Discussion
    • Validations
    • Internet des Objets
    • VoIP
    • Connaissances
    • WhatsApp
    Applications tierces Odoo Studio Plateforme Cloud d'Odoo
  • Industries
    Commerce de détail
    • Librairie
    • Magasin de vêtements
    • Magasin de meubles
    • Épicerie
    • Quincaillerie
    • Magasin de jouets
    Food & Hospitality
    • Bar et Pub
    • Restaurant
    • Fast-food
    • Maison d’hôtes
    • Distributeur de boissons
    • Hôtel
    Immobilier
    • Agence immobilière
    • Cabinet d'architecture
    • Construction
    • Gestion immobilière
    • Jardinage
    • Association de copropriétaires
    Consultance
    • Cabinet d'expertise comptable
    • Partenaire Odoo
    • Agence Marketing
    • Cabinet d'avocats
    • Aquisition de talents
    • Audit & Certification
    Fabrication
    • Textile
    • Métal
    • Meubles
    • Alimentation
    • Brewery
    • Cadeaux d'entreprise
    Santé & Fitness
    • Club de sports
    • Opticien
    • Salle de fitness
    • Praticiens bien-être
    • Pharmacie
    • Salon de coiffure
    Trades
    • Bricoleur
    • Matériel informatique et support
    • Systèmes photovoltaïques
    • Cordonnier
    • Services de nettoyage
    • Services CVC
    Autres
    • Organisation à but non lucratif
    • Agence environnementale
    • Location de panneaux d'affichage
    • Photographie
    • Leasing de vélos
    • Revendeur de logiciel
    Browse all Industries
  • Communauté
    Apprenez
    • Tutoriels
    • Documentation
    • Certifications
    • Formation
    • Blog
    • Podcast
    Renforcer l'éducation
    • Programme éducatif
    • Business Game Scale-Up!
    • Rendez-nous visite
    Obtenir le logiciel
    • Téléchargement
    • Comparez les éditions
    • Versions
    Collaborer
    • Github
    • Forum
    • Événements
    • Traductions
    • Devenez partenaire
    • Services for Partners
    • Enregistrer votre cabinet comptable
    Nos Services
    • Trouver un partenaire
    • Trouver un comptable
    • Rencontrer un conseiller
    • Services de mise en œuvre
    • Références clients
    • Assistance
    • Mises à niveau
    Github Youtube Twitter Linkedin Instagram Facebook Spotify
    +1 (650) 691-3277
    Obtenir une démonstration
  • Tarification
  • Aide

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

  • CRM
  • e-Commerce
  • Comptabilité
  • Inventaire
  • PoS
  • Projet
  • MRP
All apps
Vous devez être inscrit pour interagir avec la communauté.
Toutes les publications Personnes Badges
Étiquettes (Voir toutl)
odoo accounting v14 pos v15
À propos de ce forum
Vous devez être inscrit pour interagir avec la communauté.
Toutes les publications Personnes Badges
Étiquettes (Voir toutl)
odoo accounting v14 pos v15
À propos de ce forum
Aide

Module creation issues for v17

S'inscrire

Recevez une notification lorsqu'il y a de l'activité sur ce poste

Cette question a été signalée
developmentdevelopementerrorhelp
3 Réponses
3398 Vues
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
Ignorer
Justin hul
Auteur


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
Meilleure réponse

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
Ignorer
Justin hul
Auteur

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

Justin hul
Auteur

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
Auteur

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

Avatar
Justin hul
Auteur Meilleure réponse

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
Ignorer
Niyas Raphy (Walnut Software Solutions)

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

Justin hul
Auteur

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)
Meilleure réponse

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
Ignorer
Vous appréciez la discussion ? Ne vous contentez pas de lire, rejoignez-nous !

Créez un compte dès aujourd'hui pour profiter de fonctionnalités exclusives et échanger avec notre formidable communauté !

S'inscrire
Publications associées Réponses Vues Activité
Issue on Account move lline
error help account.move.line
Avatar
Avatar
Avatar
3
déc. 23
6763
When i click on Print Button RML get error
development error rml
Avatar
Avatar
1
mars 15
6517
How do I deal with the "Invalid XML for View Architecture!" error?
development error view
Avatar
Avatar
Avatar
2
mars 15
7821
How To Hide User Group From Users Form View In Odoo
development error users group
Avatar
Avatar
Avatar
Avatar
4
sept. 25
2694
odoo 15 development error
development error v15 psycopg2.errors
Avatar
Avatar
1
juil. 24
4769
Communauté
  • Tutoriels
  • Documentation
  • Forum
Open Source
  • Téléchargement
  • Github
  • Runbot
  • Traductions
Services
  • Hébergement Odoo.sh
  • Assistance
  • Migration
  • Développements personnalisés
  • Éducation
  • Trouver un comptable
  • Trouver un partenaire
  • Devenez partenaire
À propos
  • Notre société
  • Actifs de la marque
  • Contactez-nous
  • Emplois
  • Événements
  • Podcast
  • Blog
  • Clients
  • Informations légales • Confidentialité
  • Sécurité.
الْعَرَبيّة 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 est une suite d'applications open source couvrant tous les besoins de votre entreprise : CRM, eCommerce, Comptabilité, Inventaire, Point de Vente, Gestion de Projet, etc.

Le positionnement unique d'Odoo est d'être à la fois très facile à utiliser et totalement intégré.

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