From f085a67b745b07572b2a371bca028c227b9369a4 Mon Sep 17 00:00:00 2001 From: Xavier Morel Date: Fri, 19 May 2017 13:43:49 +0200 Subject: [PATCH 1/9] [FIX] P3: columns initialisation order is unspecified With P3's hash randomisation, assuming one column is initialised before the other in the same model basically never works. --- addons/project_timesheet_holidays/models/res_company.py | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/addons/project_timesheet_holidays/models/res_company.py b/addons/project_timesheet_holidays/models/res_company.py index 3d21974573c..8dfe3ff580c 100644 --- a/addons/project_timesheet_holidays/models/res_company.py +++ b/addons/project_timesheet_holidays/models/res_company.py @@ -14,11 +14,8 @@ class Company(models.Model): 'project.task', string="Leave Task", domain="[('project_id', '=', leave_timesheet_project_id)]") - def _init_column(self, name): - super(Company, self)._init_column(name) - - if name == 'leave_timesheet_project_id': - self.search([('leave_timesheet_project_id', '=', False)])._create_leave_project_task() + def init(self): + self.search([('leave_timesheet_project_id', '=', False)])._create_leave_project_task() @api.model def create(self, values): From 132841695965307a3777728415a61e2beb002762 Mon Sep 17 00:00:00 2001 From: Xavier Morel Date: Wed, 17 May 2017 11:04:10 +0200 Subject: [PATCH 2/9] [FIX] P3: hash randomisation in XML/HTML stuff * Have the cleaned up style attributes be dumped in the same order they were originally so that we can easily validate against text content. * While lxml's attributes are stored in an ordereddict, namespaces are not and thus when comparing text serialisation of namespaced documents the ordering of namespaces can differ between runs. Fix by comparing the LXML trees directly. --- odoo/addons/base/tests/test_mail_examples.py | 2 +- odoo/addons/base/tests/test_qweb.py | 135 +++++++++---------- odoo/addons/base/tests/test_views.py | 18 --- odoo/tests/common.py | 24 +++- odoo/tools/mail.py | 3 +- 5 files changed, 93 insertions(+), 89 deletions(-) diff --git a/odoo/addons/base/tests/test_mail_examples.py b/odoo/addons/base/tests/test_mail_examples.py index a83e668d940..dfecfe7c0d4 100644 --- a/odoo/addons/base/tests/test_mail_examples.py +++ b/odoo/addons/base/tests/test_mail_examples.py @@ -510,7 +510,7 @@ REMOVE_CLASS = """ """ REMOVE_CLASS_IN = [ - '
', + '
', 'An error occured in a modal and I will send you back the html to try opening one on your end'] REMOVE_CLASS_OUT = [ '