Skip to Content
Menu
This question has been flagged
4 Replies
8657 Views

I am a beginner using Odoo 9 Community Edition.

I have created Company A and Company B, which are both Vendors.  Then I created Product A and Product B and set the vendors in the products inventory tab, respectively.

If I then create a purchase order and choose a vendor (e.g. Company A) and then click on Add an item, both Product A and Product B are shown in the dropdown list. But only one product should be shown (in this case only Product A).

How can I configure that?

Avatar
Discard
Best Answer

Hello you can check this answer:

<?xml version="1.0" encoding="UTF-8" ?>
<odoo>
    <record id="purchase_order_form_inherit" model="ir.ui.view">
        <field name="name">purchase.order.form.inherit</field> 
        <field name="model">purchase.order</field>
        <field name="inherit_id" ref="purchase.purchase_order_form"/>
        <field name="priority" eval="8"/>
        <field name="arch" type="xml">
            <xpath expr="//field[@name='order_line']/tree/field[@name='product_id']" position="attributes">
                <attribute name="domain">['|',
                    ('seller_ids.name', '=', parent.partner_id),
                    ('seller_ids.name.child_ids', '=', parent.partner_id),
                    ('purchase_ok', '=', True)]
                </attribute>
            </xpath>
        </field>
    </record>
</odoo>

Avatar
Discard
Author Best Answer

I did, thanks. Unfortunately it does not solve my problem.

Avatar
Discard
Best Answer

Hello,

For show only vendor related product first open list of all product.

in upper side you  have option called filter

in that select can be purchased it filters all the product and give you product that you can purchase (means vendor  related product )

and same as you can filter the product that can you sell  by selecting option can be sell.

Avatar
Discard