Zum Inhalt springen
Menü
Sie müssen registriert sein, um mit der Community zu interagieren.
Diese Frage wurde gekennzeichnet
2937 Ansichten

I'm dos not understand how to add module to existing form. i want add a new one2many field to product.normal.form

i'm get error xml view one install module

module.py

     from openerp.osv import osv, fields 

    class product_product(osv.osv):
        _name = 'product.product'
        _inherit = 'product.product'
        _columns = {
                    'product_category' : fields.selection([('Tubes','Tubes'),('Spotlight','Spotlight'),('Downlight','Downlight'),('Floodlight','Floodlight'),('LedJet','LedJet')],'Pruduct Category'),
                    'sokel_type': fields.one2many('dev.sokel_type', 'sokel_id', 'Sokel Type'),
     }
    product_product()

class dev_sokel_type(osv.osv):
    _name = "dev.sokel_type"
    _description = "Sokel type"
    _columns = {
        'sokel_id': fields.many2one('product.product', 'Sokel ID', ondelete='cascade',select=True),
        'name': fields.char('Sokel Type', size=15, required=False),
        'description': fields.text('Description'),
    }

dev_sokel_type()

update.xml

<?xml version="1.0" encoding="utf-8"?>
<openerp>
  <data>
    <record id="drei_led_product_normal_form_view" model="ir.ui.view">
    <field name="name">product.normal.form</field>
    <field name="model">product.product</field>
    <field name="inherit_id" ref="product.product_normal_form_view"/>
    <field name="arch" type="xml">
     <xpath expr="/form/sheet/notebook/page[@string='Information']/group/group/field[@name='list_price']" position="after">
     <field name="product_category"/>
   <field name="sokel_type" widget="one2many_list" nolabel="1" context="{'sokel_id':active_id}" class="oe_inline oe_no_button"/>

</xpath> </field> </record> </data> </openerp>

Avatar
Verwerfen
Verknüpfte Beiträge Antworten Ansichten Aktivität
1
Jan. 25
1637
2
Sept. 22
9396
2
Apr. 22
4416
0
Juli 21
7103
1
März 21
4801