I have an inherited model from res.partner.bank which i added a custom field called location to, this is how the model looks like.
class SalesPartnerBankInherit(models.Model):
_inherit = 'res.partner.bank'
location = fields.Char()
I have another inherited model from sale.order with a field that has a many2one relationship to res.partner.bank I want to show only 1 record on the many2one dropdown if there are more than 1 records in res.partner.bank that has the same location field value? This is my inherited sale.order model with the many2one location_id field
location_id = fields.Many2one('res.partner.bank',
string='Bank Account Location')
So if there are duplicate res.partner.bank records with the same location, I want to show only 1 record on the dropdown.
compute
field and in compute method assign only one record to it. – Adam Strauss