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

Error "Invalid name definition" when installing module

Tilmeld

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

Dette spørgsmål er blevet anmeldt
moduleodoov11
5648 Visninger
Avatar
Sebastian782

I try to install a custom module with no problem I think (here is the code: 


class pb_orders_products(models.Model):


_name = "pb.orders.products"

_inherit = ['mail.thread']

_rec_name = "id"


reseller_private_product_id = fields.Integer(string='Ext. ID', size=128, required=True)

finalcustomer_id = fields.Many2one(comodel_name='pb.finalcustomers', inverse_name='id', string='Final Customer ID', required=True)

order_id = fields.Many2one(comodel_name='sale.order', inverse_name='id', string='SO', required=True)

purchase_order_id = fields.Many2one(comodel_name='purchase.order', inverse_name='id', string='PO', required=False)

measurements_id = fields.Many2one(comodel_name='pb.finalcustomers.measurements', inverse_name='id', string='Measurements ID', required=True)

product_type_id = fields.Selection([

('1', 'Shirt'),

('2', 'Suit'),

('3', 'Jacket'),

('4', 'Trouser'),

('5', 'Waiscoat'),

('6', 'Tie'),

('7', 'Belt'),

('8', 'Shoes'),

], string='Product', required=True)

product_quantity = fields.Char(string='Quantity', size=128, required=True)

fabric_id = fields.Many2one(comodel_name='pb.fabrics', inverse_name='id', string='Fabric', required=False)

date_received = fields.Date(string='Date of receipt', required=True)

status = fields.Selection(var_product_history, string='Status', required=True)

status_date = fields.Date(string='Status Date', required=True)

history = fields.One2many(comodel_name='pb.orders.products.history', inverse_name='product_id')

options = fields.One2many(comodel_name='pb.orders.products.options', inverse_name='product_id')

in Python models and in XML views I have:
<?xml version="1.0" encoding="UTF-8"?>
<openerp>
<data>

<menuitem name="Production" id="menu_pb_root" sequence="71"/>

<menuitem name="Products" id="menu_production" parent="menu_pb_root" sequence="1"/>

<record model="ir.actions.act_window" id="action_products_inproduction">
<field name="name">Products in production</field>
<field name="res_model">pb.orders.products</field>
<field name="domain">['|',('status','=','received'),'|',('status','=','checked'),('status','=','production')]</field>
<field name="view_mode">tree,form</field>
</record>
<menuitem name="in production" id="menu_products_inproduction" parent="menu_production" sequence="1" action="action_products_inproduction"/>

<record model="ir.actions.act_window" id="action_products_late">
<field name="name">Products late</field>
<field name="res_model">pb.orders.products</field>
<field name="view_mode">tree,form</field>
</record>
<menuitem name="late" id="menu_products_late" parent="menu_production" sequence="2" action="action_products_late"/>

<record model="ir.actions.act_window" id="action_products_issue">
<field name="name">Products with issues</field>
<field name="res_model">pb.orders.products</field>
<field name="domain">[('status','=','alteration')]</field>
<field name="view_mode">tree,form</field>
</record>
<menuitem name="issues" id="menu_products_issues" parent="menu_production" sequence="3" action="action_products_issue"/>

<record model="ir.actions.act_window" id="action_products_all">
<field name="name">All products</field>
<field name="res_model">pb.orders.products</field>
<field name="view_mode">tree,form</field>
</record>
<menuitem name="all" id="menu_products_all" parent="menu_production" sequence="4" action="action_products_all"/>

<menuitem name="Final Customers" id="menu_general" parent="menu_pb_root" sequence="2"/>

<record model="ir.actions.act_window" id="action_customer">
<field name="name">Final Customers</field>
<field name="res_model">pb.finalcustomers</field>
<field name="view_mode">tree,form</field>
</record>
<menuitem name="Final Customers" id="menu_customers" parent="menu_general" sequence="1" action="action_customer"/>

<record model="ir.actions.act_window" id="action_finalcustomers_measurements">
<field name="name">Final Customers Measurements</field>
<field name="res_model">pb.finalcustomers.measurements</field>
<field name="view_mode">tree,form</field>
</record>
<menuitem name="Measurements" id="menu_customerd_measurementd" parent="menu_customers" sequence="1" action="action_finalcustomers_measurements"/>

<menuitem name="Configuration" id="menu_configuration" parent="menu_pb_root" sequence="3"/>

<record model="ir.actions.act_window" id="action_fabrics">
<field name="name">Fabrics</field>
<field name="res_model">pb.fabrics</field>
<field name="view_mode">tree,form,search</field>
</record>
<menuitem name="Fabrics" id="menu_fabrics" parent="menu_configuration" sequence="1" action="action_fabrics"/>

<record model="ir.actions.act_window" id="action_products_options">
<field name="name">Products Options</field>
<field name="res_model">pb.products.options</field>
<field name="view_mode">tree,form</field>
</record>
<menuitem name="Products Options" id="menu_products_options" parent="menu_configuration" sequence="2" action="action_products_options"/>

<record model="ir.actions.act_window" id="action_products_options_values">
<field name="name">Products Options Values</field>
<field name="res_model">pb.products.options.values</field>
<field name="view_mode">tree,form</field>
</record>
<menuitem name="Products Options Values" id="menu_products_options_values" parent="menu_products_options" sequence="1" action="action_products_options_values"/>

<record model="ir.actions.act_window" id="action_orders_history">
<field name="name">History</field>
<field name="res_model">pb.orders.products.history</field>
<field name="view_mode">tree,form</field>
</record>
<menuitem name="History" id="menu_orders_history" parent="menu_configuration" sequence="3" action="action_orders_history"/>

</data>
</openerp>


Error:

Odoo Server Error

Traceback (most recent call last):

  File "/opt/odoo/odoo11/odoo/tools/convert.py", line 744, in parse

    self._tags[rec.tag](rec, de, mode=mode)

  File "/opt/odoo/odoo11/odoo/tools/convert.py", line 654, in _tag_record

    id = self.env(context=rec_context)['ir.model.data']._update(rec_model, self.module, res, rec_id or False, not self.isnoupdate(data_node), noupdate=self.isnoupdate(data_node), mode=self.mode)

  File "/opt/odoo/odoo11/odoo/addons/base/ir/ir_model.py", line 1487, in _update

    record = record.create(values)

  File "/opt/odoo/odoo11/odoo/addons/base/ir/ir_actions.py", line 230, in create

    return super(IrActionsActWindow, self).create(vals)

  File "/opt/odoo/odoo11/odoo/addons/base/ir/ir_actions.py", line 57, in create

    res = super(IrActions, self).create(vals)

  File "/opt/odoo/odoo11/odoo/models.py", line 3373, in create

    record = self.browse(self._create(old_vals))

  File "/opt/odoo/odoo11/odoo/models.py", line 3526, in _create

    self._validate_fields(vals)

  File "/opt/odoo/odoo11/odoo/models.py", line 1036, in _validate_fields

    check(self)

File "/opt/odoo/odoo11/odoo/addons/base/ir/ir_actions.py", line 138, in _check_model

    raise ValidationError(_('Invalid model name %r in action definition.') % action.res_model)

odoo.exceptions.ValidationError: ("Invalid model name 'pb.orders.products' in action definition.", None)


During handling of the above exception, another exception occurred:


Traceback (most recent call last):

  File "/opt/odoo/odoo11/odoo/http.py", line 650, in _handle_exception

    return super(JsonRequest, self)._handle_exception(exception)

  File "/opt/odoo/odoo11/odoo/http.py", line 310, in _handle_exception

    raise pycompat.reraise(type(exception), exception, sys.exc_info()[2])

  File "/opt/odoo/odoo11/odoo/tools/pycompat.py", line 87, in reraise

    raise value

  File "/opt/odoo/odoo11/odoo/http.py", line 692, in dispatch

    result = self._call_function(**self.params)

  File "/opt/odoo/odoo11/odoo/http.py", line 342, in _call_function

    return checked_call(self.db, *args, **kwargs)

  File "/opt/odoo/odoo11/odoo/service/model.py", line 97, in wrapper

    return f(dbname, *args, **kwargs)

  File "/opt/odoo/odoo11/odoo/http.py", line 335, in checked_call

    result = self.endpoint(*a, **kw)

  File "/opt/odoo/odoo11/odoo/http.py", line 936, in __call__

    return self.method(*args, **kw)

  File "/opt/odoo/odoo11/odoo/http.py", line 515, in response_wrap

    response = f(*args, **kw)

  File "/opt/odoo/odoo11/addons/web/controllers/main.py", line 938, in call_button

    action = self._call_kw(model, method, args, {})

  File "/opt/odoo/odoo11/addons/web/controllers/main.py", line 926, in _call_kw

    return call_kw(request.env[model], method, args, kwargs)

  File "/opt/odoo/odoo11/odoo/api.py", line 689, in call_kw

    return call_kw_multi(method, model, args, kwargs)

  File "/opt/odoo/odoo11/odoo/api.py", line 680, in call_kw_multi

    result = method(recs, *args, **kwargs)

  File "<decorator-gen-42>", line 2, in button_immediate_install

  File "/opt/odoo/odoo11/odoo/addons/base/module/module.py", line 71, in check_and_log

    return method(self, *args, **kwargs)

  File "/opt/odoo/odoo11/odoo/addons/base/module/module.py", line 449, in button_immediate_install

    return self._button_immediate_function(type(self).button_install)

  File "/opt/odoo/odoo11/odoo/addons/base/module/module.py", line 542, in _button_immediate_function

    modules.registry.Registry.new(self._cr.dbname, update_module=True)

  File "/opt/odoo/odoo11/odoo/modules/registry.py", line 85, in new

    odoo.modules.load_modules(registry._db, force_demo, status, update_module)

  File "/opt/odoo/odoo11/odoo/modules/loading.py", line 380, in load_modules

    loaded_modules, update_module, models_to_check)

  File "/opt/odoo/odoo11/odoo/modules/loading.py", line 274, in load_marked_modules

    perform_checks=perform_checks, models_to_check=models_to_check

  File "/opt/odoo/odoo11/odoo/modules/loading.py", line 181, in load_module_graph

    _load_data(cr, module_name, idref, mode, kind='data')

  File "/opt/odoo/odoo11/odoo/modules/loading.py", line 95, in _load_data

    tools.convert_file(cr, module_name, filename, idref, mode, noupdate, kind, report)

  File "/opt/odoo/odoo11/odoo/tools/convert.py", line 791, in convert_file

    convert_xml_import(cr, module, fp, idref, mode, noupdate, report)

  File "/opt/odoo/odoo11/odoo/tools/convert.py", line 852, in convert_xml_import

    obj.parse(doc.getroot(), mode=mode)

  File "/opt/odoo/odoo11/odoo/tools/convert.py", line 741, in parse

    self.parse(rec, mode)

  File "/opt/odoo/odoo11/odoo/tools/convert.py", line 751, in parse

    exc_info[2]

  File "/opt/odoo/odoo11/odoo/tools/pycompat.py", line 86, in reraise

    raise value.with_traceback(tb)

  File "/opt/odoo/odoo11/odoo/tools/convert.py", line 744, in parse

    self._tags[rec.tag](rec, de, mode=mode)

  File "/opt/odoo/odoo11/odoo/tools/convert.py", line 654, in _tag_record

    id = self.env(context=rec_context)['ir.model.data']._update(rec_model, self.module, res, rec_id or False, not self.isnoupdate(data_node), noupdate=self.isnoupdate(data_node), mode=self.mode)

  File "/opt/odoo/odoo11/odoo/addons/base/ir/ir_model.py", line 1487, in _update

    record = record.create(values)

  File "/opt/odoo/odoo11/odoo/addons/base/ir/ir_actions.py", line 230, in create

    return super(IrActionsActWindow, self).create(vals)

  File "/opt/odoo/odoo11/odoo/addons/base/ir/ir_actions.py", line 57, in create

    res = super(IrActions, self).create(vals)

  File "/opt/odoo/odoo11/odoo/models.py", line 3373, in create

    record = self.browse(self._create(old_vals))

  File "/opt/odoo/odoo11/odoo/models.py", line 3526, in _create

    self._validate_fields(vals)

  File "/opt/odoo/odoo11/odoo/models.py", line 1036, in _validate_fields

    check(self)

  File "/opt/odoo/odoo11/odoo/addons/base/ir/ir_actions.py", line 138, in _check_model

    raise ValidationError(_('Invalid model name %r in action definition.') % action.res_model)

odoo.tools.convert.ParseError: "Invalid model name 'pb.orders.products' in action definition.

None" while parsing /opt/odoo/odoo11-custom-addons/probespoke/views/menu.xml:9, near

<record model="ir.actions.act_window" id="action_products_inproduction">

<field name="name">Products in production</field>

<field name="res_model">pb.orders.products</field>

<field name="domain">['|',('status','=','received'),'|',('status','=','checked'),('status','=','production')]</field>

<field name="view_mode">tree,form</field>

</record>

0
Avatar
Kassér
Alexandre Pecorilla

Hey. You should use the code formatter tag to make more legible.

Ermin Trevisan

Did you read your error message? You can't install a buggy module.

Sebastian782
Forfatter

Yes but I don't see how this is buggy. What "Invalid model name 'pb.orders.products' in action definition." could mean?

When I google it I find nobody who has the same issue...

Sebastian782
Forfatter

Okay guy, I can you explain me this:

I comment all the data in the __manifest__.py in order to install the database part, it work. Then I uncomment and install the view, it work to!

Any idea of why should I install this addons in 2 part?

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
Error when importing module Product Bidding In ECommerce in odoo 17
module
Avatar
Avatar
1
jul. 24
2635
Missing required value for the field 'Model' (model_id)
module
Avatar
Avatar
1
jan. 24
6534
View newly installed Module
module
Avatar
Avatar
Avatar
2
mar. 23
3566
Change default location in update quantity on hand window Løst
odoov11
Avatar
Avatar
Avatar
2
jul. 22
9969
odoo v11 options are missing
odoov11
Avatar
Avatar
1
jun. 21
3147
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