Add traking on warn fields

WORK IN PROGRESS: port hr_holidays_usability
This commit is contained in:
Alexis de Lattre
2017-04-05 19:22:01 +02:00
parent ffda316d34
commit 348e0205a0
24 changed files with 241 additions and 374 deletions

View File

@@ -1,26 +1,9 @@
# -*- encoding: utf-8 -*-
##############################################################################
#
# HR Holidays Usability module for Odoo
# Copyright (C) 2015 Akretion (http://www.akretion.com)
# @author Alexis de Lattre <alexis.delattre@akretion.com>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the
# License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
##############################################################################
# -*- coding: utf-8 -*-
# © 2015-2017 Akretion (http://www.akretion.com)
# @author Alexis de Lattre <alexis.delattre@akretion.com>
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
from openerp import fields, models, tools
from odoo import fields, models, tools
class HrHolidaysEmployeeCounter(models.Model):
@@ -39,9 +22,9 @@ class HrHolidaysEmployeeCounter(models.Model):
leaves_remaining_posted = fields.Float(string='Posted Remaining Leaves')
allocated_leaves = fields.Float(string='Allocated Leaves')
def init(self, cr):
tools.drop_view_if_exists(cr, 'hr_holidays_employee_counter')
cr.execute("""
def init(self):
tools.drop_view_if_exists(self._cr, 'hr_holidays_employee_counter')
self._cr.execute("""
CREATE or REPLACE view hr_holidays_employee_counter AS (
SELECT
min(hh.id) AS id,

View File

@@ -1,6 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<openerp>
<data>
<odoo>
<record id="hr_holidays_employee_counter_tree" model="ir.ui.view">
<field name="name">hr.holidays.employee.counter.tree</field>
@@ -44,8 +43,7 @@
<menuitem id="hr_holidays_employee_counter_menu"
action="hr_holidays_employee_counter_action"
parent="hr_holidays.menu_open_ask_holidays"/>
parent="hr_holidays.menu_hr_holidays_my_leaves"/>
</data>
</openerp>
</odoo>