Skip to content

Commit

Permalink
Merge pull request #2066 from Eficent/12.0-imp-openupgrade_records-ad…
Browse files Browse the repository at this point in the history
…d-moved-models

[12.0][IMP] analysis: include moved models
  • Loading branch information
pedrobaeza committed Oct 23, 2019
2 parents 19df933 + 1fda9c6 commit d7a37c0
Show file tree
Hide file tree
Showing 12 changed files with 62 additions and 23 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ obsolete model report.account.report_tax [abstract]
obsolete model report.account.report_trialbalance [abstract]
obsolete model wizard.multi.charts.accounts [transient]
new model account.fiscal.year
new model account.incoterms (renamed from stock.incoterms)
new model account.incoterms (renamed from stock.incoterms in module stock)
new model account.invoice.import.wizard [transient]
new model account.invoice.send [transient]
new model account.reconciliation.widget [abstract]
Expand Down
2 changes: 2 additions & 0 deletions addons/crm/migrations/12.0.1.0/openupgrade_analysis.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
---Models in module 'crm'---
model base.partner.merge.automatic.wizard (moved to base) [transient]
model base.partner.merge.line (moved to base) [transient]
obsolete model crm.opportunity.report [sql_view]
---Fields in module 'crm'---
crm / crm.lead / activity_date_deadline (date) : not related anymore
Expand Down
2 changes: 2 additions & 0 deletions addons/mail/migrations/12.0.1.0/openupgrade_analysis.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
---Models in module 'mail'---
model mail.test (moved to test_mail)
model mail.test.simple (moved to test_mail)
new model mail.blacklist
new model mail.blacklist.mixin [abstract]
new model mail.moderation
Expand Down
4 changes: 2 additions & 2 deletions addons/product/migrations/12.0.1.2/openupgrade_analysis.txt
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
---Models in module 'product'---
obsolete model product.attribute.line (renamed to product.template.attribute.line)
obsolete model product.attribute.price (renamed to product.template.attribute.value)
obsolete model product.uom (renamed to uom.uom)
obsolete model product.uom.categ (renamed to uom.category)
obsolete model product.uom (renamed to uom.uom in module uom)
obsolete model product.uom.categ (renamed to uom.category in module uom)
new model product.template.attribute.exclusion
new model product.template.attribute.line (renamed from product.attribute.line)
new model product.template.attribute.value (renamed from product.attribute.price)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
---Models in module 'sale_management'---
new model sale.order.template (renamed from sale.quote.template)
new model sale.order.template.line (renamed from sale.quote.line)
new model sale.order.template.option (renamed from sale.quote.option)
model sale.order.option (moved from website_quote)
new model sale.order.template (renamed from sale.quote.template in module website_quote)
new model sale.order.template.line (renamed from sale.quote.line in module website_quote)
new model sale.order.template.option (renamed from sale.quote.option in module website_quote)
---Fields in module 'sale_management'---
sale_management / digest.digest / kpi_all_sale_total (boolean) : NEW
sale_management / sale.order / sale_order_option_ids (one2many): NEW relation: sale.order.option
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
---Models in module 'sale_quotation_builder'---
obsolete model sale.quote.line (renamed to sale.order.template.line)
obsolete model sale.quote.option (renamed to sale.order.template.option)
obsolete model sale.quote.template (renamed to sale.order.template)
model sale.order.option (moved to sale_management)
obsolete model sale.quote.line (renamed to sale.order.template.line in module sale_management)
obsolete model sale.quote.option (renamed to sale.order.template.option in module sale_management)
obsolete model sale.quote.template (renamed to sale.order.template in module sale_management)
---Fields in module 'sale_quotation_builder'---
sale_quotation_builder / product.template / quotation_only_description (html): NEW
website_quote / product.product / website_description (html) : module is now 'website_sale' ('website_quote')
Expand Down
2 changes: 1 addition & 1 deletion addons/stock/migrations/12.0.1.1/openupgrade_analysis.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---Models in module 'stock'---
obsolete model procurement.rule (renamed to stock.rule)
obsolete model stock.incoterms (renamed to account.incoterms)
obsolete model stock.incoterms (renamed to account.incoterms in module account)
obsolete model stock.location.path (renamed to stock.rule)
new model product.replenish [transient]
new model report.stock.report_stock_rule [abstract]
Expand Down
3 changes: 3 additions & 0 deletions addons/test_mail/migrations/12.0.1.0/openupgrade_analysis.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
---Models in module 'test_mail'---
model mail.test (moved from mail)
new model mail.test.activity
new model mail.test.full
model mail.test.simple (moved from mail)
new model mail.test.track
model test_performance.mail (moved from test_performance)
---Fields in module 'test_mail'---
test_mail / mail.test / __last_update (datetime) : previously in module mail
test_mail / mail.test / _inherits (False) : previously in module mail
Expand Down
4 changes: 2 additions & 2 deletions addons/uom/migrations/12.0.1.0/openupgrade_analysis.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---Models in module 'uom'---
new model uom.category (renamed from product.uom.categ)
new model uom.uom (renamed from product.uom)
new model uom.category (renamed from product.uom.categ in module product)
new model uom.uom (renamed from product.uom in module product)
---Fields in module 'uom'---
uom / product.uom / __last_update (datetime) : previously in module product
uom / product.uom / active (boolean) : previously in module product
Expand Down
2 changes: 2 additions & 0 deletions odoo/addons/base/migrations/12.0.1.3/openupgrade_analysis.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
---Models in module 'base'---
obsolete model res.request.link
model base.partner.merge.automatic.wizard (moved from crm) [transient]
model base.partner.merge.line (moved from crm) [transient]
new model ir.demo [transient]
new model ir.demo_failure [transient]
new model ir.demo_failure.wizard [transient]
Expand Down
49 changes: 38 additions & 11 deletions odoo/addons/openupgrade_records/lib/compare.py
Original file line number Diff line number Diff line change
Expand Up @@ -365,8 +365,8 @@ def compare_model_sets(old_records, new_records):
"""
reprs = collections.defaultdict(list)

new_models = [column['model'] for column in new_records]
old_models = [column['model'] for column in old_records]
new_models = {column['model']: column['module'] for column in new_records}
old_models = {column['model']: column['module'] for column in old_records}

obsolete_models = []
for column in copy.copy(old_records):
Expand All @@ -382,15 +382,31 @@ def compare_model_sets(old_records, new_records):
reprs['general'].append('obsolete model %s [module %s]' % (
model, module_map(column['module'])))
else:
text = 'obsolete model %s (renamed to %s)' % (
model, model_map(model))
moved_module = ''
if module_map(column['module']) != new_models[model_map(
model)]:
moved_module = ' in module %s' % new_models[model_map(
model)]
text = 'obsolete model %s (renamed to %s%s)' % (
model, model_map(model), moved_module)
if column['model_type']:
text += " [%s]" % column['model_type']
reprs[module_map(column['module'])].append(text)
reprs['general'].append(
'obsolete model %s (renamed to %s) [module %s]' % (
model, model_map(model),
module_map(column['module'])))
else:
if module_map(column['module']) != new_models[model]:
text = 'model %s (moved to %s)' % (
model, new_models[model])
if column['model_type']:
text += " [%s]" % column['model_type']
reprs[module_map(column['module'])].append(text)
text = 'model %s (moved from %s)' % (
model, old_models[model])
if column['model_type']:
text += " [%s]" % column['model_type']

for column in copy.copy(new_records):
model = column['model']
Expand All @@ -400,17 +416,28 @@ def compare_model_sets(old_records, new_records):
text = 'new model %s' % model
if column['model_type']:
text += " [%s]" % column['model_type']
reprs[module_map(column['module'])].append(text)
reprs[column['module']].append(text)
reprs['general'].append('new model %s [module %s]' % (
model, module_map(column['module'])))
model, column['module']))
else:
text = 'new model %s (renamed from %s)' % (
model, inv_model_map(model))
moved_module = ''
if column['module'] != module_map(old_models[inv_model_map(
model)]):
moved_module = ' in module %s' % old_models[
inv_model_map(model)]
text = 'new model %s (renamed from %s%s)' % (
model, inv_model_map(model), moved_module)
if column['model_type']:
text += " [%s]" % column['model_type']
reprs[module_map(column['module'])].append(text)
reprs[column['module']].append(text)
reprs['general'].append(
'new model %s (renamed from %s) [module %s]' % (
model, inv_model_map(model),
module_map(column['module'])))
model, inv_model_map(model), column['module']))
else:
if column['module'] != module_map(old_models[model]):
text = 'model %s (moved from %s)' % (
model, old_models[model])
if column['model_type']:
text += " [%s]" % column['model_type']
reprs[column['module']].append(text)
return reprs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
---Models in module 'test_performance'---
model test_performance.mail (moved to test_mail)
---Fields in module 'test_performance'---
test_performance / test_performance.mail / __last_update (datetime) : module is now 'test_mail' ('test_performance')
test_performance / test_performance.mail / display_name (char) : module is now 'test_mail' ('test_performance')
Expand Down

0 comments on commit d7a37c0

Please sign in to comment.