Browse Source

[REF] b_shift : attendance sheet validation wizard

pull/143/head
Elouan Le Bars 5 years ago
parent
commit
d163dba0c2
  1. 6
      beesdoo_shift/wizard/validate_attendance_sheet.py
  2. 2
      beesdoo_shift/wizard/validate_attendance_sheet.xml

6
beesdoo_shift/wizard/validate_attendance_sheet.py

@ -68,7 +68,7 @@ class ValidateAttendanceSheet(models.TransientModel):
notes = fields.Text(related="active_sheet.notes", default="", readonly=False)
feedback = fields.Text(related="active_sheet.feedback", default="", readonly=False)
worker_nb_feedback = fields.Selection(
related="active_sheet.worker_nb_feedback", readonly=False, required=True
related="active_sheet.worker_nb_feedback", readonly=False
)
def on_barcode_scanned(self, barcode):
@ -84,6 +84,10 @@ class ValidateAttendanceSheet(models.TransientModel):
@api.multi
def validate_sheet(self):
sheet = self.active_sheet
if not self.worker_nb_feedback:
raise UserError(_("Please give your feedback on the number of workers."))
if self.card_support:
# Login with barcode
card = self.env["member.card"].search(

2
beesdoo_shift/wizard/validate_attendance_sheet.xml

@ -35,7 +35,7 @@
<footer>
<button type="object"
name="validate_sheet"
string="Validate"
string="Comment and validate"
class="oe_highlight"
/>
<button type="object" name="save"

Loading…
Cancel
Save