[IMP] various improvment from Yajo.

pull/2417/head
Sylvain LE GAL 2020-12-07 12:15:01 +01:00 committed by Stefan Rijnhart
parent 3b172ff276
commit 74159600bc
4 changed files with 8 additions and 13 deletions

View File

@ -19,17 +19,11 @@ class UpgradeAttribute(models.Model):
def _compute_is_oca_module(self): def _compute_is_oca_module(self):
for module in self: for module in self:
if "/OCA/" in module.website: module.is_oca_module = "/OCA/" in module.website
module.is_oca_module = True
else:
module.is_oca_module = False
def _compute_is_odoo_module(self): def _compute_is_odoo_module(self):
for module in self: for module in self:
module_path = get_module_path(module.name) module_path = get_module_path(module.name)
absolute_repo_path = os.path.split(module_path)[0] absolute_repo_path = os.path.split(module_path)[0]
x, relative_repo_path = os.path.split(absolute_repo_path) x, relative_repo_path = os.path.split(absolute_repo_path)
if relative_repo_path == "addons": module.is_odoo_module = relative_repo_path == "addons"
module.is_odoo_module = True
else:
module.is_odoo_module = False

View File

@ -15,6 +15,7 @@ class UpgradeAttribute(models.Model):
record_id = fields.Many2one( record_id = fields.Many2one(
comodel_name="upgrade.record", comodel_name="upgrade.record",
index=True,
ondelete="CASCADE", ondelete="CASCADE",
readonly=True, readonly=True,
) )

View File

@ -67,9 +67,9 @@ class UpgradeComparisonConfig(models.Model):
"params": { "params": {
"type": "info", "type": "info",
"message": _( "message": _(
"You are correctly connected to the server {server}" "You are correctly connected to the server %(server)s"
" (version {version}) with the user {user_name}" " (version %(version)s) with the user %(user_name)s"
).format( ) % dict(
server=self.server, server=self.server,
version=self.version, version=self.version,
user_name=user_info["name"], user_name=user_info["name"],

View File

@ -29,8 +29,8 @@ class TestUpgradeAnalysis(common.TransactionCase):
) )
wizard.select_other_modules() wizard.select_other_modules()
self.assertTrue( self.assertFalse(
self.product_module.id not in wizard.module_ids.ids, self.product_module.id in wizard.module_ids.ids,
"Select Other module should not select 'product' module", "Select Other module should not select 'product' module",
) )