Skip to Content
Odoo Menu
  • Prihlásiť sa
  • Vyskúšajte zadarmo
  • Aplikácie
    Financie
    • Účtovníctvo
    • Fakturácia
    • Výdavky
    • Tabuľka (BI)
    • Dokumenty
    • Podpis
    Predaj
    • CRM
    • Predaj
    • POS Shop
    • POS Restaurant
    • Manažment odberu
    • Požičovňa
    Webstránky
    • Tvorca webstránok
    • eShop
    • Blog
    • Fórum
    • Živý chat
    • eLearning
    Supply Chain
    • Sklad
    • Výroba
    • Správa životného cyklu produktu
    • Nákup
    • Údržba
    • Manažment kvality
    Ľudské zdroje
    • Zamestnanci
    • Nábor zamestnancov
    • Voľné dni
    • Hodnotenia
    • Odporúčania
    • Vozový park
    Marketing
    • Marketing sociálnych sietí
    • Email marketing
    • SMS marketing
    • Eventy
    • Marketingová automatizácia
    • Prieskumy
    Služby
    • Projektové riadenie
    • Pracovné výkazy
    • Práca v teréne
    • Helpdesk
    • Plánovanie
    • Schôdzky
    Produktivita
    • Tímová komunikácia
    • Schvalovania
    • IoT
    • VoIP
    • Znalosti
    • WhatsApp
    Third party apps Odoo Studio Odoo Cloud Platform
  • Priemyselné odvetvia
    Retail
    • Book Store
    • Clothing Store
    • Furniture Store
    • Grocery Store
    • Hardware Store
    • Toy Store
    Food & Hospitality
    • Bar and Pub
    • Reštaurácia
    • Fast Food
    • Guest House
    • Beverage distributor
    • Hotel
    Reality
    • Real Estate Agency
    • Architecture Firm
    • Konštrukcia
    • Estate Managament
    • Gardening
    • Property Owner Association
    Poradenstvo
    • Accounting Firm
    • Odoo Partner
    • Marketing Agency
    • Law firm
    • Talent Acquisition
    • Audit & Certification
    Výroba
    • Textile
    • Metal
    • Furnitures
    • Jedlo
    • Brewery
    • Corporate Gifts
    Health & Fitness
    • Sports Club
    • Eyewear Store
    • Fitness Center
    • Wellness Practitioners
    • Pharmacy
    • Hair Salon
    Trades
    • Handyman
    • IT Hardware and Support
    • Solar Energy Systems
    • Shoe Maker
    • Cleaning Services
    • HVAC Services
    Iní
    • Nonprofit Organization
    • Environmental Agency
    • Billboard Rental
    • Photography
    • Bike Leasing
    • Software Reseller
    Browse all Industries
  • Komunita
    Vzdelávanie
    • Tutoriály
    • Dokumentácia
    • Certifikácie
    • Školenie
    • Blog
    • Podcast
    Empower Education
    • Vzdelávací program
    • Scale Up! Business Game
    • Visit Odoo
    Softvér
    • Stiahnuť
    • Porovnanie Community a Enterprise vierzie
    • Releases
    Spolupráca
    • Github
    • Fórum
    • Eventy
    • Preklady
    • Staň sa partnerom
    • Services for Partners
    • Register your Accounting Firm
    Služby
    • Nájdite partnera
    • Nájdite účtovníka
    • Meet an advisor
    • Implementation Services
    • Zákaznícke referencie
    • Podpora
    • Upgrades
    ​Github Youtube Twitter Linkedin Instagram Facebook Spotify
    +1 (650) 691-3277
    Získajte demo
  • Cenník
  • Pomoc

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

  • CRM
  • e-Commerce
  • Účtovníctvo
  • Sklady
  • PoS
  • Projektové riadenie
  • MRP
All apps
You need to be registered to interact with the community.
All Posts People Badges
Tagy (View all)
odoo accounting v14 pos v15
About this forum
You need to be registered to interact with the community.
All Posts People Badges
Tagy (View all)
odoo accounting v14 pos v15
About this forum
Pomoc

Error "Invalid name definition" when installing module

Odoberať

Get notified when there's activity on this post

This question has been flagged
moduleodoov11
5662 Zobrazenia
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
Zrušiť
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?

Enjoying the discussion? Don't just read, join in!

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

Registrácia
Related Posts Replies Zobrazenia Aktivita
Error when importing module Product Bidding In ECommerce in odoo 17
module
Avatar
Avatar
1
júl 24
2647
Missing required value for the field 'Model' (model_id)
module
Avatar
Avatar
1
jan 24
6566
View newly installed Module
module
Avatar
Avatar
Avatar
2
mar 23
3583
Change default location in update quantity on hand window Solved
odoov11
Avatar
Avatar
Avatar
2
júl 22
9974
odoo v11 options are missing
odoov11
Avatar
Avatar
1
jún 21
3158
Komunita
  • Tutoriály
  • Dokumentácia
  • Fórum
Open Source
  • Stiahnuť
  • Github
  • Runbot
  • Preklady
Služby
  • Odoo.sh hosting
  • Podpora
  • Vyššia verzia
  • Custom Developments
  • Vzdelávanie
  • Nájdite účtovníka
  • Nájdite partnera
  • Staň sa partnerom
O nás
  • Naša spoločnosť
  • Majetok značky
  • Kontaktujte nás
  • Pracovné ponuky
  • Eventy
  • Podcast
  • Blog
  • Zákazníci
  • Právne dokumenty • Súkromie
  • Bezpečnosť
الْعَرَبيّة 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 je sada podnikových aplikácií s otvoreným zdrojovým kódom, ktoré pokrývajú všetky potreby vašej spoločnosti: CRM, e-shop, účtovníctvo, skladové hospodárstvo, miesto predaja, projektový manažment atď.

Odoo prináša vysokú pridanú hodnotu v jednoduchom použití a súčasne plne integrovanými biznis aplikáciami.

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