Bỏ qua để đến Nội dung
Menu
Câu hỏi này đã bị gắn cờ
3240 Lượt xem

Hi, 

I want help to solve this issue:

I created a new field in the product page:





product.product.form.inherit
product.product









And I want to get the value from this field (in product page) to a field I aslo created in the work order. Here is the code for work order:





mrp.production.work.order.form.inherit
mrp.workorder









I want the data to be editable on the product page, and readonly in the work order so may anyone help?

Waiting for a reply.


Thanks



Ảnh đại diện
Huỷ bỏ
Tác giả

Code for product page:
<?xml version="1.0"?>
<odoo>
<data>
<record id="product_product_form_inherit" model="ir.ui.view">
<field name="name">product.product.form.inherit</field>
<field name="model">product.product</field>
<field name="inherit_id" ref="product.product_normal_form_view"/>
<field name="arch" type="xml">
<xpath position="after" expr="//field[@name='product_id']">
<field name="net_weight"/>
<field name="gross_weight"/>
</xpath>
</field>
</record>
</data>
</odoo>

Tác giả

for work order:
<?xml version="1.0"?>
<odoo>
<data>
<record id="mrp_production_work_order_form_inherit" model="ir.ui.view">
<field name="name">mrp.production.work.order.form.inherit</field>
<field name="model">mrp.workorder</field>
<field name="inherit_id" ref="mrp.mrp_production_workorder_form_view_inherit"/>
<field name="arch" type="xml">
<xpath position="after" expr="//field[@name='product_id']">
<field name="doc.product_id.net_weight"/>
<field name="doc.product_id.gross_weight"/>
<field name="technician_id"/>
<field name="worker_ids"/>
<field name="supervisor_id"/>
</xpath>
</field>
</record>
</data>
</odoo>

Bài viết liên quan Trả lời Lượt xem Hoạt động
2
thg 12 21
6247
1
thg 5 21
4778
0
thg 10 24
661
2
thg 12 23
9826
Many2many fields Đã xử lý
2
thg 3 23
3755