我想在制造页面的默认视图中抑制股票价值变化图表的显示.我正在使用继承来修改表单.现在我可以继承表单并获取其他操作来显示.但是,我无法对action,form或"arch"字段使用position ="replace".那么如何停止显示股票价值变动或其他图表呢?
背景:我是OpenERP的新手,我正在尝试使用Manufacturing模块创建一个自定义应用程序来跟踪原型硬件开发.我想要的大部分功能已经存在,所以OpenERP非常适合.但是,第一步是禁用任何不必要的东西.继承和更换领域,从显示出来制止他们一直没有问题,但我没有任何运气摆脱的动作是创建报表和图表.
相关问题:
将制造页面单独留下并创建一个全新的"Prototypes"模块会更好吗?换句话说,现在我正在尝试更改制造页面的行为 - 创建新模块并添加"原型"按钮以及销售/采购/仓库/制造/会计/设置更好默认页面的顶部?
我不确定默认制造页面顶部的额外"更改布局"按钮来自何处,或者如何摆脱它.有任何想法吗?
问题是我从动态名称派生出来并在另一个模块中引用它们吗?(例如,mrp_boot_view.xml中的name ="%(procurement.procurement_exceptions)d").
Windows上的OpenERP 6.1,在本地安装所有内容.
这是代码:
__openerp__.py:
{
"name" : "prototyping tool",
"version" : "0.1",
"author" : "",
"website" : "",
"category" : "Manufacturing",
"sequence": 19,
"images" : [],
"depends" : ["mrp", "base"],
"description": """initial version doesn't do much, simplifies MRP views.""",
'init_xml': [],
'update_xml': ["mrp_boot_view.xml"],
'demo_xml': [],
'test': [],
'installable': True,
'application': True,
'auto_install': False,
'certificate': '',
}
Run Code Online (Sandbox Code Playgroud)
__init__.py:
import mrp_boot
import mrp
Run Code Online (Sandbox Code Playgroud)
mrp_boot.py:
# None of this functionality is currently used
import mrp_boot
import mrp
from osv import fields, osv
class mrp_boot(osv.osv):
_name = "mrp_boot"
_inherit = "purchase.order"
def _get_boot_expense_category(self, cursor, user_id, context=None):
return (
('NRE', 'NRE'),
('MatProto', 'Materials / Prototype'),
('Capital', 'Capital'),
('Loaner', 'Loaner'))
_columns = {
'boot_expense_category':
fields.selection( _get_boot_expense_category
, 'Expense Category'
, help="How the equipment for the entire PO is to be expensed. If multiple methods will be used, multiple POs must be created"),
}
mrp_boot()
Run Code Online (Sandbox Code Playgroud)
mrp_boot_view.xml:
# I'd like to supress the display of the charts generated by the actions
<?xml version="1.0" ?>
<openerp>
<data>
<record id="board_mrp_manager_form" model="ir.ui.view">
<field name="name">board.mrp.manager.form</field>
<field name="model">board.board</field>
<field name="inherit_id" ref="mrp.board_mrp_manager_form" />
<field name="type">form</field>
<field name="priority" eval="15"/>
<field name="arch" type="xml">
<form string="Manufacturing board">
<board style="2-1">
<column>
<action name="%(procurement.procurement_exceptions)d" string="New Prototype Outlook" domain="[('state','=','exception')]"/>
</column>
<column>
</column>
</board>
</form>
</field>
</record>
</data>
</openerp>
Run Code Online (Sandbox Code Playgroud)
您不能使用replace属性来修改操作中的任何内容.
要继承操作或在操作中进行更改,您可以覆盖操作的ID.
例如,我想覆盖采购模块的操作,然后我可以根据我的要求更改view_type或view_mode或context或search_view_id:
<record id="procurement.procurement_exceptions" model="ir.actions.act_window">
<field name="name">Procurement Exceptions</field>
<field name="type">ir.actions.act_window</field>
<field name="res_model">procurement.order</field>
<field name="view_type">form</field>
<field name="view_mode">form</field>
<field name="context">{'search_default_perm_exceptions':1}</field>
<field name="search_view_id" ref="procurement.view_procurement_filter"/>
</record>
Run Code Online (Sandbox Code Playgroud)
从继承的视图中删除额外的东西(取自评论):
<record id="my_customized_board_mrp_manager_form" model="ir.ui.view">
<field name="name">board.mrp.manager.form</field>
<field name="model">board.board</field>
<field name="inherit_id" ref="mrp.board_mrp_manager_form" />
<field name="type">form</field>
<field name="arch" type="xml">
<action name="%(mrp.action_report_in_out_picking_tree)d" position="replace"/>
</field>
<record>
Run Code Online (Sandbox Code Playgroud)