Skip to content

Commit

Permalink
Blake
Browse files Browse the repository at this point in the history
  • Loading branch information
majouda committed Jan 29, 2025
1 parent 24dcd5b commit a85f91d
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 17 deletions.
20 changes: 10 additions & 10 deletions hr_expense_same_month/__manifest__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,16 @@
# License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl).

{
'name': 'HR Expense Same Month',
'version': "16.0.1.0.0",
'author': 'Numigi',
'maintainer': 'Numigi',
"name": "HR Expense Same Month",
"version": "16.0.1.0.0",
"author": "Numigi",
"maintainer": "Numigi",
"website": "https://www.numigi.com",
'license': 'LGPL-3',
'category': 'Human Resources',
'summary': 'Force all the expense of a sheet to be for the same month',
'depends': [
'hr_expense',
"license": "LGPL-3",
"category": "Human Resources",
"summary": "Force all the expense of a sheet to be for the same month",
"depends": [
"hr_expense",
],
'installable': True,
"installable": True,
}
10 changes: 4 additions & 6 deletions hr_expense_same_month/models/hr_expense_sheet.py
Original file line number Diff line number Diff line change
@@ -1,16 +1,14 @@
# Copyright 2018 Numigi (tm) and all its contributors (https://bit.ly/numigiens)
# License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl).
import logging
from odoo import models, api, _
from odoo.exceptions import ValidationError

_logger = logging.getLogger(__name__)
from odoo import api, models, _
from odoo.exceptions import ValidationError


class HrExpenseSheetConstrain(models.Model):
_inherit = 'hr.expense.sheet'
_inherit = "hr.expense.sheet"

@api.constrains('expense_line_ids')
@api.constrains("expense_line_ids")
def _are_expenses_same_months(self):
for record in self:
months = {line.date.month for line in record.expense_line_ids}
Expand Down
1 change: 0 additions & 1 deletion hr_expense_same_month/tests/test_hr_expense_sheet.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@

@ddt
class TestHrExpenseSheet(common.SavepointCase):

@classmethod
def setUpClass(cls):
super().setUpClass()
Expand Down

0 comments on commit a85f91d

Please sign in to comment.