Q & A

Question and answer is powered by anspress.net

Question 1:

Source: Odoo Forum

User: Isa MArzooq

Link: After choosing the customer name I want to show only the projects linked to him | Odoo

🛑Q: I have add field which called project name in the invoice from view, and I want to add domain for to show which when I choose the customer name will show for me only the projects linked to him

✅A: Here the user Isa MArzooq wanted the Project name field associated with the customer. To render project associated with customer, we need to update few things:

At view level set below code, this will extend the account.move form view in Odoo to include a project_name field after the partner_id field.

<?xml version="1.0" encoding="utf-8"?>
<odoo>
    <record id="view_move_form_inherit" model="ir.ui.view">
        <field name="name">account.move.form.inherit</field>
        <field name="model">account.move</field>
        <field name="inherit_id" ref="account.view_move_form"/>
        <field name="arch" type="xml">
            <xpath expr="//field[@name='partner_id']" position="after">
                <field name="project_name" widget="many2many_tags"/>
            </xpath>
        </field>
    </record>
</odoo>