在openERP编辑表单视图中获取值
我在表单中有选择字段在openERP编辑表单视图中获取值,openerp,openerp-7,Openerp,Openerp 7,我在表单中有选择字段 <field name="company_id" groups="base.group_multi_company" widget="selection"/> 我必须将在域筛选器的选择字段中选择的值作为公司id传递到下面 <tree string="Components" editable="bottom"> <field name="product_id" context="{'default_supply_method
<field name="company_id" groups="base.group_multi_company" widget="selection"/>
我必须将在域筛选器的选择字段中选择的值作为公司id传递到下面
<tree string="Components" editable="bottom">
<field name="product_id" context="{'default_supply_method':'produce'}" on_change="onchange_product_id(product_id, name)" domain="[('company_id','=',**company_id**),('stage','=','confirmed')]" />
</tree>
现在,我需要将名为company\u id
的字段的值传递到名为product\u id
帮我做这个 要获取保存在表单视图中的字段“company\u id”的值,您需要在树状视图定义中添加此字段,如果不需要在树状视图中看到它,请在xml定义中放置invisible=“1”
<tree string="Components" editable="botton">
<field name="company_id" invisible="1" />
<field name="product_id" context="{'default_supply_method':'produce'}" on_change="onchange_product_id(product_id, name)" domain="[('company_id','=',**company_id**),('stage','=','confirmed')]" />
</tree>
谢谢你的回复,昆汀。它工作得很好。但我需要的是,我们已经配置了多公司。如果我正在创建采购订单,则产品线项目将显示所有公司的产品。所以,我试图过滤它在产品领域一旦公司对采购订单被选中。希望,我很清楚。