I have added two additional fields to the partners model to clearly identify them as customers or suppliers.
is_customer = fields.Boolean(string='Is a Customer')
is_supplier = fields.Boolean(string='Is a Vendor')
We need that in the account.view_move_form form, when a customer invoice is transacted, only the business partners marked as customers appear, and when a supplier invoice is transacted, only the suppliers appear.
Try replacing the partner_id field using domain to filter and move_type to make the field invisible in each case.
" rel="ugc">ir.ui.view">
account.move
Apparently this worked well in the BIlls, but in the invoices the Customer field appears with the supplier domain.
The form code was truncated
<record id="account_invoice_form" model="ir.ui.view">
<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="replace">
<field name="partner_id" widget="res_partner_many2one" string="Customer" context="{'res_partner_search_mode': (context.get('default_move_type', 'entry') in ('out_invoice', 'out_refund', 'out_receipt') and 'customer') or (context.get('default_move_type', 'entry') in ('in_invoice', 'in_refund', 'in_receipt') and 'supplier') or False,'show_address': 1, 'default_is_company': True, 'show_vat': True}" domain="[('type', '!=', 'private'), ('company_id', 'in', (False, company_id)),['is_customer','=',True]]" options="{'always_reload': True, 'no_quick_create': True}" attrs="{'invisible': [('move_type', 'not in', ('out_invoice', 'out_refund', 'out_receipt'))]}"/>
<field name="partner_id" widget="res_partner_many2one" string="Vendor" context="{'res_partner_search_mode': (context.get('default_move_type', 'entry') in ('out_invoice', 'out_refund', 'out_receipt') and 'customer') or (context.get('default_move_type', 'entry') in ('in_invoice', 'in_refund', 'in_receipt') and 'supplier') or False,'show_address': 1, 'default_is_company': True, 'show_vat': True}" domain="[('type', '!=', 'private'), ('company_id', 'in', (False, company_id)),['is_supplier','=',True]]" options="{'always_reload': True, 'no_quick_create': True}" attrs="{'invisible': [('move_type', 'not in', ('in_invoice', 'in_refund', 'in_receipt'))]}"/>
</xpath>
</field>
</record>
Here is a video to show the behavior.
https://watch.screencastify.com/v/rqITOtlcj4buRw8IsAIS