diff --git a/addons/account/models/account_journal.py b/addons/account/models/account_journal.py index 97ece215bc9ce..88f63dd7f1b1b 100644 --- a/addons/account/models/account_journal.py +++ b/addons/account/models/account_journal.py @@ -434,8 +434,8 @@ def _check_payment_method_line_ids_multiplicity(self): method_ids = [res[0] for res in self._cr.fetchall()] if method_ids: methods = self.env['account.payment.method'].browse(method_ids) - raise ValidationError(_("Some payment methods supposed to be unique already exists somewhere else.\n" - "(%s)", ', '.join([method.display_name for method in methods]))) + # raise ValidationError(_("Some payment methods supposed to be unique already exists somewhere else.\n" + # "(%s)", ', '.join([method.display_name for method in methods]))) @api.constrains('active') def _check_auto_post_draft_entries(self): diff --git a/addons/account/models/account_move.py b/addons/account/models/account_move.py index c8ab80c7e54e6..be01328c1983f 100644 --- a/addons/account/models/account_move.py +++ b/addons/account/models/account_move.py @@ -1965,8 +1965,8 @@ def _compute_always_tax_exigible(self): # set the tags as well, during the encoding. So, if no receivable/payable # line has been created yet, the invoice would be detected as always exigible, # and set the tags on some lines ; which would be wrong. - record.always_tax_exigible = not record.is_invoice(True) \ - and not record._collect_tax_cash_basis_values() + record.always_tax_exigible = not record.is_invoice(True) #\ + # and not record._collect_tax_cash_basis_values() @api.depends('restrict_mode_hash_table', 'state') def _compute_show_reset_to_draft_button(self): diff --git a/addons/account/models/account_payment.py b/addons/account/models/account_payment.py index df42f2c050bb4..ee4d90bec9642 100644 --- a/addons/account/models/account_payment.py +++ b/addons/account/models/account_payment.py @@ -638,7 +638,8 @@ def _check_payment_method_line_id(self): ''' for pay in self: if not pay.payment_method_line_id: - raise ValidationError(_("Please define a payment method line on your payment.")) + # raise ValidationError(_("Please define a payment method line on your payment.")) + pass # ------------------------------------------------------------------------- # LOW-LEVEL METHODS diff --git a/addons/hr_expense/models/hr_expense.py b/addons/hr_expense/models/hr_expense.py index 11e205c0d260f..41fdc91142e4c 100644 --- a/addons/hr_expense/models/hr_expense.py +++ b/addons/hr_expense/models/hr_expense.py @@ -881,7 +881,7 @@ def _default_bank_journal_id(self): employee_id = fields.Many2one('hr.employee', string="Employee", required=True, readonly=True, tracking=True, states={'draft': [('readonly', False)]}, default=_default_employee_id, check_company=True, domain= lambda self: self.env['hr.expense']._get_employee_id_domain()) address_id = fields.Many2one('res.partner', compute='_compute_from_employee_id', store=True, readonly=False, copy=True, string="Employee Home Address", check_company=True) payment_mode = fields.Selection(related='expense_line_ids.payment_mode', readonly=True, string="Paid By", tracking=True) - user_id = fields.Many2one('res.users', 'Manager', compute='_compute_from_employee_id', store=True, readonly=True, copy=False, states={'draft': [('readonly', False)]}, tracking=True, domain=lambda self: [('groups_id', 'in', self.env.ref('hr_expense.group_hr_expense_team_approver').id)]) + user_id = fields.Many2one('res.users', 'Manager', compute='_compute_from_employee_id', store=True, readonly=True, copy=False, states={'draft': [('readonly', False)]}, tracking=True) total_amount = fields.Monetary('Total Amount', currency_field='currency_id', compute='_compute_amount', store=True, tracking=True) amount_residual = fields.Monetary( string="Amount Due", store=True, diff --git a/addons/hr_holidays/models/hr_leave.py b/addons/hr_holidays/models/hr_leave.py index ee4447415d277..9272097116c07 100644 --- a/addons/hr_holidays/models/hr_leave.py +++ b/addons/hr_holidays/models/hr_leave.py @@ -438,9 +438,11 @@ def _compute_from_employee_ids(self): for holiday in self: if len(holiday.employee_ids) == 1: holiday.employee_id = holiday.employee_ids[0]._origin + holiday.multi_employee = False else: holiday.employee_id = False - holiday.multi_employee = (len(holiday.employee_ids) > 1) + holiday.multi_employee = True + # holiday.multi_employee = (len(holiday.employee_ids) > 1) @api.depends('holiday_type') def _compute_from_holiday_type(self): @@ -622,9 +624,9 @@ def _check_date(self): ('state', 'not in', ['cancel', 'refuse']), ] nholidays = self.search_count(domain) - if nholidays: - raise ValidationError( - _('You can not set 2 time off that overlaps on the same day for the same employee.') + '\n- %s' % (holiday.display_name)) + # if nholidays: + # raise ValidationError( + # _('You can not set 2 time off that overlaps on the same day for the same employee.') + '\n- %s' % (holiday.display_name)) @api.constrains('state', 'number_of_days', 'holiday_status_id') def _check_holidays(self): @@ -641,9 +643,9 @@ def _check_holidays(self): def _check_date_state(self): if self.env.context.get('leave_skip_state_check'): return - for holiday in self: - if holiday.state in ['cancel', 'refuse', 'validate1', 'validate']: - raise ValidationError(_("This modification is not allowed in the current state.")) + # for holiday in self: + # if holiday.state in ['cancel', 'refuse', 'validate1', 'validate']: + # raise ValidationError(_("This modification is not allowed in the current state.")) def _get_number_of_days(self, date_from, date_to, employee_id): """ Returns a float equals to the timedelta between two dates given as string.""" diff --git a/addons/hr_holidays/models/hr_leave_allocation.py b/addons/hr_holidays/models/hr_leave_allocation.py index b2231f0d0fda4..13ddd9877ddf0 100644 --- a/addons/hr_holidays/models/hr_leave_allocation.py +++ b/addons/hr_holidays/models/hr_leave_allocation.py @@ -248,9 +248,11 @@ def _compute_from_employee_ids(self): for allocation in self: if len(allocation.employee_ids) == 1: allocation.employee_id = allocation.employee_ids[0]._origin + allocation.multi_employee = False else: allocation.employee_id = False - allocation.multi_employee = (len(allocation.employee_ids) > 1) + allocation.multi_employee = True + # allocation.multi_employee = (len(allocation.employee_ids) > 1) @api.depends('holiday_type') def _compute_from_holiday_type(self): diff --git a/addons/hr_holidays/views/hr_leave_views.xml b/addons/hr_holidays/views/hr_leave_views.xml index 6e1312a874e5c..5c64448676a9e 100644 --- a/addons/hr_holidays/views/hr_leave_views.xml +++ b/addons/hr_holidays/views/hr_leave_views.xml @@ -364,8 +364,11 @@ primary 17 - + + + 1 @@ -406,13 +409,13 @@ 16 -
+ -