[MIG] test_uninstall: convert code to the new API

This commit is contained in:
Raphael Collet
2016-08-10 13:14:16 +02:00
parent 2513fab6bd
commit b225d1119b
3 changed files with 13 additions and 12 deletions
+3 -1
View File
@@ -1,2 +1,4 @@
# -*- coding: utf-8 -*-
import models
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from . import models
@@ -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',
+9 -11
View File
@@ -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.'),
]