Human Resources mailing list archives

hr@odoo-community.org

Avatar

Re: [OCA/hr] [12.0][IMP] hr_holidays_leave_auto_approve: Auto-approve for everyone (#663)

by Alexey Pelykh <notifications@github.com> - 19/11/2019 13:52:33

@alexey-pelykh requested changes on this pull request.


In hr_holidays_leave_auto_approve/migrations/12.0.2.0.0/post-migration.py:

> @@ -0,0 +1,19 @@
+# Copyright 2019 Eficent <http://www.eficent.com>
+# Copyright 2019 Tecnativa - Pedro M. Baeza
+# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
+from openupgradelib import openupgrade
+
+
+@openupgrade.migrate()
+def migrate(env, version):
+    cr = env.cr
+    import logging
+    logging.info('holaaaaa')

please remove


In hr_holidays_leave_auto_approve/models/hr_leave.py:

>                  values.get('holiday_status_id')
-            ).auto_approve
+            )
+            auto_approve = leave_type.auto_approve_policy != 'no'

If we're self-approving, we don't want message about user approved own request being sent to himself, BUT there can be other watchers by default. Probably if "only user will receive message" then don't send it, or exclude self from followers, something like that. We can address that as separate PR


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