-
-
Notifications
You must be signed in to change notification settings - Fork 347
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by alexey-pelykh
- Loading branch information
Showing
23 changed files
with
1,710 additions
and
26 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
<?xml version="1.0" encoding="utf-8" ?> | ||
<odoo noupdate="1"> | ||
<record id="ir_cron_auto_generate_po" model="ir.cron"> | ||
<field name="name">HR Timesheet : Auto generate Purchase Order</field> | ||
<field name="model_id" ref="model_hr_timesheet_recurrence" /> | ||
<field name="state">code</field> | ||
<field name="code">model._cron_generate_auto_po()</field> | ||
<field name="interval_type">days</field> | ||
<field name="numbercall">-1</field> | ||
</record> | ||
</odoo> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
import calendar | ||
import datetime | ||
|
||
from dateutil.rrule import FR, MO, SA, SU, TH, TU, WE | ||
|
||
MONTH_SELECTION = [(month.lower(), month) for month in calendar.month_name[1:]] | ||
WEEKDAY_SELECTION = [(weekday[:3].lower(), weekday) for weekday in calendar.day_name] | ||
|
||
current_year = datetime.datetime.now().year | ||
DAYS_IN_MONTHS = { | ||
calendar.month_name[month].lower(): calendar.monthrange(current_year, month)[1] | ||
for month in range(1, 13) | ||
} | ||
WEEKS_SELECTION = [ | ||
("first", "First"), | ||
("second", "Second"), | ||
("third", "Third"), | ||
("last", "Last"), | ||
] | ||
UNIT_SELECTION = [ | ||
("day", "Days"), | ||
("week", "Weeks"), | ||
("month", "Months"), | ||
("year", "Years"), | ||
] | ||
DAYS = { | ||
"mon": MO, | ||
"tue": TU, | ||
"wed": WE, | ||
"thu": TH, | ||
"fri": FR, | ||
"sat": SA, | ||
"sun": SU, | ||
} | ||
|
||
TYPE_SELECTION = [ | ||
("forever", "Forever"), | ||
("until", "End Date"), | ||
("after", "Number of Repetitions"), | ||
] | ||
|
||
ON_MONTH_SELECTION = [ | ||
("date", "Date of the Month"), | ||
("day", "Day of the Month"), | ||
] | ||
|
||
ON_YEAR_SELECTION = [ | ||
("date", "Date of the Year"), | ||
("day", "Day of the Year"), | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,12 @@ | ||
# Copyright (C) 2024 Cetmix OÜ | ||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). | ||
|
||
|
||
from odoo import fields, models | ||
|
||
|
||
class HrEmployeeBase(models.AbstractModel): | ||
_inherit = "hr.employee.base" | ||
|
||
allow_generate_purchase_order = fields.Boolean( | ||
string="Generate POs from Timesheet", default=False | ||
) | ||
allow_generate_purchase_order = fields.Boolean(string="Generate POs from Timesheet") | ||
billing_partner_id = fields.Many2one("res.partner") |
Oops, something went wrong.