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

I want that all messages with attachements written manually in the purchase requisition are copied automatically in the purchase order generated.

How to proceed? Any help please.

Thanks

Ảnh đại diện
Huỷ bỏ
Câu trả lời hay nhất

We can show the messages of purchase requisition in a new CHATTER BOX at Purchase Order/Quotation by adding a related field.

class purchase_order(orm.Model):
    _inherit='purchase.order' 
    _columns = {
                'requisition_message_ids': fields.related('requisition_id', 'message_ids', type="one2many"),
                } 

        <record model="ir.ui.view" id="purchase_order_form_inherit">
            <field name="name">purchase.order.sciencefirst</field>
            <field name="model">purchase.order</field>
            <field name="inherit_id" ref="purchase.purchase_order_form" />
            <field name="arch" type="xml">
                <xpath expr="//form[@string='Purchase Order']" position="inside">
                    <div class="oe_chatter">
                        <field name="requisition_message_ids" widget="mail_thread"/>
                    </div>
                </xpath>
            </field>
        </record>

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

Thanks, that works!