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

I have installed Odoo 11, and I have a product called "Fire bottle". This product is manufactured. During the sale in the description column Text is added since this product will be customized for the buyer eg " I love him".

I have written the view.xml as below

<record model="ir.ui.view" id="view_form_manufacture_extend">
<field name="name">Description</field>
<field name="model">mrp.production</field>
<field name="inherit_id" ref="mrp.mrp_production_form_view"/>
<field name="arch" type="xml">
<xpath expr="//field[@name='production_location_id']" position="after">
 <field name="Description"></field>
</xpath>
</field>
</record>

and the models.py as shown.

class odoo_customization(models.Model):
_inherit = 'mrp.production'
sale_order_desc=fields.Many2one('sale.order.line', 'Sale_desc')
Description=fields.Char(String='Description', related='sale_order_desc.name')
 

PS: I suspect it is py code. 

Thanks in advance

Ảnh đại diện
Huỷ bỏ

It won't work this way. You would need to customize the code at some level to pass the Description from Sales Order Lines to the MRP. There is no direct relationship between MRP and Sales.

Câu trả lời hay nhất

Hi, do you have found a solution to this problem?

Ảnh đại diện
Huỷ bỏ
Bài viết liên quan Trả lời Lượt xem Hoạt động
2
thg 7 22
9231
1
thg 6 21
2509
2
thg 2 21
299
5
thg 9 20
14388
4
thg 6 20
49795