Skip to content

Commit

Permalink
[MIG] hr_timesheet_portal: Migration to 16.0
Browse files Browse the repository at this point in the history
  • Loading branch information
mhachraf committed Mar 21, 2023
1 parent 8ae77d8 commit 7e3f149
Show file tree
Hide file tree
Showing 12 changed files with 180 additions and 143 deletions.
11 changes: 6 additions & 5 deletions hr_timesheet_portal/README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -14,16 +14,16 @@ Timesheet portal (editable)
:target: http://www.gnu.org/licenses/agpl-3.0-standalone.html
:alt: License: AGPL-3
.. |badge3| image:: https://img.shields.io/badge/github-OCA%2Ftimesheet-lightgray.png?logo=github
:target: https://github.com/OCA/timesheet/tree/12.0/hr_timesheet_portal
:target: https://github.com/OCA/timesheet/tree/16.0/hr_timesheet_portal
:alt: OCA/timesheet
.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png
:target: https://translation.odoo-community.org/projects/timesheet-12-0/timesheet-12-0-hr_timesheet_portal
:target: https://translation.odoo-community.org/projects/timesheet-16-0/timesheet-16-0-hr_timesheet_portal
:alt: Translate me on Weblate
.. |badge5| image:: https://img.shields.io/badge/runbot-Try%20me-875A7B.png
:target: https://runbot.odoo-community.org/runbot/117/12.0
:target: https://runbot.odoo-community.org/runbot/117/16.0
:alt: Try me on Runbot

|badge1| |badge2| |badge3| |badge4| |badge5|
|badge1| |badge2| |badge3| |badge4| |badge5|

This module allows portal users to edit their timesheets via the frontend.

Expand Down Expand Up @@ -66,6 +66,7 @@ Contributors
~~~~~~~~~~~~

* Holger Brunn <[email protected]> (https://hunki-enterprises.com)
* Achraf Mhadhbi <[email protected]>

Maintainers
~~~~~~~~~~~
Expand All @@ -80,6 +81,6 @@ OCA, or the Odoo Community Association, is a nonprofit organization whose
mission is to support the collaborative development of Odoo features and
promote its widespread use.

This module is part of the `OCA/timesheet <https://github.com/OCA/timesheet/tree/12.0/hr_timesheet_portal>`_ project on GitHub.
This module is part of the `OCA/timesheet <https://github.com/OCA/timesheet/tree/16.0/hr_timesheet_portal>`_ project on GitHub.

You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.
9 changes: 7 additions & 2 deletions hr_timesheet_portal/__manifest__.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
# Copyright 2021 Hunki Enterprises BV
# Copyright 2023 bloopark systems - Achraf Mhadhbi
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).
{
"name": "Timesheet portal (editable)",
"summary": "Fill in timesheets via the portal",
"version": "12.0.1.0.1",
"version": "16.0.1.0.1",
"development_status": "Alpha",
"category": "Website",
"website": "https://github.com/OCA/timesheet",
Expand All @@ -15,12 +16,16 @@
"website",
],
"data": [
"templates/assets.xml",
"templates/portal.xml",
"security/hr_timesheet_portal_security.xml",
"security/ir.model.access.csv",
],
"demo": [
"demo/hr_timesheet_portal.xml",
],
"assets": {
"web.assets_frontend": [
"hr_timesheet_portal/static/src/**/*",
],
},
}
3 changes: 1 addition & 2 deletions hr_timesheet_portal/demo/hr_timesheet_portal.xml
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<?xml version="1.0" encoding="utf-8" ?>
<!-- Copyright 2021 Hunki Enterprises BV
License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). -->

<odoo>

<record id="base.group_portal" model="res.groups">
Expand Down
1 change: 1 addition & 0 deletions hr_timesheet_portal/readme/CONTRIBUTORS.rst
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
* Holger Brunn <[email protected]> (https://hunki-enterprises.com)
* Achraf Mhadhbi <[email protected]>
Empty file.
17 changes: 9 additions & 8 deletions hr_timesheet_portal/security/hr_timesheet_portal_security.xml
Original file line number Diff line number Diff line change
@@ -1,17 +1,18 @@
<?xml version="1.0" encoding="utf-8"?>
<?xml version="1.0" encoding="utf-8" ?>
<!-- Copyright 2021 Hunki Enterprises BV
License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). -->

<odoo>

<record id="group_hr_timesheet_portal" model="res.groups">
<field name="name">Editable timesheets</field>
<field name="category_id" ref="base.module_category_website"/>
<field name="comment">Add portal users who should be allowed to edit their timesheets</field>
<field name="category_id" ref="base.module_category_website" />
<field
name="comment"
>Add portal users who should be allowed to edit their timesheets</field>
</record>

<record id="rule_account_analytic_line" model="ir.rule">
<field name="model_id" ref="analytic.model_account_analytic_line"/>
<field name="model_id" ref="analytic.model_account_analytic_line" />
<field name="domain_force">[
'|',
'&amp;',
Expand All @@ -21,13 +22,13 @@
('task_id.project_id.privacy_visibility', '=', 'portal'),
('task_id.message_partner_ids', 'child_of', [user.partner_id.commercial_partner_id.id]),
]</field>
<field name="groups" eval="[(4, ref('group_hr_timesheet_portal'))]"/>
<field name="groups" eval="[(4, ref('group_hr_timesheet_portal'))]" />
</record>

<record id="rule_hr_employee" model="ir.rule">
<field name="model_id" ref="hr.model_hr_employee"/>
<field name="model_id" ref="hr.model_hr_employee" />
<field name="domain_force">[(0, '=', 1)]</field>
<field name="groups" eval="[(4, ref('group_hr_timesheet_portal'))]"/>
<field name="groups" eval="[(4, ref('group_hr_timesheet_portal'))]" />
</record>

</odoo>
14 changes: 8 additions & 6 deletions hr_timesheet_portal/static/src/css/hr_timesheet_portal.css
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
/* Copyright 2021 Hunki Enterprises BV
* License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). */

div.hr_timesheet_portal h5 i,div.hr_timesheet_portal tr i, div.hr_timesheet_portal tr:hover.edit i {
div.hr_timesheet_portal h5 i,
div.hr_timesheet_portal tr i,
div.hr_timesheet_portal tr:hover.edit i {
display: none;
}
div.hr_timesheet_portal:hover h5 i {
Expand All @@ -15,15 +17,15 @@ div.hr_timesheet_portal tr[data-line-id]:hover i {
display: block;
cursor: pointer;
position: absolute;
top: .3em;
top: 0.3em;
background: #fff;
padding: .3em;
padding: 0.3em;
}
div.hr_timesheet_portal tr[data-line-id]:hover i.fa-remove {
right: .2em;
right: 0.2em;
}
div.hr_timesheet_portal tr[data-line-id]:hover i.fa-edit {
left: .2em;
left: 0.2em;
}
div.hr_timesheet_portal tr[data-line-id] td {
position: relative;
Expand All @@ -32,7 +34,7 @@ div.hr_timesheet_portal tr form {
display: inline-block;
}
div.hr_timesheet_portal tr form button {
margin-left: .2em;
margin-left: 0.2em;
}
div.hr_timesheet_portal tr td {
vertical-align: middle;
Expand Down
Loading

0 comments on commit 7e3f149

Please sign in to comment.