Hi,
I have a custom Many2one field defined in the model account.invoice which uses the model account.analytic.account and is using a domain in xml as domain="[('customer', '=', True)]" required="1". The domain field here is from account.invoice so when i execute this code it gives an error as
ValueError: Invalid field 'customer' in leaf "<osv.ExtendedLeaf: ('customer', '=', True) on account_analytic_account (ctx: )>"
The field is defined as follows
class AccountInvoiceInherit(models.Model):
_inherit = 'account.invoice'
company_selection = fields.Many2one('account.analytic.account', string="Company")
In the view, i'm using as follows
<record model="ir.ui.view" id="invoice_form_inherit">
<field name="name">account.invoice.form.inherit.account</field>
<field name="model">account.invoice</field>
<field name="inherit_id" ref="account.invoice_form"/>
<field name="arch" type="xml">
<xpath expr="//form/sheet/group[1]/group[2]" position="replace">
<group>
<field name="company_selection" domain="[('customer', '=', True)]" required="1"/>
</group>
</xpath>
</field>
</record>
Can anyone tell me how to use the domain of another model?