İçereği Atla
Odoo Menü
  • Portal
  • Ücretsiz deneyin
  • Uygulamalar
    Finans
    • Muhasebe
    • Faturalama
    • Masraf Yönetimi
    • Elektronik Çizelge (BI)
    • Belgeler
    • İmza
    Satış
    • Müşteri İlişkileri Yönetimi (CRM)
    • Satış
    • Satış Noktası Mağaza
    • Satış Noktası Restoran
    • Abonelikler
    • Kiralama
    Web Sitesi
    • Web Sitesi Oluşturucu
    • eTicaret
    • Blog
    • Forum
    • Canlı Sohbet
    • eÖğrenme
    Tedarik Zinciri
    • Envanter
    • Üretim
    • Ürün Yaşam Döngüsü Yönetimi
    • Satın Alma
    • Bakım
    • Kalite
    İnsan Kaynakları
    • Çalışanlar
    • İşe Alım
    • İzin
    • Değerlendirme
    • Referans
    • Filo Yönetimi
    Pazarlama
    • Sosyal Medyada Pazarlama
    • E-posta ile Pazarlama
    • SMS ile Pazarlama
    • Etkinlikler
    • Pazarlama Otomasyonu
    • Anket
    Hizmetler
    • Proje Yönetimi
    • Çalışma Çizelgeleri
    • Saha Hizmeti
    • Yardım Masası
    • Planlama
    • Randevular
    Verimlilik
    • Sohbet
    • Onay
    • Nesnelerin İnterneti
    • VoIP
    • Bilgi Bankası
    • WhatsApp
    Üçüncü taraf uygulamalar Odoo Stüdyo Odoo Bulut Platformu
  • Sektörler
    Perakende satış
    • Kitapçı
    • Giyim Mağazası
    • Mobilya Mağazası
    • Gıda Marketi
    • Hırdavat Dükkanı
    • Oyuncak Dükkanı
    Gıda ve Konaklama
    • Bar ve Pub
    • Restoran
    • Fast Food Restoranı
    • Konuk Evi
    • İçecek Distribütörü
    • Otel
    Gayrimenkul
    • Emlak Acentesi
    • Mimarlık Firması
    • İnşaat
    • Emlak Yönetimi
    • Bahçe Tasarımı
    • Mülk Sahipleri Derneği
    Uzmanlık
    • Muhasebe Firması
    • Odoo Partner
    • Pazarlama Ajansı
    • Hukuk Firması
    • Yetenek Kazanımı
    • Denetim ve Belgelendirme
    Üretim
    • Tekstil
    • Metal
    • Mobilyalar
    • Gıda
    • Bira fabrikası
    • Kurumsal Hediye
    Sağlık ve Spor
    • Spor Kulübü
    • Optik Mağazası
    • Fitness Merkezi
    • Sağlıklı Yaşam Merkezi
    • Eczane
    • Kuaför Salonu
    Ticaret
    • Tamirci
    • BT Donanım & Destek
    • Güneş Enerjisi Sistemleri
    • Ayakkabı İmalatçısı
    • Temizlik Hizmetleri
    • HVAC Hizmetleri
    Diğerleri
    • Kar Amacı Gütmeyen Kuruluş
    • Çevre Ajansı
    • Reklam Panosu Kiralama
    • Fotoğrafçılık
    • Bisiklet Kiralama
    • Yazılım Bayisi
    Tüm Sektörlere Göz Atın
  • Topluluk
    Öğrenim
    • Eğitim Araçları
    • Dokümantasyon
    • Sertifikasyonlar
    • Eğitim Etkinlikleri
    • Blog
    • Podcast
    Eğitim ve Gelişim
    • Eğitim Programı
    • Scale Up! İşletme Oyunu
    • Odoo'yu Ziyaret Edin
    Yazılım
    • İndirin
    • Sürümleri Kıyaslayın
    • Sürümler
    İş Birliği
    • Github
    • Forum
    • Etkinlikler
    • Çeviriler
    • Partner Olun
    • Partnerler için Hizmetler
    • Muhasebe Firmanızı Kaydettirin
    Hizmetler
    • Partner Bulun
    • Muhasebeci Bulun
    • Bir danışmanla görüşün
    • Kurulum Hizmetleri
    • Müşteri Referansları
    • Destek
    • Sürüm Yükseltme
    Github Youtube Twitter Linkedin Instagram Facebook Spotify
    +1 (650) 691-3277
    Demo randevusu alın
  • Fiyatlandırma
  • Yardım

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

  • Müşteri İlişkileri Yönetimi
  • e-Commerce
  • Muhasebe
  • Envanter
  • PoS
  • Proje Yönetimi
  • MRP
All apps
You need to be registered to interact with the community.
All Posts People Badges
Etiketler (View all)
odoo accounting v14 pos v15
About this forum
You need to be registered to interact with the community.
All Posts People Badges
Etiketler (View all)
odoo accounting v14 pos v15
About this forum
Yardım

How do I add a new menuitem to the MRP menu?

Abone Ol

Get notified when there's activity on this post

Bu soru işaretlendi
odoo10e
3 Cevaplar
6407 Görünümler
Avatar
Daniel Medina

I've trying so hard to figure out on how to add a new menuitem to my MRP module, via a custom module I am developing


The idea of my module is to inherit MRP and add a new menuitem that has a Wizard and Generaters a PDF.


But can't even get inheritance to work, any ideas?



0
Avatar
Vazgeç
Ray Carnes

Can you post what you have tried? What do you mean "can't even get inheritance to work"? We can guess, but it is better if you share.

Avatar
Niyas Raphy (Walnut Software Solutions)
En İyi Yanıt

Hi,

To add a menu item under a menu is an easy task what you have to do is define and the new menu and add parent attribute, and give parent="mrp_menu_id" so that your new menu will be created under the MRP.

Along with the menu you have to define the action of the menu, ie what has to be take place upon clicking the menu, if it is not given the menu will not be visible .

<menuitem id="id_for_new_menu" parent="id_of_parent" name="String to display in menu"
action="action_on_clicking_menu/>

This is how you can define a new menu, other than this you can use attributes such as groups and sequence along with the above.

To get the parent id of a menu item, what you can do is activate developer mode and go to Settings -> Technical -> User Interface -> Menu Items -> Search the menu, open it , click on lady debugger button(button near logged in user name) and click on View Meta data, in the opening wizard, you can see the id of the menu, ie XML ID

...


Thanks

3
Avatar
Vazgeç
Avatar
Daniel Medina
Üretici En İyi Yanıt

Thanks for your answers, I've kinda advanced my code and I get the following error (Model not found):

File "/opt/odoo/odoo-server/odoo/models.py", line 1083, in _validate_fields
    raise ValidationError("%s\n\n%s" % (_("Error while validating constraint"), tools.ustr(e)))
ParseError: "Error mientras se validavan las restricciones

Modelo no encontrado: menu.mrp.test.wizard

Error de contexto:
Vista `Menu MRP`
[view_id: 3532, xml_id: n/a, model: menu.mrp.test.wizard, parent_id: n/a]
None" while parsing /opt/odoo/custom/migsamx/mrp_menu/wizard/mrp_menu_wizard_view.xml:4, near
<record id="oee_report_wizard" model="ir.ui.view">
        <field name="name">Menu MRP</field>
        <field name="model">menu.mrp.test.wizard</field>
        <field name="arch" type="xml">
            <form>
                <group name="date_range">
                    <field name="date_range_id"/>
                </group>
                <group name="date_fields">
                    <field name="date_from"/>
                    <field name="date_to"/>
                </group>
            </form>
        </field>
    </record>

models folder:

__init__.py

# -*- coding: utf-8 -*-

from . import mrp

mrp.py

# -*- coding: utf-8 -*-

from odoo import models


class MrpMenu(models.Model):
_inherit = 'mrp.workcenter'

views folder:

mrp_view.xml

<?xml version="1.0" encoding="utf-8"?>
<odoo>
<record model="ir.ui.view" id="view_mrp_specific_form">
<field name="name">mrp.workcenter.form.inherit</field>
<field name="inherit_id" ref="mrp.mrp_workcenter_view"/>
<field name="model">mrp.workcenter</field>
<field name="type">form</field>
</record>
</odoo>

wizard folder:

__init__.py

# -*- coding: utf-8 -*-

from . import mrp_menu_wizard

mrp_menu_wizard.py

# -*- coding: utf-8 -*-

from odoo import models, fields, api


class MenuWizardTest(models.TransientModel):

_name = "menu.mrp.test.wizard"
_description = "OEE Reports"

date_from = fields.Date(Required=True)
date_to = fields.Date(Required=True)

date_range_id = fields.Many2one(
comodel_name='date.range',
string='Date range'
)

@api.onchange('date_range_id')
def onchange_date_range_id(self):
self.date_from = self.date_range_id.date_start
self.date_to = self.date_range_id.date_end

mrp_menu_wizard_view.xml

<?xml version="1.0" encoding="utf-8"?>
<odoo>

<record id="oee_report_wizard" model="ir.ui.view">
<field name="name">Menu MRP</field>
<field name="model">menu.mrp.test.wizard</field>
<field name="arch" type="xml">
<form>
<group name="date_range">
<field name="date_range_id"/>
</group>
<group name="date_fields">
<field name="date_from"/>
<field name="date_to"/>
</group>
</form>
</field>
</record>

<act_window id="action_menu_test_wizard"
name="OEE Reports"
res_model="menu.mrp.test.wizard"
view_type="form"
view_mode="form"
view_id="oee_report_wizard"
target="new" />

</odoo>

mrp_menu (main module folder):

__init__.py

# -*- coding: utf-8 -*-
#Made by Daniel Medina

from . import models
from . import wizard

__manifest__.py

<?xml version="1.0" encoding="utf-8"?>
<odoo>

<menuitem
parent="mrp.menu_mrp_reporting"
id="menu_oee_reports"
name="OEE Reports"
groups="mrp.group_mrp_manager"
/>

<menuitem
parent="menu_oee_reports"
action="action_menu_test"
id="menu_oee_wizard"
sequence="10"
/>

</odoo>

mrp_menu.xml

<?xml version="1.0" encoding="utf-8"?>
<odoo>

<menuitem
parent="mrp.menu_mrp_reporting"
id="menu_oee_reports"
name="OEE Reports"
groups="mrp.group_mrp_manager"
/>

<menuitem
parent="menu_oee_reports"
action="action_menu_test"
id="menu_oee_wizard"
sequence="10"
/>

</odoo>
0
Avatar
Vazgeç
Daniel Medina
Üretici

manifest file:

# -*- coding: utf-8 -*-

{

'name': "mrp_menu",

'summary': """

INHERITANCE TEST""",

'description': """

INHERITANCE TEST.

""",

'author': "Daniel Medina",

'website': "http://www.migsamx.com",

'category': 'Uncategorized',

'version': '0.1',

'depends': [

'mrp',

'date_range',

'report',

],

'data': [

"views/mrp_view.xml",

"wizard/mrp_menu_wizard_view.xml",

"mrp_menu.xml",

],

'installable': True,

'application': True,

'auto_install': False,

'license': 'AGPL-3',

}

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

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

Üye Ol
İlgili Gönderiler Cevaplar Görünümler Aktivite
Sale order Total amount to three decimal places ? Çözüldü
odoo10e
Avatar
Avatar
Avatar
2
Oca 25
16417
Odoo 10 Calendar view with multiple lines
odoo10e
Avatar
0
Nis 20
1749
Odoo 10 Python Sockets
odoo10e
Avatar
0
Şub 20
6952
odoo error while validating constraint, what to do?
odoo10e
Avatar
Avatar
2
Tem 17
10903
Odoo10-Enterprise-Survey-Matrix-Text
odoo10e
Avatar
0
Nis 17
3191
Topluluk
  • Eğitim Araçları
  • Dokümantasyon
  • Forum
Açık Kaynak
  • İndirin
  • Github
  • Runbot
  • Çeviriler
Hizmetler
  • Odoo.sh Hosting
  • Destek
  • Sürüm Yükseltme
  • Özel Geliştirmeler
  • Eğitim
  • Muhasebeci Bulun
  • Partner Bulun
  • Partner Olun
Hakkında
  • Şirketimiz
  • Pazarlama Gereçleri
  • İletişim
  • Kariyer
  • Etkinlikler
  • Podcast
  • Blog
  • Müşteriler
  • Hukuki • Gizlilik
  • Güvenlik
الْعَرَبيّة 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, müşteri ilişkileri yönetimi, eTicaret, muhasebe, envanter, satış noktası, proje yönetimi gibi şirketinizin tüm ihtiyaçlarını karşılayan bir açık kaynak işletme uygulamaları paketidir.

Odoo’nun eşsiz değer önermesi, aynı anda hem kullanımının çok kolay olup hem de tamamen entegre olmasıdır.

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