Browse Source

[REF] various flake fixes

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

4
beesdoo_crelan_csv/__manifest__.py

@ -5,8 +5,8 @@
{ {
"name": "Beescoop Crelan Import module", "name": "Beescoop Crelan Import module",
"summary": """ "summary": """
Import Crelan CSV Wizard
""",
Import Crelan CSV Wizard
""",
"author": "Beescoop - Cellule IT, Coop IT Easy SCRLfs", "author": "Beescoop - Cellule IT, Coop IT Easy SCRLfs",
"website": "https://github.com/beescoop/Obeesdoo", "website": "https://github.com/beescoop/Obeesdoo",
"category": "Accounting & Finance", "category": "Accounting & Finance",

8
beesdoo_crelan_csv/wizard/import_crelan_csv.py

@ -99,7 +99,7 @@ class CodaBankStatementImport(models.TransientModel):
return journal.bank_acc_number return journal.bank_acc_number
def _get_acc_balance_crelan(self, 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 return self.init_balance
journal = self.env["account.journal"].search( journal = self.env["account.journal"].search(
@ -110,15 +110,15 @@ class CodaBankStatementImport(models.TransientModel):
self.init_balance = 0.0 self.init_balance = 0.0
else: else:
lang = self._context.get("lang", "en_US") 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"][ balance = journal.get_journal_dashboard_datas()["last_balance"][
:-1 :-1
] ]
self.init_balance = float( self.init_balance = float(
balance.replace(currency.symbol, "") balance.replace(currency.symbol, "")
.strip() .strip()
.replace(l.thousands_sep, "")
.replace(l.decimal_point, ".")
.replace(lang.thousands_sep, "")
.replace(lang.decimal_point, ".")
) )
return self.init_balance return self.init_balance

4
beesdoo_shift/models/cooperative_status.py

@ -191,7 +191,7 @@ class CooperativeStatus(models.Model):
"alert_start_time", "alert_start_time",
"unsubscribed", "unsubscribed",
]: ]:
if not field in vals:
if field not in vals:
continue continue
for rec in self: for rec in self:
data = { data = {
@ -358,7 +358,7 @@ class CooperativeStatus(models.Model):
pass pass
############################################### ###############################################
###### Irregular Cron implementation ##########
# Irregular Cron implementation #
############################################### ###############################################
def _get_irregular_worker_domain(self): 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: 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 @api.model
def _cron_non_validated_sheets(self): 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) self.irregular_absence_date = data.get("irregular_absence_date", False)
############################################### ###############################################
###### Irregular Cron implementation ##########
# Irregular Cron implementation #
############################################### ###############################################
def _get_irregular_worker_domain(self, **kwargs): def _get_irregular_worker_domain(self, **kwargs):

Loading…
Cancel
Save