Skip to Content
Odoo Menu
  • Log ind
  • Prøv gratis
  • Apps
    Økonomi
    • Bogføring
    • Fakturering
    • Udgifter
    • Regneark (BI)
    • Dokumenter
    • e-Signatur
    Salg
    • CRM
    • Salg
    • POS Butik
    • POS Restaurant
    • Abonnementer
    • Udlejning
    Hjemmeside
    • Hjemmesidebygger
    • e-Handel
    • Blog
    • Forum
    • LiveChat
    • e-Læring
    Forsyningskæde
    • Lagerbeholdning
    • Produktion
    • PLM
    • Indkøb
    • Vedligeholdelse
    • Kvalitet
    HR
    • Medarbejdere
    • Rekruttering
    • Fravær
    • Medarbejdersamtaler
    • Anbefalinger
    • Flåde
    Marketing
    • Markedsføring på sociale medier
    • E-mailmarketing
    • SMS-marketing
    • Arrangementer
    • Automatiseret marketing
    • Spørgeundersøgelser
    Tjenester
    • Projekt
    • Timesedler
    • Udkørende Service
    • Kundeservice
    • Planlægning
    • Aftaler
    Produktivitet
    • Dialog
    • Godkendelser
    • IoT
    • VoIP
    • Vidensdeling
    • WhatsApp
    Tredjepartsapps Odoo Studio Odoo Cloud-platform
  • Brancher
    Detailhandel
    • Boghandel
    • Tøjforretning
    • Møbelforretning
    • Dagligvarebutik
    • Byggemarked
    • Legetøjsforretning
    Mad og værtsskab
    • Bar og pub
    • Restaurant
    • Fastfood
    • Gæstehus
    • Drikkevareforhandler
    • Hotel
    Ejendom
    • Ejendomsmægler
    • Arkitektfirma
    • Byggeri
    • Ejendomsadministration
    • Havearbejde
    • Boligejerforening
    Rådgivning
    • Regnskabsfirma
    • Odoo-partner
    • Marketingbureau
    • Advokatfirma
    • Rekruttering
    • Audit & certificering
    Produktion
    • Tekstil
    • Metal
    • Møbler
    • Fødevareproduktion
    • Bryggeri
    • Firmagave
    Heldbred & Fitness
    • Sportsklub
    • Optiker
    • Fitnesscenter
    • Kosmetolog
    • Apotek
    • Frisør
    Håndværk
    • Handyman
    • IT-hardware og support
    • Solenergisystemer
    • Skomager
    • Rengøringsservicer
    • VVS- og ventilationsservice
    Andet
    • Nonprofitorganisation
    • Miljøagentur
    • Udlejning af billboards
    • Fotografi
    • Cykeludlejning
    • Softwareforhandler
    Gennemse alle brancher
  • Community
    Få mere at vide
    • Tutorials
    • Dokumentation
    • Certificeringer
    • Oplæring
    • Blog
    • Podcast
    Bliv klogere
    • Udannelselsesprogram
    • Scale Up!-virksomhedsspillet
    • Besøg Odoo
    Få softwaren
    • Download
    • Sammenlign versioner
    • Udgaver
    Samarbejde
    • Github
    • Forum
    • Arrangementer
    • Oversættelser
    • Bliv partner
    • Tjenester til partnere
    • Registrér dit regnskabsfirma
    Modtag tjenester
    • Find en partner
    • Find en bogholder
    • Kontakt en rådgiver
    • Implementeringstjenester
    • Kundereferencer
    • Support
    • Opgraderinger
    Github Youtube Twitter LinkedIn Instagram Facebook Spotify
    +1 (650) 691-3277
    Få en demo
  • Prissætning
  • Hjælp

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

  • CRM
  • e-Commerce
  • Bogføring
  • Lager
  • PoS
  • Projekt
  • MRP
All apps
Du skal være registreret for at interagere med fællesskabet.
All Posts People Emblemer
Tags (View all)
odoo accounting v14 pos v15
Om dette forum
Du skal være registreret for at interagere med fællesskabet.
All Posts People Emblemer
Tags (View all)
odoo accounting v14 pos v15
Om dette forum
Hjælp

Module creation issues for v17

Tilmeld

Få besked, når der er aktivitet på dette indlæg

Dette spørgsmål er blevet anmeldt
developmentdevelopementerrorhelp
3 Besvarelser
3394 Visninger
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
Kassér
Justin hul
Forfatter


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
Bedste svar

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
Kassér
Justin hul
Forfatter

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

Justin hul
Forfatter

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
Forfatter

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

Avatar
Justin hul
Forfatter Bedste svar

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
Kassér
Niyas Raphy (Walnut Software Solutions)

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

Justin hul
Forfatter

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)
Bedste svar

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
Kassér
Enjoying the discussion? Don't just read, join in!

Create an account today to enjoy exclusive features and engage with our awesome community!

Tilmeld dig
Related Posts Besvarelser Visninger Aktivitet
Issue on Account move lline
error help account.move.line
Avatar
Avatar
Avatar
3
dec. 23
6749
When i click on Print Button RML get error
development error rml
Avatar
Avatar
1
mar. 15
6517
How do I deal with the "Invalid XML for View Architecture!" error?
development error view
Avatar
Avatar
Avatar
2
mar. 15
7821
How To Hide User Group From Users Form View In Odoo
development error users group
Avatar
Avatar
Avatar
Avatar
4
sep. 25
2691
odoo 15 development error
development error v15 psycopg2.errors
Avatar
Avatar
1
jul. 24
4768
Community
  • Tutorials
  • Dokumentation
  • Forum
Open Source
  • Download
  • Github
  • Runbot
  • Oversættelser
Tjenester
  • Odoo.sh-hosting
  • Support
  • Opgradere
  • Individuelt tilpasset udvikling
  • Uddannelse
  • Find en bogholder
  • Find en partner
  • Bliv partner
Om os
  • Vores virksomhed
  • Brandaktiver
  • Kontakt os
  • Stillinger
  • Arrangementer
  • Podcast
  • Blog
  • Kunder
  • Juridiske dokumenter • Privatlivspolitik
  • Sikkerhedspolitik
الْعَرَبيّة 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 er en samling open source-forretningsapps, der dækker alle dine virksomhedsbehov – lige fra CRM, e-handel og bogføring til lagerstyring, POS, projektledelse og meget mere.

Det unikke ved Odoo er, at systemet både er brugervenligt og fuldt integreret.

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