【问题标题】:Openerp module output not generated properlyOpenerp 模块输出未正确生成
【发布时间】:2014-02-05 06:32:55
【问题描述】:

这是我的代码:

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>

这是输出:

不,字段标签/名称/ID。如何定义和解决这个问题。

我也研究了这个链接:

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

但仍然无法解决这个问题。此外,我没有为我的这个模块编写任何树视图代码。因此,当我转到树视图时,它也显示了一些警告错误。需要了解视图的差异并解决现有的错误。

【问题讨论】:

    标签: xml openerp openerp-7


    【解决方案1】:

    试试这个。使用组或标签。更新你的观点。

    <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>
    

    并且不要忘记在进行此更改后更新您的模块。

    【讨论】:

    • 不可能。这一定有效。我可以知道你如何更新你的模块吗?
    • 将该文件放在插件文件夹模块文件中,然后转到设置 -> 应用计划升级 -> 更新
    • 我试图卸载它。但显示此错误 -> 完整性错误 操作无法完成,可能是由于以下原因: - 删除:您可能试图删除一条记录,而其他记录仍在引用它 - 创建/更新:未正确设置必填字段[对象引用:ir.model.constraint - ir.model.constraint]
    • 你做错了。转到设置-> 已安装模块-> 现在在过滤器中搜索您的模块名称。单击您的模块,您将看到显示模块详细信息的表单视图。会有一个名为“升级”的按钮。点击那个。它将更新更改然后再次检查
    • 创建一个新的虚拟机和数据库。试一试,显示标签错误,解决它,现在它正在运行。
    猜你喜欢
    • 1970-01-01
    • 2014-05-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2016-05-16
    • 2021-12-29
    相关资源
    最近更新 更多