Open Nick-OpusVL opened 5 years ago
Consider whether this is likely to be an issue in:
Fix the issue in:
Effectively, there are at least two taxes that satisfy the following condition in the database in question:
self.output_account_type = self.env['account.account.type'].search([
('code', '=', 'Output Tax'),
('name', '=', 'Output Tax')])
but when assigning to a many2one there can only be zero or one records (this makes sense if you think about it).
There's a possibility the line below it might also suffer the same fate, which does similar in the same way but looks for Input Tax.
We need to decide if it's a data bug or it's reasonable to have this situation and therefore should handle it in the code. If it's a data bug, we could at least trap the >2 matches case and throw a more user-friendly error message.
How to reproduce
account_mtd_vat
MTD/Administrator
andMTD/User
to admin accountWhat should happen
Should not have an error, so we can fill in fields.
What happens
In the GUI we see
Odoo Warning
dialogue with bodyExpected singleton: account.account.type(25, 37)
In the logs, we see this: