Question

Here is my code:

import product_specification

openerp.py

{
'name': "Product Specification",
'version': "1.0",
'author': "iologic",
'category': "Tools",
'depends': ['product'],
'data': ['product_specification.xml'],
'demo': [],
'installable': True,

}

product_specification.py

    from openerp.osv import osv, fields

class product_specification(osv.osv):

  _inherit = "product.product"
  _name = "product.specification"

  _columns = {
    'prototype': fields.char('Prototype#', size=20),
    'style': fields.char('Style#', size=20),
    'customer': fields.char('Customer', size=20),
    'body_type': fields.char('Body Type', size=20),
    'program_brand': fields.char('Program/Brand', size=20),
    'color_asstmnt': fields.char('Color Asstmnt', size=200),
    'size_info': fields.integer('Size Info', size=20),
    'description': fields.char('Description', size=500),
    'designer': fields.char('Designer', size=20),
    'factory': fields.char('factory', size=20),
    'pcs_hanger': fields.integer('Pcs/Hanger', size=20),
    'developed_sold': fields.char('Developed/Sold', size=20),

  }


product_specification()

product_specification.xml

    <?xml version="1.0" encoding="utf-8"?>
<openerp>
<data>
<record model="ir.ui.view" id="product_specification_product">
    <field name="name">product.specification</field>
    <field name="model">product.specification</field>
    <field name="arch" type="xml">
      <form string="Create Product Specification" version="7.0">
        <field name="prototype">prototype</field>
        <field name="style">style</field>
        <field name="customer">customer</field>
        <field name="body_type">body type</field>
        <field name="program_brand">program brand</field>
        <field name="color_asstmnt">color Asstment</field>
        <field name="size_info">size info</field>
        <field name="description">description</field>
        <field name="designer">designer</field>
        <field name="factory">factory</field>
        <field name="pcs_hanger">pcs hanger</field>
        <field name="developed_sold">developed sold</field>
       </form>
    </field>
</record>
<record id="product_specification_product_act_window" model="ir.actions.act_window">
        <field name="name">Product Specification</field>
        <field name="type">ir.actions.act_window</field>
        <field name="res_model">product.specification</field>
        <field name="view_type">form</field>
        <field name="view_id" ref="product_specification_product"/>
</record>
<menuitem id="menu_product_specification" name="Product Specification" action="product_specification_product_act_window"/>
</data>
</openerp>

Here is the output :

Screen capture for output view

No, fields tag / name / id. How to define that & solve this problem.

I also study this link:

http://openerp-server.readthedocs.org/en/latest/03_module_dev_03.html

But still can't fix that. More over I am not write any tree view code for my this module. So, when I go to tree view it's showing some warning error too. Need to understand the difference of views & solve existing bug.

Was it helpful?

Solution

Try this. use group or label. update your view.

<record model="ir.ui.view" id="product_specification_product">
<field name="name">product.specification</field>
<field name="model">product.specification</field>
<field name="arch" type="xml">   
  <form string="Create Product Specification" version="7.0">
    <group>
    <field name="prototype"/>
    <field name="style"/>
    <field name="customer"/>
    <field name="body_type"/>
    <field name="program_brand"/>
    <field name="color_asstmnt"/>
    <field name="size_info"/>
    <field name="description"/>
    <field name="designer"/>
    <field name="factory"/>
    <field name="pcs_hanger"/>
    <field name="developed_sold"/>
    </group>
   </form>
</field>
</record>

and don't forget to update your module after doing this changes.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top