Skip to content
Snippets Groups Projects
Commit 3b3c7dca authored by Julien Alardot (jual)'s avatar Julien Alardot (jual)
Browse files

[FIX] hr_expense: adding expense after post


As the move is posted,
no editing should ever
be allowed to the expense sheet

task-3458179
opw-3446247

closes odoo/odoo#131173

Signed-off-by: default avatarHabib Ayob (ayh) <ayh@odoo.com>
parent ae33d2e3
Branches
Tags
No related merge requests found
......@@ -766,7 +766,13 @@ class HrExpenseSheet(models.Model):
return self.env['account.journal'].search([('type', 'in', ['cash', 'bank']), ('company_id', '=', default_company_id)], limit=1)
name = fields.Char('Expense Report Summary', required=True, tracking=True)
expense_line_ids = fields.One2many('hr.expense', 'sheet_id', string='Expense Lines', copy=False)
expense_line_ids = fields.One2many(
comodel_name='hr.expense',
inverse_name='sheet_id',
string='Expense Lines',
copy=False,
states={'post': [('readonly', True)], 'done': [('readonly', True)], 'cancel': [('readonly', True)]}
)
state = fields.Selection([
('draft', 'Draft'),
('submit', 'Submitted'),
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment