Skip to content

Commit

Permalink
Merge PR #3 into 14.0
Browse files Browse the repository at this point in the history
Signed-off-by mikevhe18
  • Loading branch information
ssi-bot committed Jul 8, 2024
2 parents 5901d4f + 4c6786c commit 794eada
Show file tree
Hide file tree
Showing 2 changed files with 38 additions and 1 deletion.
16 changes: 15 additions & 1 deletion ssi_fingerspot/models/fingerspot_attendance_machine.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,12 @@ class FingerspotAttendanceMachine(models.Model):
copy=False,
readonly=True,
)
is_skip = fields.Boolean(
string="Is Skip?",
required=False,
copy=False,
readonly=True,
)
err_msg = fields.Char(
string="Error",
default="-",
Expand Down Expand Up @@ -131,6 +137,14 @@ def action_unmark_is_transfer(self):
for record in self:
record.is_transfer = False

def action_mark_is_skip(self):
for record in self:
record.is_skip = True

def action_unmark_is_skip(self):
for record in self:
record.is_skip = False

def _get_latest_attendance(self):
self.ensure_one()
obj_attendance = self.env["hr.timesheet_attendance"]
Expand Down Expand Up @@ -267,7 +281,7 @@ def _generate_attendances(self):

def action_generate_attendances(self):
to_generate = self.filtered(
lambda x: x.is_transfer is False and x.employee_id
lambda x: x.is_transfer is False and x.is_skip is False and x.employee_id
).sorted(lambda m: (m.pin))

tz = pytz.timezone(self.env.user.tz or "Asia/Jakarta")
Expand Down
23 changes: 23 additions & 0 deletions ssi_fingerspot/views/fingerspot_attendance_machine_views.xml
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,18 @@
<field name="employee_id" />
<field name="machine_id" />
<field name="is_transfer" />
<field name="is_skip" />
<separator />
<filter
name="transferred"
string="Transferred"
domain="[('is_transfer', '=', True)]"
/>
<filter
name="skipped"
string="Skipped"
domain="[('is_skip', '=', True)]"
/>
<filter
name="not_transferred"
string="Not Yet Transferred"
Expand All @@ -47,6 +53,11 @@
string="Is Transfer?"
context="{'group_by':'is_transfer'}"
/>
<filter
name="grp_skip"
string="Is Skip?"
context="{'group_by':'is_skip'}"
/>
</group>
</search>
</field>
Expand All @@ -73,6 +84,16 @@
name="action_unmark_is_transfer"
type="object"
string="Unmark Is Transfer"
/>
<button
name="action_mark_is_skip"
type="object"
string="Mark Is Skip"
/>
<button
name="action_unmark_is_skip"
type="object"
string="Unmark Is Skip"
/> -->
</header>
<field name="scan_date" />
Expand All @@ -82,6 +103,7 @@
<field name="status_scan" />
<field name="machine_id" />
<field name="is_transfer" optional="hide" />
<field name="is_skip" optional="hide" />
<field name="err_msg" />
</tree>
</field>
Expand All @@ -101,6 +123,7 @@
<field name="employee_id" />
<field name="machine_id" />
<field name="is_transfer" />
<field name="is_skip" />
</group>
</sheet>
</form>
Expand Down

0 comments on commit 794eada

Please sign in to comment.