From b225d1119b8bc66fb2cf80aef8302d743fbfb486 Mon Sep 17 00:00:00 2001 From: Raphael Collet Date: Wed, 10 Aug 2016 12:15:50 +0200 Subject: [PATCH] [MIG] test_uninstall: convert code to the new API --- openerp/addons/test_uninstall/__init__.py | 4 +++- openerp/addons/test_uninstall/__openerp__.py | 1 + openerp/addons/test_uninstall/models.py | 20 +++++++++----------- 3 files changed, 13 insertions(+), 12 deletions(-) diff --git a/openerp/addons/test_uninstall/__init__.py b/openerp/addons/test_uninstall/__init__.py index 89d26e2f597..dc5e6b693d1 100644 --- a/openerp/addons/test_uninstall/__init__.py +++ b/openerp/addons/test_uninstall/__init__.py @@ -1,2 +1,4 @@ # -*- coding: utf-8 -*- -import models +# Part of Odoo. See LICENSE file for full copyright and licensing details. + +from . import models diff --git a/openerp/addons/test_uninstall/__openerp__.py b/openerp/addons/test_uninstall/__openerp__.py index 3c5d3b30636..899c1c6cab6 100644 --- a/openerp/addons/test_uninstall/__openerp__.py +++ b/openerp/addons/test_uninstall/__openerp__.py @@ -1,4 +1,5 @@ # -*- coding: utf-8 -*- +# Part of Odoo. See LICENSE file for full copyright and licensing details. { 'name': 'test-uninstall', 'version': '0.1', diff --git a/openerp/addons/test_uninstall/models.py b/openerp/addons/test_uninstall/models.py index d05419a1bb8..4f32dabef68 100644 --- a/openerp/addons/test_uninstall/models.py +++ b/openerp/addons/test_uninstall/models.py @@ -1,21 +1,19 @@ # -*- coding: utf-8 -*- -import openerp -from openerp.osv import fields -from openerp.osv.orm import Model +# Part of Odoo. See LICENSE file for full copyright and licensing details. -class test_uninstall_model(Model): +from openerp import models, fields + +class test_uninstall_model(models.Model): """ This model uses different types of columns to make it possible to test - the uninstall feature of OpenERP. + the uninstall feature of Odoo. """ _name = 'test_uninstall.model' - _columns = { - 'name': fields.char('Name'), - 'ref': fields.many2one('res.users', string='User'), - 'rel': fields.many2many('res.users', string='Users'), - } + name = fields.Char('Name') + ref = fields.Many2one('res.users', string='User') + rel = fields.Many2many('res.users', string='Users') _sql_constraints = [ - ('name_uniq', 'unique (name)', 'Each name must be unique.') + ('name_uniq', 'unique (name)', 'Each name must be unique.'), ]