mirror of
https://gitlab.com/hibou-io/hibou-odoo/suite.git
synced 2025-01-20 12:37:31 +02:00
[REM] hr_rimesheet_work_entry: available in professional
H14528
This commit is contained in:
@@ -1,15 +0,0 @@
|
|||||||
from . import models
|
|
||||||
|
|
||||||
|
|
||||||
def ts_work_type_pre_init_hook(cr):
|
|
||||||
"""
|
|
||||||
This module installs a Work Entry Type with code "TS"
|
|
||||||
If you have undergone a migration (either for this module
|
|
||||||
or even your own Payslip Work Entry lines with code "TS")
|
|
||||||
then the uniqueness constraint will prevent this module
|
|
||||||
from installing.
|
|
||||||
"""
|
|
||||||
cr.execute("UPDATE hr_work_entry_type "
|
|
||||||
"SET code = 'TS-PRE-INSTALL-14' "
|
|
||||||
"WHERE code = 'TS';"
|
|
||||||
)
|
|
||||||
@@ -1,24 +0,0 @@
|
|||||||
{
|
|
||||||
'name': 'Timesheet Work Entry Type',
|
|
||||||
'description': 'Set work types on timesheet records.',
|
|
||||||
'version': '16.0.1.0.0',
|
|
||||||
'website': 'https://hibou.io/',
|
|
||||||
'author': 'Hibou Corp. <hello@hibou.io>',
|
|
||||||
'license': 'AGPL-3',
|
|
||||||
'category': 'Human Resources',
|
|
||||||
'depends': [
|
|
||||||
'project',
|
|
||||||
'hr_timesheet',
|
|
||||||
'hr_work_entry',
|
|
||||||
],
|
|
||||||
'data': [
|
|
||||||
'security/ir.model.access.csv',
|
|
||||||
'data/hr_timesheet_work_entry_data.xml',
|
|
||||||
'views/timesheet_views.xml',
|
|
||||||
'views/work_entry_views.xml',
|
|
||||||
],
|
|
||||||
'demo': [
|
|
||||||
'data/hr_timesheet_work_entry_demo.xml',
|
|
||||||
],
|
|
||||||
'pre_init_hook': 'ts_work_type_pre_init_hook',
|
|
||||||
}
|
|
||||||
@@ -1,10 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8" ?>
|
|
||||||
<odoo>
|
|
||||||
|
|
||||||
<record id="work_input_timesheet" model="hr.work.entry.type">
|
|
||||||
<field name="name">Timesheet</field>
|
|
||||||
<field name="code">TS</field>
|
|
||||||
<field name="allow_timesheet" eval="True"/>
|
|
||||||
</record>
|
|
||||||
|
|
||||||
</odoo>
|
|
||||||
@@ -1,10 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8" ?>
|
|
||||||
<odoo>
|
|
||||||
|
|
||||||
<record id="work_input_timesheet_internal" model="hr.work.entry.type">
|
|
||||||
<field name="name">Internal</field>
|
|
||||||
<field name="code">TS_INTERNAL</field>
|
|
||||||
<field name="allow_timesheet" eval="True"/>
|
|
||||||
</record>
|
|
||||||
|
|
||||||
</odoo>
|
|
||||||
@@ -1,51 +0,0 @@
|
|||||||
# Translation of Odoo Server.
|
|
||||||
# This file contains the translation of the following modules:
|
|
||||||
# * hr_timesheet_work_entry
|
|
||||||
#
|
|
||||||
msgid ""
|
|
||||||
msgstr ""
|
|
||||||
"Project-Id-Version: Odoo Server 15.0+e\n"
|
|
||||||
"Report-Msgid-Bugs-To: \n"
|
|
||||||
"POT-Creation-Date: 2021-10-12 01:31+0000\n"
|
|
||||||
"PO-Revision-Date: 2021-10-12 01:31+0000\n"
|
|
||||||
"Last-Translator: \n"
|
|
||||||
"Language-Team: \n"
|
|
||||||
"MIME-Version: 1.0\n"
|
|
||||||
"Content-Type: text/plain; charset=UTF-8\n"
|
|
||||||
"Content-Transfer-Encoding: \n"
|
|
||||||
"Plural-Forms: \n"
|
|
||||||
|
|
||||||
#. module: hr_timesheet_work_entry
|
|
||||||
#: model:ir.model.fields,field_description:hr_timesheet_work_entry.field_hr_work_entry_type__allow_timesheet
|
|
||||||
msgid "Allow on Timesheet"
|
|
||||||
msgstr "Permitir en Ficha de Horario"
|
|
||||||
|
|
||||||
#. module: hr_timesheet_work_entry
|
|
||||||
#: model:ir.model,name:hr_timesheet_work_entry.model_account_analytic_line
|
|
||||||
msgid "Analytic Line"
|
|
||||||
msgstr "Línea Analítica"
|
|
||||||
|
|
||||||
#. module: hr_timesheet_work_entry
|
|
||||||
#: model:ir.model,name:hr_timesheet_work_entry.model_hr_work_entry_type
|
|
||||||
msgid "HR Work Entry Type"
|
|
||||||
msgstr "Tipo de entrada de trabajo de RRHH"
|
|
||||||
|
|
||||||
#. module: hr_timesheet_work_entry
|
|
||||||
#: model:hr.work.entry.type,name:hr_timesheet_work_entry.work_input_timesheet
|
|
||||||
msgid "Timesheet"
|
|
||||||
msgstr "Ficha de Horario"
|
|
||||||
|
|
||||||
#. module: hr_timesheet_work_entry
|
|
||||||
#: model_terms:ir.ui.view,arch_db:hr_timesheet_work_entry.hr_work_entry_type_view_form_inherit
|
|
||||||
msgid "Timesheets"
|
|
||||||
msgstr "Fichas de Horario"
|
|
||||||
|
|
||||||
#. module: hr_timesheet_work_entry
|
|
||||||
#: model:ir.ui.menu,name:hr_timesheet_work_entry.hr_work_entry_type_menu
|
|
||||||
msgid "Work Entry Types"
|
|
||||||
msgstr "Tipos de Entradas de Trabajo"
|
|
||||||
|
|
||||||
#. module: hr_timesheet_work_entry
|
|
||||||
#: model:ir.model.fields,field_description:hr_timesheet_work_entry.field_account_analytic_line__work_type_id
|
|
||||||
msgid "Work Type"
|
|
||||||
msgstr "Tipo de Trabajo"
|
|
||||||
@@ -1,2 +0,0 @@
|
|||||||
from . import timesheet
|
|
||||||
from . import work_entry
|
|
||||||
@@ -1,9 +0,0 @@
|
|||||||
from odoo import api, fields, models
|
|
||||||
|
|
||||||
|
|
||||||
class AccountAnalyticLine(models.Model):
|
|
||||||
_inherit = 'account.analytic.line'
|
|
||||||
|
|
||||||
work_type_id = fields.Many2one('hr.work.entry.type', string='Work Type',
|
|
||||||
default=lambda self: self.env.ref('hr_timesheet_work_entry.work_input_timesheet',
|
|
||||||
raise_if_not_found=False))
|
|
||||||
@@ -1,7 +0,0 @@
|
|||||||
from odoo import fields, models
|
|
||||||
|
|
||||||
|
|
||||||
class HrWorkEntryType(models.Model):
|
|
||||||
_inherit = 'hr.work.entry.type'
|
|
||||||
|
|
||||||
allow_timesheet = fields.Boolean(string='Allow on Timesheet')
|
|
||||||
@@ -1,2 +0,0 @@
|
|||||||
id,name,model_id:id,group_id:id,perm_read,perm_write,perm_create,perm_unlink
|
|
||||||
access_hr_work_entry_type_employee,access_hr_work_entry_type_employee,model_hr_work_entry_type,base.group_user,1,0,0,0
|
|
||||||
|
@@ -1 +0,0 @@
|
|||||||
from . import test_timesheet_work_type
|
|
||||||
@@ -1,19 +0,0 @@
|
|||||||
from odoo.tests import common
|
|
||||||
|
|
||||||
|
|
||||||
class TestTimesheetWorkType(common.TransactionCase):
|
|
||||||
def setUp(self):
|
|
||||||
super().setUp()
|
|
||||||
self.employee = self.env.ref('hr.employee_hne')
|
|
||||||
self.project = self.env.ref('project.project_project_2')
|
|
||||||
self.default_work_type = self.env.ref('hr_timesheet_work_entry.work_input_timesheet')
|
|
||||||
|
|
||||||
def test_01_work_type(self):
|
|
||||||
timesheet = self.env['account.analytic.line'].create({
|
|
||||||
'name': '/',
|
|
||||||
'employee_id': self.employee.id,
|
|
||||||
'unit_amount': 1.0,
|
|
||||||
'project_id': self.project.id,
|
|
||||||
})
|
|
||||||
self.assertTrue(timesheet.work_type_id)
|
|
||||||
self.assertEqual(timesheet.work_type_id, self.default_work_type)
|
|
||||||
@@ -1,48 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8" ?>
|
|
||||||
<odoo>
|
|
||||||
|
|
||||||
<record id="hr_timesheet_line_tree_inherit" model="ir.ui.view">
|
|
||||||
<field name="name">account.analytic.line.tree.hr_timesheet.inherit</field>
|
|
||||||
<field name="model">account.analytic.line</field>
|
|
||||||
<field name="inherit_id" ref="hr_timesheet.hr_timesheet_line_tree"/>
|
|
||||||
<field name="arch" type="xml">
|
|
||||||
<xpath expr="//tree/field[@name='task_id']" position="after">
|
|
||||||
<field name="work_type_id"
|
|
||||||
domain="[('allow_timesheet', '=', True)]"
|
|
||||||
context="{'default_allow_timesheet': True}" />
|
|
||||||
</xpath>
|
|
||||||
</field>
|
|
||||||
</record>
|
|
||||||
|
|
||||||
<record id="hr_timesheet_line_form_inherit" model="ir.ui.view">
|
|
||||||
<field name="name">account.analytic.line.form.inherit</field>
|
|
||||||
<field name="model">account.analytic.line</field>
|
|
||||||
<field name="inherit_id" ref="hr_timesheet.hr_timesheet_line_form"/>
|
|
||||||
<field name="arch" type="xml">
|
|
||||||
<xpath expr="//field[@name='task_id']" position="after">
|
|
||||||
<field name="work_type_id"
|
|
||||||
domain="[('allow_timesheet', '=', True)]"
|
|
||||||
context="{'default_allow_timesheet': True}" />
|
|
||||||
</xpath>
|
|
||||||
</field>
|
|
||||||
</record>
|
|
||||||
|
|
||||||
<record id="view_task_form2_inherit" model="ir.ui.view">
|
|
||||||
<field name="name">project.task.form.inherit</field>
|
|
||||||
<field name="model">project.task</field>
|
|
||||||
<field name="inherit_id" ref="hr_timesheet.view_task_form2_inherited" />
|
|
||||||
<field name="arch" type="xml">
|
|
||||||
<xpath expr="//field[@name='timesheet_ids']/tree//field[@name='employee_id']" position="after">
|
|
||||||
<field name="work_type_id"
|
|
||||||
domain="[('allow_timesheet', '=', True)]"
|
|
||||||
context="{'default_allow_timesheet': True}" />
|
|
||||||
</xpath>
|
|
||||||
<xpath expr="//field[@name='timesheet_ids']/form//field[@name='task_id']" position="after">
|
|
||||||
<field name="work_type_id"
|
|
||||||
domain="[('allow_timesheet', '=', True)]"
|
|
||||||
context="{'default_allow_timesheet': True}" />
|
|
||||||
</xpath>
|
|
||||||
</field>
|
|
||||||
</record>
|
|
||||||
|
|
||||||
</odoo>
|
|
||||||
@@ -1,23 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8" ?>
|
|
||||||
<odoo>
|
|
||||||
|
|
||||||
<record id="hr_work_entry_type_view_form_inherit" model="ir.ui.view">
|
|
||||||
<field name="name">hr.work.type.view.form.inherit</field>
|
|
||||||
<field name="model">hr.work.entry.type</field>
|
|
||||||
<field name="inherit_id" ref="hr_work_entry.hr_work_entry_type_view_form"/>
|
|
||||||
<field name="arch" type="xml">
|
|
||||||
<xpath expr="//group/group" position="after">
|
|
||||||
<group name="timesheet" string="Timesheets">
|
|
||||||
<field name="allow_timesheet"/>
|
|
||||||
</group>
|
|
||||||
</xpath>
|
|
||||||
</field>
|
|
||||||
</record>
|
|
||||||
|
|
||||||
<menuitem
|
|
||||||
id="hr_work_entry_type_menu"
|
|
||||||
name="Work Entry Types"
|
|
||||||
parent="hr_timesheet.hr_timesheet_menu_configuration"
|
|
||||||
action="hr_work_entry.hr_work_entry_type_action"/>
|
|
||||||
|
|
||||||
</odoo>
|
|
||||||
Reference in New Issue
Block a user