Browse Source

[REF] b_shift : attendance sheet validation wizard

pull/125/head
Elouan Le Bars 5 years ago
parent
commit
75fb164f89
  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

@ -69,7 +69,7 @@ class ValidateAttendanceSheet(models.TransientModel):
notes = fields.Text(related="active_sheet.notes", default="") notes = fields.Text(related="active_sheet.notes", default="")
feedback = fields.Text(related="active_sheet.feedback", default="") feedback = fields.Text(related="active_sheet.feedback", default="")
worker_nb_feedback = fields.Selection( worker_nb_feedback = fields.Selection(
related="active_sheet.worker_nb_feedback", required=True
related="active_sheet.worker_nb_feedback"
) )
def on_barcode_scanned(self, barcode): def on_barcode_scanned(self, barcode):
@ -85,6 +85,10 @@ class ValidateAttendanceSheet(models.TransientModel):
@api.multi @api.multi
def validate_sheet(self): def validate_sheet(self):
sheet = self.active_sheet 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: if self.card_support:
# Login with barcode # Login with barcode
card = self.env["member.card"].search( card = self.env["member.card"].search(

2
beesdoo_shift/wizard/validate_attendance_sheet.xml

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

Loading…
Cancel
Save