From 177dbd60a279e456736a1db4a167c2c85db331bd Mon Sep 17 00:00:00 2001 From: william-andre Date: Mon, 5 Jul 2021 13:11:10 +0000 Subject: [PATCH] [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 7eab8e26d3d46c53f4be924d6a34e80a66e74960 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 --- odoo/addons/base/models/res_company.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/odoo/addons/base/models/res_company.py b/odoo/addons/base/models/res_company.py index 81e703100f9..3ee845aad83 100644 --- a/odoo/addons/base/models/res_company.py +++ b/odoo/addons/base/models/res_company.py @@ -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)