Odoo Help

1

one2many create and edit is not coming

By
Soohoo
on 1/6/14, 10:02 AM 1,976 views

View File

<?xml version="1.0" encoding="UTF-8"?>
    <openerp>
    <data>
    <!-- tree view -->
    <record id="test_tree_view" model="ir.ui.view">
                <field name="name">test.tree</field>
                <field name="model">test.rel</field>
                <field name="type">tree</field>
                <field eval="7" name="priority"/>
                <field name="arch" type="xml">
                    <tree string="TEST">
                        <field name="name"/>
                    </tree>
                </field>
    </record>
    <!--form view-->

    <record id="test_form_view" model="ir.ui.view">
                <field name="name">test.form</field>
                <field name="model">test.rel</field>
                <field name="type">form</field>
                <field eval="7" name="priority"/>
                <field name="arch" type="xml">
                    <form string="TEST">

                        <group colspan="2" col="3">
                        <field name="name"/>
                        </group>

                    <notebook colspan="6">
                        <page string="Tests">

        <field colspan="4" name="test_lines" nolabel="1" widget="one2many_list">
                                <tree editable="top" colors="red:test in ()">
                                    <field name="test"/>
                                    <field name="comment"/>
                                </tree>

                                    <form string="Tests ">
                                       <field name="test"/>
                                       <field name="comment"/>
                                   </form>
    </field>
                        </page>

    </notebook>

                    </form>
                </field>
    </record>

    <record id="test_action" model="ir.actions.act_window">
                <field name="name">test</field>
                <field name="type">ir.actions.act_window</field>
                <field name="res_model">test.rel</field>
                <field name="view_type">form</field>
                <field name="view_mode">tree,form</field>
                <field name="view_id" ref="test_tree_view"/>
     </record>
    <menuitem id="menu_test_3" parent="menu_section_test" name="Test 3" action="test_action" />

    </data>
    </openerp>

PY file

class test_rel(osv.osv):
    _name = 'test.rel'
    _columns = {
        'name': fields.char('Reference', size=50),
        'test_lines': fields.one2many('test.lines', 'test_id', 'test Lines'),
    }
#test_rel()

class test(osv.osv):
    _name = 'test.lines'
    _columns = {
        'test_id': fields.many2one('test.rel', 'Parent test', ondelete='cascade',select=True),
        'test': fields.char('Test', size=40),
        'comment': fields.text('Commentaire',size=400),
    }
#test()

Why selection is not coming when selecting an item in one 2many filed It should list all the availiable records

Pleas Help

About This Community

This platform is for beginners and experts willing to share their Odoo knowledge. It's not a forum to discuss ideas, but a knowledge base of questions and their answers.

Register

Odoo Training Center

Access to our E-learning platform and experience all Odoo Apps through learning videos, exercises and Quizz.

Test it now

Question tools

0 follower(s)

Stats

Asked: 1/6/14, 10:02 AM
Seen: 1976 times
Last updated: 3/16/15, 8:10 AM