Human Resources mailing list archives

hr@odoo-community.org

Avatar

Re: [OCA/hr] [12.0][ADD] hr_holidays_accrual: Advanced accrual leave allocations (#501)

by Swapnesh Shah <notifications@github.com> - 26/03/2019 17:47:07

@sswapnesh approved this pull request.

LGTM apart from comments I have added (But they are not major ones)


In hr_holidays_accrual/__manifest__.py:

> +    'installable': True,
+    'application': False,
+    'summary': 'Advanced accrual leaves allocation',
+    'depends': [
+        'hr_holidays',
+        'hr_employee_service',
+    ],
+    'external_dependencies': {
+        'python': [
+            'dateutil',
+        ],
+    },
+    'data': [
+        'security/hr_holidays_accrual_security.xml',
+        'security/ir.model.access.csv',
+        'wizard/hr_leave_allocation_accrual_calculator.xml',

wizard --> wizards ? (I remember we talked this on another PR)


In hr_holidays_accrual/models/hr_leave_allocation.py:

> +    ):
+        self.ensure_one()
+
+        period = self._get_accrual_period()
+        date_from = self._get_date_from()
+        date_to = self._get_date_to()
+
+        if not date_to or date_to > as_of_datetime:
+            date_to = as_of_datetime
+
+        _logger.info(
+            (
+                'Calculating "%s" leave allocation for employee "%s"'
+                ' between %s and %s with %s period as of %s'
+            ),
+            self.holiday_status_id.name,

Maybe we can use display_name here


In hr_holidays_accrual/models/hr_leave_allocation.py:

> +
+            date_from += period
+
+        if (self.limit_accumulated_days
+                and balance > self.max_accumulated_days):
+            loss = self.max_accumulated_days - balance
+            accruements.append(HrLeaveAllocationAccruementEntry(
+                days_accrued=loss,
+                accrued_on=date_to.date(),
+                reason=_('Loss due to accumulation limit')
+            ))
+            balance += loss
+
+        number_of_days = balance + total_leave_days
+        _logger.info(
+            '%s days of "%s" leave allocated to employee "%s"',

leave --> leave(s)


In hr_holidays_accrual/views/hr_leave_allocation.xml:

> +                        <field name="interval_number" class="ml8"/>
+                        <field name="interval_unit"/>
+                    </div>
+                </group>
+            </xpath>
+        </field>
+    </record>
+
+    <record id="hr_leave_allocation_view_form" model="ir.ui.view">
+        <field name="name">hr.leave.allocation.view.form.inherit.accrual</field>
+        <field name="model">hr.leave.allocation</field>
+        <field name="inherit_id" ref="hr_holidays.hr_leave_allocation_view_form"/>
+        <field name="arch" type="xml">
+            <header position="inside">
+                <button
+                    name="%(action_hr_leave_allocation_as_of_date)d"

module_name.action_id (Not sure about this one)


You are receiving this because you are on a team that was mentioned.
Reply to this email directly, view it on GitHub, or mute the thread.