Browse Source

[REF] various flake fixes

pull/142/head
robin.keunen 5 years ago
parent
commit
de4cef868b
  1. 8
      beesdoo_crelan_csv/wizard/import_crelan_csv.py
  2. 4
      beesdoo_shift/models/cooperative_status.py
  3. 4
      beesdoo_shift_attendance/models/attendance_sheet.py
  4. 2
      beesdoo_worker_status/models/cooperative_status.py

8
beesdoo_crelan_csv/wizard/import_crelan_csv.py

@ -99,7 +99,7 @@ class CodaBankStatementImport(models.TransientModel):
return journal.bank_acc_number
def _get_acc_balance_crelan(self, acc_number):
if not self.init_balance == None:
if self.init_balance is not None:
return self.init_balance
journal = self.env["account.journal"].search(
@ -110,15 +110,15 @@ class CodaBankStatementImport(models.TransientModel):
self.init_balance = 0.0
else:
lang = self._context.get("lang", "en_US")
l = self.env["res.lang"].search([("code", "=", lang)])
lang = self.env["res.lang"].search([("code", "=", lang)])
balance = journal.get_journal_dashboard_datas()["last_balance"][
:-1
]
self.init_balance = float(
balance.replace(currency.symbol, "")
.strip()
.replace(l.thousands_sep, "")
.replace(l.decimal_point, ".")
.replace(lang.thousands_sep, "")
.replace(lang.decimal_point, ".")
)
return self.init_balance

4
beesdoo_shift/models/cooperative_status.py

@ -191,7 +191,7 @@ class CooperativeStatus(models.Model):
"alert_start_time",
"unsubscribed",
]:
if not field in vals:
if field not in vals:
continue
for rec in self:
data = {
@ -358,7 +358,7 @@ class CooperativeStatus(models.Model):
pass
###############################################
###### Irregular Cron implementation ##########
# Irregular Cron implementation #
###############################################
def _get_irregular_worker_domain(self):

4
beesdoo_shift_attendance/models/attendance_sheet.py

@ -647,9 +647,7 @@ class AttendanceSheet(models.Model):
)
if not sheets:
sheet = sheets.create(
{"start_time": start_time, "end_time": end_time}
)
sheets.create({"start_time": start_time, "end_time": end_time})
@api.model
def _cron_non_validated_sheets(self):

2
beesdoo_worker_status/models/cooperative_status.py

@ -317,7 +317,7 @@ class CooperativeStatus(models.Model):
self.irregular_absence_date = data.get("irregular_absence_date", False)
###############################################
###### Irregular Cron implementation ##########
# Irregular Cron implementation #
###############################################
def _get_irregular_worker_domain(self, **kwargs):

Loading…
Cancel
Save