Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[14.0][IMP] hr_timesheet_purchase_order: create PO automatically #597

Merged
Show file tree
Hide file tree
Changes from 9 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions hr_timesheet_purchase_order/__manifest__.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# Copyright (C) 2024 Cetmix OÜ
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).

{
"name": "HR Timesheet Purchase Order",
"version": "14.0.1.0.0",
Expand All @@ -10,11 +13,15 @@
"hr_timesheet_sheet",
"purchase",
],
"maintainers": ["dessanhemrayev", "CetmixGitDrone", "aleuffre", "renda-dev"],
"external_dependencies": {},
"demo": [],
"data": [
"security/ir.model.access.csv",
"data/ir_actions_server.xml",
"data/hr_timesheet_cron.xml",
"views/hr_employee_view.xml",
"views/res_partner_view.xml",
"views/hr_timesheet_sheet_view.xml",
"views/purchase_order_view.xml",
"views/res_config_settings_view.xml",
Expand Down
11 changes: 11 additions & 0 deletions hr_timesheet_purchase_order/data/hr_timesheet_cron.xml
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>
4 changes: 4 additions & 0 deletions hr_timesheet_purchase_order/data/ir_actions_server.xml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,10 @@
<field name="name">Create Purchase Order</field>
<field name="model_id" ref="model_hr_timesheet_sheet" />
<field name="binding_model_id" ref="model_hr_timesheet_sheet" />
<field
name="groups_id"
eval="[(6, 0, [ref('hr_timesheet.group_timesheet_manager')])]"
/>
<field name="binding_view_types">list</field>
<field name="state">code</field>
<field name="code">
Expand Down
2 changes: 2 additions & 0 deletions hr_timesheet_purchase_order/models/__init__.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
from . import res_partner
from . import hr_timesheet_recurrence
from . import hr_employee_base
from . import hr_timesheet_sheet
from . import res_config_settings
Expand Down
8 changes: 5 additions & 3 deletions hr_timesheet_purchase_order/models/hr_employee_base.py
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")
Loading
Loading