Odoo Help

0

0
4 Answers
0
legland
1/30/19, 9:46 AM

Hello,

i always added it:

'data': [

        # 'security/ir.model.access.csv',

        'views/stock_production_lot_views.xml',


    ],


If i used model="ir.ui.view" NOt working, so i have to use model="ir.actions.act_window".
And "res_model" for ir.actions.act_window.

Update my answer

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

<odoo>

  <record model="ir.actions.act_window" id="production_lot_form_view"> <!-- ir.ui.view and name="model" with error definition view odoo12 -->

    <field name="name">production.lot.form.view</field>

    <field name="res_model">stock.production.lot</field>

    <field name="mode">primary</field>

    <field name="inherit_id" ref="stock.view_production_lot_form" />

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

<xpath expr="//field[@name='ref'] position="after">

<field name="children_ids">

          <tree>

            <field name="name" />

            <field name="qty" />

          </tree>

        </field>

</xpath>

----------------------- or --------------------------------

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

        <field name="children_ids">

          <tree>

            <field name="name" />

            <field name="qty" />

          </tree>

        </field>

       </field>

    </field>

  </record>

</odoo>


Still not working !


The good is  :  <xpath expr="/form/sheet/group" position="after">

2 Comments
legland
1/30/19, 9:53 AM

raise ValidationError(_('Invalid view %s definition in %s') % (view.name, view.arch_fs))

odoo.tools.convert.ParseError: "Invalid view view_production_lot_form_ath definition in stock_serial/views/stock_production_lot_views.xml

None" while parsing /odoo/odoo12/addons/stock_serial/views/stock_production_lot_views.xml:3, near

<record id="production_lot_form_view" model="ir.ui.view">

Mitul Shingala
1/30/19, 11:06 AM

add the tag <odoo> into your file. i have update my answer, see that.

0
Avatar

Mitul Shingala

--Mitul Shingala--

2294
| 6 3 9
Rajkot, India
--Mitul Shingala--

Odoo Developer

Mitul Shingala
1/30/19, 9:41 AM

hello,

in your __manifest__.py file,  add your xml file.

like 'data': ['your_file.xml'], 

<odoo>
<record id="your_unique_xml_id" model="ir.ui.view">
<field name="name">stock.prodution.lot.form</field>
<field name="model">stock.production.lot</field>
<field name="inherit_id" ref="stock.view_production_lot_form" />
<field name="arch" type="xml">
      <xpath expr="//field[@name='product_id']" position="before"> <!-- or After -->
      <field name="newField"/>
  </xpath>
</field>
</record>
</odoo>
Ask a Question
Writer
Keep Informed
1 follower(s)
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