Přejít na obsah
Odoo Menu
  • Přihlásit se
  • Vyzkoušejte zdarma
  • Aplikace
    Finance
    • Účetnictví
    • Fakturace
    • Výdaje
    • Spreadsheet (BI)
    • Dokumenty
    • Podpisy
    Prodej
    • CRM
    • Prodej
    • POS Obchod
    • POS Restaurace
    • Předplatné
    • Pronájem
    Webové stránky
    • Webové stránky
    • E-shop
    • Blog
    • Fórum
    • Živý chat
    • eLearning
    Dodavatelský řetězec
    • Sklad
    • Výroba
    • PLM
    • Nákup
    • Údržba
    • Kvalita
    Lidské zdroje
    • Zaměstnanci
    • Nábor
    • Volno
    • Hodnocení zaměstnanců
    • Doporučení
    • Vozový park
    Marketing
    • Marketing sociálních sítí
    • Emailový marketing
    • SMS Marketing
    • Události
    • Marketingová automatizace
    • Dotazníky
    Služby
    • Projekt
    • Časové výkazy
    • Práce v terénu
    • Helpdesk
    • Plánování
    • Schůzky
    Produktivita
    • Diskuze
    • Schvalování
    • IoT
    • VoIP
    • Znalosti
    • WhatsApp
    Aplikace třetích stran Odoo Studio Odoo cloudová platforma
  • Branže
    Maloobchod
    • Knihkupectví
    • Obchod s oblečením
    • Obchod s nábytkem
    • Potraviny
    • Obchod s hardwarem
    • Hračkářství
    Jídlo a pohostinství
    • Bar a Pub
    • Restaurace
    • Fast Food
    • Penzion
    • Distributor nápojů
    • Hotel
    Nemovitost
    • Realitní kancelář
    • Architektonická firma
    • Stavba
    • Správa nemovitostí
    • Zahradnictví
    • Asociace vlastníků nemovitosti
    Poradenství
    • Účetní firma
    • Odoo Partner
    • Marketingová agentura
    • Právník
    • Akvizice talentů
    • Audit a certifikace
    Výroba
    • Textil
    • Kov
    • Nábytek
    • Jídlo
    • Pivovar
    • Korporátní dárky
    Zdraví a fitness
    • Sportovní klub
    • Prodejna brýli
    • Fitness Centrum
    • Wellness praktikové
    • Lékárna
    • Kadeřnictví
    Transakce
    • Údržbář
    • Podpora IT & hardware
    • Systémy solární energie
    • Výrobce obuvi
    • Úklidové služby
    • Služby HVAC
    Ostatní
    • Nezisková organizace
    • Agentura pro životní prostředí
    • Pronájem billboardů
    • Fotografování
    • Leasing jízdních kol
    • Prodejce softwaru
    Procházet všechna odvětví
  • Komunita
    Edukační program
    • Tutoriály
    • Dokumentace
    • Certifikace
    • Vzdělávání
    • Blog
    • Podcast
    Podpora vzdělávání
    • Vzdělávací program
    • Scale Up! Hra na firmu
    • Navštivte Odoo
    Získat software
    • Stáhnout
    • Porovnejte edice
    • Verze
    Spolupráce
    • Github
    • Fórum
    • Události
    • Překlady
    • Stát se partnerem
    • Služby pro partnery
    • Registrujte svou účetní firmu
    Získat služby
    • Najít partnera
    • Najít účetní
    • Setkejte se s poradcem
    • Implementační služby
    • Zákaznické reference
    • Podpora
    • Upgrady
    Github Youtube Twitter Linkedin Instagram Facebook Spotify
    +1 (650) 691-3277
    Dohodnout demo
  • Ceník
  • Pomoc

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

  • CRM
  • e-Commerce
  • Účetnictví
  • Sklad
  • PoS
  • Projekty
  • MRP
All apps
You need to be registered to interact with the community.
All Posts Lidé Odznaky
Štítky (View all)
odoo accounting v14 pos v15
O tomto fóru
You need to be registered to interact with the community.
All Posts Lidé Odznaky
Štítky (View all)
odoo accounting v14 pos v15
O tomto fóru
Pomoc

how to add a tab to the customer's notebook

Odebírat

Get notified when there's activity on this post

This question has been flagged
menunewmodulemenuitemnewtab
3 Odpovědi
15840 Zobrazení
Avatar
Quentin

I developed a module and I would like add an item menu on the left and a tab to the customer's notebook.

For the menu on the left, I didn't try to find how to add this but I will see later (it's easier). For my tab I added a new view but it's not working (in comment inside my view.xml).

Could you help me.

This is my code :

my "password.py" :

from osv import osv
from osv import fields
class password(osv.osv):
 "'password Class"'

    _name='password'
    _columns=
    {
            'name':fiels.char("Name",size=128),
            'user':fields.char("Username",size=128),
            'host':fields.char("IP/HostName",size=128),
            'pass':fields.char("Password",size=128),
            'com':fields.char("Comment",size=128),            
    }
password()

my "password_view.xml ":

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

<openerp>
    <data>

        <record id="password_tree_view" model="ir.ui.view">
            <field name="name">password.tree</field>
                <field name="model">password</field>
                <field name="arch" type="xml">
                    <tree string="Password Tree">
                        <field name="name"/>
                <field name="user"/>
                        <field name="host"/>
                        <field name="pass"/>
                        <field name="com"/>
                    </tree>
                </field>
        </record>

        <record id="password_form_view" model="ir.ui.view">
            <field name="name">password.form</field>
                <field name="model">password</field>
                <field name="arch" type="xml">
                    <form string="Password Form">
                            <field name="name"/><field name="user"/>
                            <field name="host"/><field name="pass"/>
                            <field name="com"/>
                    </form>
                </field>
        </record>

        <!--<record id="password_partner_view" model="ir.ui.view">
            <field name="name">password.partner</field>
                <field name="inherit_id" ref="base.view_partner_form"/>
                <field name="model">view.partner</field>
                <field name="arch" type="xml">    
                    <xpath expr="//page[@string='Sales & Purchases']" position="after">
                        <field name="password"/>
                    </xpath>
                </field>
        </record>-->

        <record id="password_action" model="ir.actions.act_window">
            <field name="name">password</field>
            <field name="res_model">password</field>
            <field name="view_type">tree</field>
            <field name="view_mode">tree,form</field>
        </record>

    </data>
</openerp>

my __init__.py :

import password

and my __openerp__.py :

{
    'name': 'Password module',
    'version': '1.0',
    'category': 'Partner/Customer Management',
    'description': """""",
    'author': '',
    'website': '',
    'depends': ['base'],
    'data': ['password/password_view.xml'],

    'installable': True,
    'auto_install': False,
    'application': False,
}
0
Avatar
Zrušit
Avatar
Ghanshyam Prajapati
Nejlepší odpověď

Hi, Try Following, In your PY, class password(osv.osv): "'password Class"'

    _name='password'
    _inherit = "res.partner"

In your XML,

<record id="password_form_view" model="ir.ui.view">
    <field name="name">password.form</field>
        <field name="model">password</field>
        <field name="arch" type="xml">
        <field name="inherit_id" ref="base.view_partner_form" />                
                  <notebook position="inside">
                       <page string="Customer Notebook">
                       </page>
                       <page string = "Password Form">
                            <field name="name"/>
                            <field name="user"/>
                            <field name="host"/>
                            <field name="pass"/>
                            <field name="com"/>
                       </page>
                  </notebook>                            
            </form>
        </field>
</record>

Hope it work for you.

2
Avatar
Zrušit
Quentin
Autor

It doesn't work... "ValidateError Error occurred while validating the field(s) arch: Invalid XML for View Architecture!" I added <form string="Password Form"> before <notebook position="inside"> but It doesn't still work !

GuruDev

Dear Quentin, You better edit the view file like: <code> <openerp> </data> <record id="view_partner_inherited_form" model="ir.ui.view"> <field name="name">partner.passwd</field> <field name="model">res.partner</field> <field name="type">form</field> <field name="inherit_id" ref="base.view_partner_form"/> <field name="arch" type="xml"> <notebook position="inside"> <page string="Password Form"> <field name="YOUR FIELDS" nolabel="1"/> </code>

and close each tag, appropriately..

Quentin
Autor

Thank you for your help Ghanshyam Prajapati !

Ghanshyam Prajapati

Hi Quentin, If your problem is solved then please mark my answer as solved. Thanks.

Quentin
Autor

It's not still solved, but don't worry, I will if it solved !

Quentin
Autor

I have to replace my former form view or add this code as new view?

Ghanshyam Prajapati

http://help.openerp.com/question/20948/how-to-inherit-calendarevent-with-a-different-name/#21011 see this link, hope it work for you.

Quentin
Autor

Guys, did it work for you? because I can't fix it, I don't know why !

Avatar
GuruDev
Nejlepší odpověď

Hi Quentin, I think, you need to inherit the

res.partner model into your password.py file. Then, __name field is not required.

1
Avatar
Zrušit
Quentin
Autor

I did but I saved _name

Avatar
Quentin
Autor Nejlepší odpověď

So this is my new password_view.xml and password.py. Some errors are not fixed but I'm on the right way :

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

<openerp>
    <data>

        <record id="view_password_form" model="ir.ui.view">
            <field name="name">Password Form</field>
                <field name="model">password.table</field>
                <field name="arch" type="xml">
                    <form string="Password Form">
                        <field name="name_pid"/>
                        <field name="user_pid"/>
                        <field name="host_pid"/>
                        <field name="pass_pid" password='True'/>
                        <field name="com_pid"/>
                    </form>
                </field>
        </record>

        <record id="view_password_tree" model="ir.ui.view">
            <field name="name">Password Tree</field>
                <field name="model">password.table</field>
                <field name="arch" type="xml">
                    <tree string="Password Tree">
                        <field name="name_pid"/>
                        <field name="host_pid"/>
                <field name="user_pid"/>
                        <field name="pass_pid" password='True'/>
                        <field name="com_pid"/>
                    </tree>
            </field>
        </record>

       <record id="view_password_partner_form" model="ir.ui.view">
            <field name="name">Password Partner Form</field>
            <field name="model">res.partner</field>
            <field name="inherit_id" ref="base.view_partner_form"/>
            <field name="arch" type="xml">
                <data>
                    <xpath expr="//page[@string='Sales & Purchases']" position="after">
                        <page string="Password">
                        </page>
                    </xpath>
                    <xpath expr="//page[@string='Password']" position="inside">
                        <field name="passwords">
                        </field>
                    </xpath>
                </data>
            </field>
        </record>

        <record id="action_password" model="ir.actions.act_window">
            <field name="name">Password</field>
            <field name="type">ir.actions.act_window</field>
            <field name="res_model">password.table</field>
            <field name="view_type">form</field>
            <field name="view_mode">form,tree</field>
            <field name="help" type="html">
              <p class="oe_view_nocontent_create">
                Click to save a new login.
              </p><p>
                OpenERP will save this login for you: Hostname, Username, Password.
              </p>
            </field>
        </record>

        <menuitem action="action_password" id="action_menu_password" parent="base.menu_sales" name="Password"/>

    </data>
</openerp>

...

from openerp.osv import osv, fields

class password(osv.osv):

    _inherit = 'res.partner'

    _columns = {
        'passwords': fields.one2many('password.table')

   }
password()

class password_table(osv.osv):
    _name="password.table"

    _columns = {
            'name_pid':fields.many2one('res.partner', 'name', required=True),
            'user_pid':fields.char("UserName",size=128, required=True),
            'host_pid':fields.char("IP/HostName",size=128, required=True),
            'pass_pid':fields.char("Password",size=128, required=True),
            'com_pid':fields.text("Comment")
        }
password_table()

The menu is working but my form view is always in editing mode by default. And I have some problems may be with postgresql. The error is following : 'HINT: No operator matches the given name and argument type(s). You might need to add explicit type casts.'

Somebody could help me?

0
Avatar
Zrušit
GuruDev

Dear Quintin, Did you try like this?

<code> <record id="view_password_partner_form" model="ir.ui.view"> <field name="name">Password Partner Form</field> <field name="model">res.partner</field>

</code>

see the model name

Quentin
Autor

I find how do for the tab. I have always to fix some issues about my item menu but I'm in the right way. I'll edit this answer with the latest code. Thank you GuruDev for your help.

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

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

Přihlásit se
Related Posts Odpovědi Zobrazení Aktivita
Dropdown sub-menu offset away from position
menu menuitem
Avatar
0
pro 24
1816
How to add a new action menu item? Vyřešeno
module menu newmodule menuitem new
Avatar
Avatar
Avatar
Avatar
Avatar
17
zář 22
107221
How to create a new menu item and place it under other module's menu? Vyřešeno
menu menuitem
Avatar
Avatar
Avatar
Avatar
4
říj 19
35316
After finishing installation I do not get any menu items the page is blank
menu menuitem
Avatar
Avatar
1
dub 17
4553
No such external ID currently defined in the system error while adding a menu item.
menu menuitem
Avatar
Avatar
2
bře 15
8195
Komunita
  • Tutoriály
  • Dokumentace
  • Fórum
Open Source
  • Stáhnout
  • Github
  • Runbot
  • Překlady
Služby
  • Odoo.sh hostování
  • Podpora
  • Upgrade
  • Nestandardní vývoj
  • Edukační program
  • Najít účetní
  • Najít partnera
  • Stát se partnerem
O nás
  • Naše společnost
  • Podklady značky
  • Kontakujte nás
  • Práce
  • Události
  • Podcast
  • Blog
  • Zákazníci
  • Právní dokumenty • Soukromí
  • Zabezpečení
الْعَرَبيّة 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 balíček open-source aplikací, které pokrývají všechny potřeby vaší společnosti: CRM, e-shop, účetnictví, sklady, kasy, projektové řízení a další.

Unikátní nabídka od Odoo poskytuje velmi jednoduché uživatelské rozhraní a vše je integrované na jednom místě.

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