So I have created a One2many field in a sale.order model
class SaleOrder(models.Model):
_inherit = 'sale.order'
hr_expense_ids = fields.One2many('hr.expense', 'sale_order_id', string='Expenses')
I also created a form/tree view for the `hr_expense_ids` field in the sales order view so we can see all expenses attached to it.
Everything is working well, except that `hr.expense` records created this way are only visible to user with access to all expenses and/or their own expenses
For example, user A (Sales/User) created a sales order and attach expense e1 and e2 for the sales order. On the other hand, user B (administrator) attach expense e3 and e4 to the same sales order. The problem is, user B can see expense e1, e2, e3 and e4 but user A can't see expense e3 and e4, he can only see his own expense (e1 and e2). How can I configure this so that all records are shown to all users with access to the same sales order?
I cannot post images to show you the screenshot (it says I'm not allowed to access 'attachment' records).