It's me again
After been able to test and debug your issue locally I endup with this solution that you need to include in you module
class AccountReconciliation(models.AbstractModel):
_inherit = 'account.reconciliation.widget'
@api.model
def get_all_data_for_manual_reconciliation(self, partner_ids, account_ids):
res = super(AccountReconciliation, self).get_all_data_for_manual_reconciliation(partner_ids, account_ids)
for partner_data in res.get('customers', []):
if isinstance(partner_data.get('partner_name'), dict):
partner_data['partner_name'] = partner_data['partner_name'].get(self.env.context['lang'], 'en_US')
return res
The reason it's that after you change res.partner
name
field to be translate=True
and get that change applied into the database that will cause the field column to be of type JSONB so any select to that field using direct SQL will get a JSON Object which is what happens in get_all_data_for_manual_reconciliation
of account.reconciliation.widget
model so I manually check that and properly select the value related to the current user lang stored in the Enviroment Context
Hope that you could solve your issue with this change. I have tested and it's working on my localhost