Friday, July 18, 2025
2 changes · 17.0
Resolved issues and error corrections
This fix updates an internal test setup so inventory accounting information is available when validating deliveries. It helps keep the sales, project, and stock integration checks reliable in builds without demo data, reducing false build failures.
Original PR description
This problem was introduced with [203936](https://github.com/odoo/odoo/pull/203936/commits/a6bde40096da2e16d58b9dcc300c607b40633038) The test `test_report_invoice_items_anglo_saxon_automatic_valuation` throws an error because a stock input account cannot be found for the product avco product. This breaks the class `TestSaleProjectStockProfitability`in the 17.0 No demo build. Runbot - [229892](https://runbot.odoo.com/odoo/runbot.build.error/229892)
Users without administration settings access can now use the Reload AI Data button on invoices without encountering an access error. This keeps invoice AI data refreshes available to functional users while safely checking whether India tax localization is installed.
Original PR description
When clicking on the "Reload AI Data" button (`account.move::action_reload_ai_data`), a user not in `base.group_system` group encounters an access rights error when searching on `ir.module.module` model in `account.move::is_indian_taxes()`:
```python
def is_indian_taxes(self):
l10n_in = self.env['ir.module.module'].search([('name', '=', 'l10n_in')])
return self.company_id.country_id.code == "IN" and l10n_in and l10n_in.state == 'installed'
```
This commit adds `sudo()` to the `search` call to ensure that the check for the 'l10n_in' module does not fail for users not belonging to "Administration/Settings" group.
This prevents a traceback and ensures that functional users can reload AI data.