Zum Inhalt springen
Odoo Menü
  • Anmelden
  • Jetzt gratis testen
  • Apps
    Finanzen
    • Buchhaltung
    • Rechnungsstellung
    • Spesenabrechnung
    • Tabellenkalkulation (BI)
    • Dokumente
    • E-Signatur
    Vertrieb
    • CRM
    • Vertrieb
    • Kassensystem – Shop
    • Kassensystem – Restaurant
    • Abonnements
    • Vermietung
    Websites
    • Website-Builder
    • E-Commerce
    • Blog
    • Forum
    • Livechat
    • E-Learning
    Lieferkette
    • Lager
    • Fertigung
    • PLM
    • Einkauf
    • Wartung
    • Qualität
    Personalwesen
    • Mitarbeiter
    • Personalbeschaffung
    • Abwesenheiten
    • Mitarbeiterbeurteilung
    • Personalempfehlungen
    • Fuhrpark
    Marketing
    • Social Marketing
    • E-Mail-Marketing
    • SMS-Marketing
    • Veranstaltungen
    • Marketing-Automatisierung
    • Umfragen
    Dienstleistungen
    • Projekte
    • Zeiterfassung
    • Außendienst
    • Kundendienst
    • Planung
    • Termine
    Produktivität
    • Dialog
    • Genehmigungen
    • IoT
    • VoIP
    • Wissensdatenbank
    • WhatsApp
    Apps von Drittanbietern Odoo Studio Odoo Cloud-Plattform
  • Branchen
    Einzelhandel
    • Buchladen
    • Kleidergeschäft
    • Möbelhaus
    • Lebensmittelgeschäft
    • Baumarkt
    • Spielwarengeschäft
    Essen & Gastgewerbe
    • Bar und Kneipe
    • Restaurant
    • Fast Food
    • Gästehaus
    • Getränkehändler
    • Hotel
    Immobilien
    • Immobilienagentur
    • Architekturbüro
    • Baugewerbe
    • Immobilienverwaltung
    • Gartenarbeit
    • Eigentümervereinigung
    Beratung
    • Buchhaltungsfirma
    • Odoo-Partner
    • Marketingagentur
    • Anwaltskanzlei
    • Talentakquise
    • Prüfung & Zertifizierung
    Fertigung
    • Textil
    • Metall
    • Möbel
    • Speisen
    • Brauerei
    • Firmengeschenke
    Gesundheit & Fitness
    • Sportklub
    • Brillengeschäft
    • Fitnessstudio
    • Therapeut
    • Apotheke
    • Friseursalon
    Handel
    • Handyman
    • IT-Hardware & -Support
    • Solarenergiesysteme
    • Schuster
    • Reinigungsdienstleistungen
    • HLK-Dienstleistungen
    Sonstiges
    • Gemeinnützige Organisation
    • Umweltschutzagentur
    • Plakatwandvermietung
    • Fotostudio
    • Fahrrad-Leasing
    • Software-Händler
    Alle Branchen ansehen
  • Community
    Lernen
    • Tutorials
    • Dokumentation
    • Zertifizierungen
    • Schulung
    • Blog
    • Podcast
    Bildung fördern
    • Bildungsprogramm
    • Scale-Up! Planspiel
    • Odoo besuchen
    Software anfragen
    • Herunterladen
    • Editionen vergleichen
    • Releases
    Zusammenarbeiten
    • Github
    • Forum
    • Veranstaltungen
    • Übersetzungen
    • Partner werden
    • Dienstleistungen für Partner
    • Buchhaltungsfirma registrieren
    Services anfragen
    • Partner finden
    • Buchhalter finden
    • Einen Experten treffen
    • Implementierungsservices
    • Kundenreferenzen
    • Support
    • Upgrades
    Github Youtube Twitter Linkedin Instagram Facebook Spotify
    +1 (650) 691-3277
    Eine Demo erhalten
  • Preiskalkulation
  • Hilfe

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

  • CRM
  • e-Commerce
  • Buchhaltung
  • Lager
  • PoS
  • Projekte
  • MRP
All apps
Sie müssen registriert sein, um mit der Community zu interagieren.
Alle Beiträge Personen Abzeichen
Stichwörter (Alle anzeigen)
odoo accounting v14 pos v15
Über dieses Forum
Sie müssen registriert sein, um mit der Community zu interagieren.
Alle Beiträge Personen Abzeichen
Stichwörter (Alle anzeigen)
odoo accounting v14 pos v15
Über dieses Forum
Hilfe

Error "Invalid name definition" when installing module

Abonnieren

Erhalten Sie eine Benachrichtigung, wenn es eine Aktivität zu diesem Beitrag gibt

Diese Frage wurde gekennzeichnet
moduleodoov11
5644 Ansichten
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
Verwerfen
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
Autor

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
Autor

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?

Diskutieren Sie gerne? Treten Sie bei, statt nur zu lesen!

Erstellen Sie heute ein Konto, um exklusive Funktionen zu nutzen und mit unserer tollen Community zu interagieren!

Registrieren
Verknüpfte Beiträge Antworten Ansichten Aktivität
Error when importing module Product Bidding In ECommerce in odoo 17
module
Avatar
Avatar
1
Juli 24
2631
Missing required value for the field 'Model' (model_id)
module
Avatar
Avatar
1
Jan. 24
6529
View newly installed Module
module
Avatar
Avatar
Avatar
2
März 23
3564
Change default location in update quantity on hand window Gelöst
odoov11
Avatar
Avatar
Avatar
2
Juli 22
9967
odoo v11 options are missing
odoov11
Avatar
Avatar
1
Juni 21
3146
Community
  • Tutorials
  • Dokumentation
  • Forum
Open Source
  • Herunterladen
  • Github
  • Runbot
  • Übersetzungen
Dienstleistungen
  • Odoo.sh-Hosting
  • Support
  • Upgrade
  • Individuelle Entwicklungen
  • Bildung
  • Buchhalter finden
  • Partner finden
  • Partner werden
Über uns
  • Unsere Firma
  • Markenwerte
  • Kontakt
  • Karriere
  • Veranstaltungen
  • Podcast
  • Blog
  • Kunden
  • Rechtliches • Datenschutz
  • Sicherheit
الْعَرَبيّة 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 ist eine Suite von Open-Source-Betriebsanwendungen, die alle Bedürfnisse Ihres Unternehmens abdecken: CRM, E-Commerce, Buchhaltung, Lager, Kassensystem, Projektmanagement etc.

Das einzigartige Wertversprechen von Odoo ist, dass es gleichzeitig sehr einfach zu bedienen und voll integriert ist.

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