In our custom module we have introduced a new model (for software licenses) that needs to reference the according invoice line. The field is declared as follows (API v8):
invoice_line = fields.Many2one(string='Invoice line', comodel_name='account.invoice.line')
The view includes the field as follows:
<field name="invoice_line" options="{'no_create_edit':'1'}"/>
Now our problem is that the selection widget for the field only presents the descriptions of the invoice lines... giving absolutely no indication about e.g. the invoice number. This is really an issue since we use standardized invoice line descriptions and thus have many invoices containing invoice lines with identical descriptions (which makes it impossible to select the correct invoice line from the correct invoice).
What would be the best strategy to overcome this issue?
Do we have to introduce an additional field to select the invoice first and then (in the second step) select an invoice line from a filtered list (showing only the invoice lines from the previously selected invoice)?