Skip to Content
เมนู
คุณต้องลงทะเบียนเพื่อโต้ตอบกับคอมมูนิตี้
คำถามนี้ถูกตั้งค่าสถานะ
3 ตอบกลับ
7435 มุมมอง

Hi,

    I have a form with a field like this:

     <record model="ir.ui.view" id="point_of_sale.view_pos_config_form_test">

        <field name="name">pos.config.test</field>

        <field name="model">pos.config</field>

        <field name="priority">25</field>

        <field name="inherit_id" ref="point_of_sale.view_pos_config_form"/>

        <field name="arch" type="xml">

            <field name="journal_ids" position="after">

                <separator string="Test" colspan="4"/>

                <field name="test_ids" colspan="4" nolabel="1">

                    <tree string="Test">

                        <field name="name"/>

                    </tree>

                </field>

            </field>

        </field>

    </record>

    And this models:


    class pos_order_test(models.Model):

    _name = "pos.order.test"

    _rec_name = "name"


    name = fields.Char('Nombre')

    config_id = fields.Many2one(

        'pos.config', string='Point of Sale',

        help="The physical point of sale you will use.",

        required=True,

        index=True)


class PosConfig(models.Model):

    _inherit = 'pos.config'

    test_ids = fields.One2many('pos.order.test', 'config_id', string='Tests')

The thing is that after some Odoo upgrades "Add new item" buttom disapeared. If I force with create="true" it appears, but when you click this buttom new window inputs appear disabled.


Any clue?

อวตาร
ละทิ้ง
คำตอบที่ดีที่สุด

give attribute create="1" to the tree. or check the access rights of logged in user for the current model.

อวตาร
ละทิ้ง
คำตอบที่ดีที่สุด

Just You need to click the edit Option then you can see the "Add an item" Option on the line

i make this mistake once thats why im giving this answer...  :  )

OR

if you saw an error just check access rights of that user

อวตาร
ละทิ้ง
คำตอบที่ดีที่สุด

Hi Gedeon, try to add "editable" option to the tree of the one2many field.

<field name="test_ids" colspan="4" nolabel="1">
                    <tree string="Test" editable="bottom">
                        <field name="name"/>
                    </tree>
                </field>
อวตาร
ละทิ้ง
Related Posts ตอบกลับ มุมมอง กิจกรรม
3
เม.ย. 24
1750
2
พ.ย. 18
13204
2
มี.ค. 16
7462
1
มี.ค. 15
8195
0
มี.ค. 15
4207