[FIX] base: company.bank_ids is not the company of the company

This field was only used by thinking it was the banks owned by the
company, and not the banks registered for all partners by that
company.[1]
It has always been like that, since 7eab8e26d3
even though the field didn't exist on `res.company` before that
refactoring.

[1]: checked with the following regex `compan((y(_ids?)?)|ies)\.bank_ids`

closes odoo/odoo#73229

Signed-off-by: oco-odoo <oco-odoo@users.noreply.github.com>
This commit is contained in:
william-andre
2021-07-21 13:12:20 +00:00
committed by oco-odoo
parent 7aef86fa69
commit 177dbd60a2
+1 -1
View File
@@ -78,7 +78,7 @@ class Company(models.Model):
'res.country.state', compute='_compute_address', inverse='_inverse_state',
string="Fed. State", domain="[('country_id', '=?', country_id)]"
)
bank_ids = fields.One2many('res.partner.bank', 'company_id', string='Bank Accounts', help='Bank accounts related to this company')
bank_ids = fields.One2many(related='partner_id.bank_ids', readonly=False)
country_id = fields.Many2one('res.country', compute='_compute_address', inverse='_inverse_country', string="Country")
email = fields.Char(related='partner_id.email', store=True, readonly=False)
phone = fields.Char(related='partner_id.phone', store=True, readonly=False)