From c9992e11d2c4119057ca2a90824100b05f112f67 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Krier?= Date: Sat, 28 Feb 2009 16:56:54 +0100 Subject: [PATCH] Remove OSV and WizardOSV and move Cacheable into model --- trytond/ir/action.py | 18 ++++++++--------- trytond/ir/attachment.py | 6 +++--- trytond/ir/cache.py | 4 ++-- trytond/ir/cron.py | 6 +++--- trytond/ir/date.py | 5 ++--- trytond/ir/default.py | 4 ++-- trytond/ir/export.py | 6 +++--- trytond/ir/lang.py | 4 ++-- trytond/ir/model.py | 14 ++++++------- trytond/ir/module/module.py | 16 +++++++-------- trytond/ir/property.py | 4 ++-- trytond/ir/rule.py | 6 +++--- trytond/ir/sequence.py | 6 +++--- trytond/ir/translation.py | 21 ++++++++++---------- trytond/ir/ui/menu.py | 4 ++-- trytond/ir/ui/view.py | 8 ++++---- trytond/{osv/osv.py => model/cacheable.py} | 15 ++------------ trytond/osv/__init__.py | 2 -- trytond/osv/fields.py | 3 --- trytond/osv/orm.py | 23 ---------------------- trytond/res/group.py | 4 ++-- trytond/res/request.py | 13 ++++++------ trytond/res/user.py | 12 +++++------ trytond/tests/mptt.py | 5 ++--- trytond/webdav/webdav.py | 6 +++--- trytond/wizard/wizard.py | 4 ---- trytond/workflow/workflow.py | 14 ++++++------- 27 files changed, 95 insertions(+), 138 deletions(-) rename trytond/{osv/osv.py => model/cacheable.py} (87%) delete mode 100644 trytond/osv/__init__.py delete mode 100644 trytond/osv/fields.py delete mode 100644 trytond/osv/orm.py diff --git a/trytond/ir/action.py b/trytond/ir/action.py index 9c5b1f2af4..1c7b5b375d 100644 --- a/trytond/ir/action.py +++ b/trytond/ir/action.py @@ -1,14 +1,14 @@ #This file is part of Tryton. The COPYRIGHT file at the top level of #this repository contains the full copyright notices and license terms. "Action" -from trytond.osv import fields, OSV +from trytond.model import ModelView, ModelSQL, fields from trytond.tools import file_open from trytond.backend import TableHandler import base64 import os -class Action(OSV): +class Action(ModelSQL, ModelView): "Action" _name = 'ir.action' _description = __doc__ @@ -57,7 +57,7 @@ class Action(OSV): Action() -class ActionKeyword(OSV): +class ActionKeyword(ModelSQL, ModelView): "Action keyword" _name = 'ir.action.keyword' _description = __doc__ @@ -200,7 +200,7 @@ class ActionKeyword(OSV): ActionKeyword() -class ActionReportOutputFormat(OSV): +class ActionReportOutputFormat(ModelSQL, ModelView): "Output formats for reports" _name = 'ir.action.report.outputformat' _description = "Report Output Format" @@ -211,7 +211,7 @@ class ActionReportOutputFormat(OSV): ActionReportOutputFormat() -class ActionReport(OSV): +class ActionReport(ModelSQL, ModelView): "Action report" _name = 'ir.action.report' _sequence = 'ir_action_id_seq' @@ -350,7 +350,7 @@ class ActionReport(OSV): ActionReport() -class ActionActWindow(OSV): +class ActionActWindow(ModelSQL, ModelView): "Action act window" _name = 'ir.action.act_window' _sequence = 'ir_action_id_seq' @@ -425,7 +425,7 @@ class ActionActWindow(OSV): ActionActWindow() -class ActionActWindowView(OSV): +class ActionActWindowView(ModelSQL, ModelView): "Action act window view" _name = 'ir.action.act_window.view' _rec_name = 'view' @@ -450,7 +450,7 @@ class ActionActWindowView(OSV): ActionActWindowView() -class ActionWizard(OSV): +class ActionWizard(ModelSQL, ModelView): "Action wizard" _name = 'ir.action.wizard' _sequence = 'ir_action_id_seq' @@ -481,7 +481,7 @@ class ActionWizard(OSV): ActionWizard() -class ActionURL(OSV): +class ActionURL(ModelSQL, ModelView): "Action URL" _name = 'ir.action.url' _sequence = 'ir_action_id_seq' diff --git a/trytond/ir/attachment.py b/trytond/ir/attachment.py index 23ec215b50..ddb18fc3ff 100644 --- a/trytond/ir/attachment.py +++ b/trytond/ir/attachment.py @@ -1,13 +1,13 @@ #This file is part of Tryton. The COPYRIGHT file at the top level of #this repository contains the full copyright notices and license terms. "Attachment" +from trytond.model import ModelView, ModelSQL, fields +from trytond.config import CONFIG import os import md5 import base64 -from trytond.osv import fields, OSV -from trytond.config import CONFIG -class Attachment(OSV): +class Attachment(ModelSQL, ModelView): "Attachment" _name = 'ir.attachment' _description = __doc__ diff --git a/trytond/ir/cache.py b/trytond/ir/cache.py index b7c758ccfb..8caa7d4ba4 100644 --- a/trytond/ir/cache.py +++ b/trytond/ir/cache.py @@ -1,8 +1,8 @@ #This file is part of Tryton. The COPYRIGHT file at the top level of this repository contains the full copyright notices and license terms. +from trytond.model import ModelSQL, fields -from trytond.osv import OSV, fields -class Cache(OSV): +class Cache(ModelSQL): "Cache" _name = 'ir.cache' _description = __doc__ diff --git a/trytond/ir/cron.py b/trytond/ir/cron.py index a80d0b4574..7710bb988f 100644 --- a/trytond/ir/cron.py +++ b/trytond/ir/cron.py @@ -7,9 +7,9 @@ SPEC: Execute "model.function(*eval(args))" periodically max_repeat : number of execution or NULL if endlessly """ -from mx import DateTime from trytond.backend import Database -from trytond.osv import fields, OSV +from trytond.model import ModelView, ModelSQL, fields +from mx import DateTime import datetime import traceback import sys @@ -23,7 +23,7 @@ _INTERVALTYPES = { 'minutes': lambda interval: DateTime.RelativeDateTime(minutes=interval), } -class Cron(OSV): +class Cron(ModelSQL, ModelView): "Cron" _name = "ir.cron" _description = __doc__ diff --git a/trytond/ir/date.py b/trytond/ir/date.py index 973b09cbb4..01e6adf792 100644 --- a/trytond/ir/date.py +++ b/trytond/ir/date.py @@ -1,11 +1,10 @@ #This file is part of Tryton. The COPYRIGHT file at the top level #of this repository contains the full copyright notices and license terms. - -from trytond.osv import OSV, fields +from trytond.model import Model import datetime -class Date(OSV): +class Date(Model): 'Date' _name = 'ir.date' _description = __doc__ diff --git a/trytond/ir/default.py b/trytond/ir/default.py index b997f331fa..de30f32f6d 100644 --- a/trytond/ir/default.py +++ b/trytond/ir/default.py @@ -1,13 +1,13 @@ #This file is part of Tryton. The COPYRIGHT file at the top level of #this repository contains the full copyright notices and license terms. "Default" -from trytond.osv import fields, OSV +from trytond.model import ModelView, ModelSQL, fields from decimal import Decimal import mx.DateTime import datetime -class Default(OSV): +class Default(ModelSQL, ModelView): "Default" _name = 'ir.default' _description = __doc__ diff --git a/trytond/ir/export.py b/trytond/ir/export.py index a85c7de2dc..4e7766510b 100644 --- a/trytond/ir/export.py +++ b/trytond/ir/export.py @@ -1,10 +1,10 @@ #This file is part of Tryton. The COPYRIGHT file at the top level of #this repository contains the full copyright notices and license terms. "Exports" -from trytond.osv import fields, OSV +from trytond.model import ModelView, ModelSQL, fields -class Export(OSV): +class Export(ModelSQL, ModelView): "Export" _name = "ir.export" _description = __doc__ @@ -16,7 +16,7 @@ class Export(OSV): Export() -class ExportLine(OSV): +class ExportLine(ModelSQL, ModelView): "Export line" _name = 'ir.export.line' _description = __doc__ diff --git a/trytond/ir/lang.py b/trytond/ir/lang.py index 487e332831..2e10cea10f 100644 --- a/trytond/ir/lang.py +++ b/trytond/ir/lang.py @@ -1,10 +1,10 @@ #This file is part of Tryton. The COPYRIGHT file at the top level of this repository contains the full copyright notices and license terms. "Lang" -from trytond.osv import fields, OSV +from trytond.model import ModelView, ModelSQL, fields import time -class Lang(OSV): +class Lang(ModelSQL, ModelView): "Language" _name = "ir.lang" _description = __doc__ diff --git a/trytond/ir/model.py b/trytond/ir/model.py index c747d79626..11da565b49 100644 --- a/trytond/ir/model.py +++ b/trytond/ir/model.py @@ -1,15 +1,15 @@ #This file is part of Tryton. The COPYRIGHT file at the top level of #this repository contains the full copyright notices and license terms. "model" -from trytond.osv import fields, OSV +from trytond.model import ModelView, ModelSQL, fields from trytond.tools import Cache from trytond.report import Report -from trytond.wizard import Wizard, WizardOSV +from trytond.wizard import Wizard import time import base64 -class Model(OSV): +class Model(ModelSQL, ModelView): "Model" _name = 'ir.model' _description = __doc__ @@ -31,7 +31,7 @@ class Model(OSV): Model() -class ModelField(OSV): +class ModelField(ModelSQL, ModelView): "Model field" _name = 'ir.model.field' _description = __doc__ @@ -138,7 +138,7 @@ class ModelField(OSV): ModelField() -class ModelAccess(OSV): +class ModelAccess(ModelSQL, ModelView): "Model access" _name = 'ir.model.access' _description = __doc__ @@ -260,7 +260,7 @@ class ModelAccess(OSV): ModelAccess() -class ModelData(OSV): +class ModelData(ModelSQL, ModelView): "Model data" _name = 'ir.model.data' _description = __doc__ @@ -313,7 +313,7 @@ class ModelData(OSV): ModelData() -class PrintModelGraphInit(WizardOSV): +class PrintModelGraphInit(ModelView): 'Print Model Graph Init' _name = 'ir.model.print_model_graph.init' _description = __doc__ diff --git a/trytond/ir/module/module.py b/trytond/ir/module/module.py index e3a9112f59..81dbc37a42 100644 --- a/trytond/ir/module/module.py +++ b/trytond/ir/module/module.py @@ -6,10 +6,10 @@ import re import zipfile import urllib import zipimport -from trytond.osv import fields, OSV +from trytond.model import ModelView, ModelSQL, fields import trytond.tools as tools from trytond.modules import MODULES_PATH, create_graph, get_module_list -from trytond.wizard import Wizard, WizardOSV +from trytond.wizard import Wizard from trytond.backend import Database from trytond.pool import Pool @@ -124,7 +124,7 @@ def vercmp(ver1, ver2): return revision1 - revision2 -class Module(OSV): +class Module(ModelSQL, ModelView): "Module" _name = "ir.module.module" _description = __doc__ @@ -444,7 +444,7 @@ class Module(OSV): Module() -class ModuleDependency(OSV): +class ModuleDependency(ModelSQL, ModelView): "Module dependency" _name = "ir.module.module.dependency" _description = __doc__ @@ -485,7 +485,7 @@ class ModuleDependency(OSV): ModuleDependency() -class ModuleConfigWizardItem(OSV): +class ModuleConfigWizardItem(ModelSQL, ModelView): "Config wizard to run after installing module" _name = 'ir.module.module.config_wizard.item' _description = __doc__ @@ -509,7 +509,7 @@ class ModuleConfigWizardItem(OSV): ModuleConfigWizardItem() -class ModuleConfigWizardFirst(WizardOSV): +class ModuleConfigWizardFirst(ModelView): 'Module Config Wizard First' _name = 'ir.module.module.config_wizard.first' _description = __doc__ @@ -586,7 +586,7 @@ class ModuleConfigWizard(Wizard): ModuleConfigWizard() -class ModuleInstallUpgradeInit(WizardOSV): +class ModuleInstallUpgradeInit(ModelView): 'Module Install Upgrade Init' _name = 'ir.module.module.install_upgrade.init' _description = __doc__ @@ -595,7 +595,7 @@ class ModuleInstallUpgradeInit(WizardOSV): ModuleInstallUpgradeInit() -class ModuleInstallUpgradeStart(WizardOSV): +class ModuleInstallUpgradeStart(ModelView): 'Module Install Upgrade Start' _name = 'ir.module.module.install_upgrade.start' _description = __doc__ diff --git a/trytond/ir/property.py b/trytond/ir/property.py index a7362c0bb4..9f9bfa1a57 100644 --- a/trytond/ir/property.py +++ b/trytond/ir/property.py @@ -1,10 +1,10 @@ #This file is part of Tryton. The COPYRIGHT file at the top level of this repository contains the full copyright notices and license terms. "Properties" -from trytond.osv import OSV, fields +from trytond.model import ModelView, ModelSQL, fields from decimal import Decimal -class Property(OSV): +class Property(ModelSQL, ModelView): "Property" _name = 'ir.property' _description = __doc__ diff --git a/trytond/ir/rule.py b/trytond/ir/rule.py index 6dca33f7e0..135c3e60e3 100644 --- a/trytond/ir/rule.py +++ b/trytond/ir/rule.py @@ -1,11 +1,11 @@ #This file is part of Tryton. The COPYRIGHT file at the top level of this repository contains the full copyright notices and license terms. "Rule" -from trytond.osv import fields, OSV +from trytond.model import ModelView, ModelSQL, fields from trytond.tools import Cache import time -class RuleGroup(OSV): +class RuleGroup(ModelSQL, ModelView): "Rule group" _name = 'ir.rule.group' _description = __doc__ @@ -64,7 +64,7 @@ class RuleGroup(OSV): RuleGroup() -class Rule(OSV): +class Rule(ModelSQL, ModelView): "Rule" _name = 'ir.rule' _rec_name = 'field' diff --git a/trytond/ir/sequence.py b/trytond/ir/sequence.py index a30fe0a904..05e5d3164f 100644 --- a/trytond/ir/sequence.py +++ b/trytond/ir/sequence.py @@ -1,11 +1,11 @@ #This file is part of Tryton. The COPYRIGHT file at the top level of #this repository contains the full copyright notices and license terms. import time -from trytond.osv import fields, OSV +from trytond.model import ModelView, ModelSQL, fields from string import Template -class SequenceType(OSV): +class SequenceType(ModelSQL, ModelView): "Sequence type" _name = 'ir.sequence.type' _description = __doc__ @@ -15,7 +15,7 @@ class SequenceType(OSV): SequenceType() -class Sequence(OSV): +class Sequence(ModelSQL, ModelView): "Sequence" _name = 'ir.sequence' _description = __doc__ diff --git a/trytond/ir/translation.py b/trytond/ir/translation.py index 8915cadad6..962abe0a73 100644 --- a/trytond/ir/translation.py +++ b/trytond/ir/translation.py @@ -10,8 +10,9 @@ from xml import dom from xml.dom import minidom from difflib import SequenceMatcher import csv -from trytond.osv import fields, OSV, Cacheable -from trytond.wizard import Wizard, WizardOSV +from trytond.model import ModelView, ModelSQL, fields +from trytond.model.cacheable import Cacheable +from trytond.wizard import Wizard from trytond import tools from trytond.tools import file_open import os @@ -36,7 +37,7 @@ class TRYTON(csv.excel): csv.register_dialect("TRYTON", TRYTON) -class Translation(OSV, Cacheable): +class Translation(ModelSQL, ModelView, Cacheable): "Translation" _name = "ir.translation" _description = __doc__ @@ -539,7 +540,7 @@ class Translation(OSV, Cacheable): Translation() -class ReportTranslationSetInit(WizardOSV): +class ReportTranslationSetInit(ModelView): "Update Report Translation" _name = 'ir.translation.set_report.init' _description = __doc__ @@ -547,7 +548,7 @@ class ReportTranslationSetInit(WizardOSV): ReportTranslationSetInit() -class ReportTranslationSetStart(WizardOSV): +class ReportTranslationSetStart(ModelView): "Update Report Translation" _name = 'ir.translation.set_report.start' _description = __doc__ @@ -707,7 +708,7 @@ class ReportTranslationSet(Wizard): ReportTranslationSet() -class TranslationCleanInit(WizardOSV): +class TranslationCleanInit(ModelView): 'Clean translation init' _name = 'ir.translation.clean.init' _description = __doc__ @@ -715,7 +716,7 @@ class TranslationCleanInit(WizardOSV): TranslationCleanInit() -class TranslationCleanStart(WizardOSV): +class TranslationCleanStart(ModelView): 'Clean translation start' _name = 'ir.translation.clean.start' _description = __doc__ @@ -924,7 +925,7 @@ class TranslationClean(Wizard): TranslationClean() -class TranslationUpdateInit(WizardOSV): +class TranslationUpdateInit(ModelView): "Update translation - language" _name = 'ir.translation.update.init' _description = __doc__ @@ -1053,7 +1054,7 @@ class TranslationUpdate(Wizard): TranslationUpdate() -class TranslationExportInit(WizardOSV): +class TranslationExportInit(ModelView): "Export translation - language and module" _name = 'ir.translation.export.init' _description = __doc__ @@ -1083,7 +1084,7 @@ class TranslationExportInit(WizardOSV): TranslationExportInit() -class TranslationExportStart(WizardOSV): +class TranslationExportStart(ModelView): "Export translation - file" _description = __doc__ _name = 'ir.translation.export.start' diff --git a/trytond/ir/ui/menu.py b/trytond/ir/ui/menu.py index ef579fe78e..14f57fed49 100644 --- a/trytond/ir/ui/menu.py +++ b/trytond/ir/ui/menu.py @@ -1,7 +1,7 @@ #This file is part of Tryton. The COPYRIGHT file at the top level of #this repository contains the full copyright notices and license terms. "UI menu" -from trytond.osv import fields, OSV +from trytond.model import ModelView, ModelSQL, fields def one_in(i, j): """Check the presence of an element of setA in setB @@ -72,7 +72,7 @@ ICONS = [(x, x) for x in [ ]] -class UIMenu(OSV): +class UIMenu(ModelSQL, ModelView): "UI menu" _name = 'ir.ui.menu' _description = __doc__ diff --git a/trytond/ir/ui/view.py b/trytond/ir/ui/view.py index 502714b6f8..e332ea6319 100644 --- a/trytond/ir/ui/view.py +++ b/trytond/ir/ui/view.py @@ -1,7 +1,7 @@ #This file is part of Tryton. The COPYRIGHT file at the top level of #this repository contains the full copyright notices and license terms. "View" -from trytond.osv import fields, OSV +from trytond.model import ModelView, ModelSQL, fields from difflib import SequenceMatcher import os import logging @@ -9,7 +9,7 @@ from lxml import etree from trytond.backend import TableHandler -class View(OSV): +class View(ModelSQL, ModelView): "View" _name = 'ir.ui.view' _description = __doc__ @@ -189,7 +189,7 @@ class View(OSV): View() -class ViewShortcut(OSV): +class ViewShortcut(ModelSQL, ModelView): "View shortcut" _name = 'ir.ui.view_sc' _description = __doc__ @@ -219,7 +219,7 @@ class ViewShortcut(OSV): ViewShortcut() -class ViewTreeWidth(OSV): +class ViewTreeWidth(ModelSQL, ModelView): "View Tree Width" _name = 'ir.ui.view_tree_width' _description = __doc__ diff --git a/trytond/osv/osv.py b/trytond/model/cacheable.py similarity index 87% rename from trytond/osv/osv.py rename to trytond/model/cacheable.py index 10b608c3c0..f13b5189ab 100644 --- a/trytond/osv/osv.py +++ b/trytond/model/cacheable.py @@ -1,19 +1,8 @@ #This file is part of Tryton. The COPYRIGHT file at the top level of #this repository contains the full copyright notices and license terms. -from trytond.model import ModelView, ModelSQL -from trytond.backend import DatabaseIntegrityError -import copy -import sys -import traceback -from trytond.tools import Cache, find_language_context -import time +from trytond.tools import Cache from threading import Lock -from trytond.config import CONFIG -import logging - - -class OSV(ModelSQL, ModelView): - pass +import time class Cacheable(object): diff --git a/trytond/osv/__init__.py b/trytond/osv/__init__.py deleted file mode 100644 index 8dbe4b59e2..0000000000 --- a/trytond/osv/__init__.py +++ /dev/null @@ -1,2 +0,0 @@ -#This file is part of Tryton. The COPYRIGHT file at the top level of this repository contains the full copyright notices and license terms. -from osv import * diff --git a/trytond/osv/fields.py b/trytond/osv/fields.py deleted file mode 100644 index b64d664c8c..0000000000 --- a/trytond/osv/fields.py +++ /dev/null @@ -1,3 +0,0 @@ -#This file is part of Tryton. The COPYRIGHT file at the top level of -#this repository contains the full copyright notices and license terms. -from trytond.model.fields import * diff --git a/trytond/osv/orm.py b/trytond/osv/orm.py deleted file mode 100644 index 27dde87e26..0000000000 --- a/trytond/osv/orm.py +++ /dev/null @@ -1,23 +0,0 @@ -#This file is part of Tryton. The COPYRIGHT file at the top level of -#this repository contains the full copyright notices and license terms. -# -*- coding: utf-8 -*- -from trytond.model import ModelView, ModelSQL - -class ORM(ModelSQL, ModelView): - """ - Object relationnal mapping to postgresql module - . Hierarchical structure - . Constraints consistency, validations - . Object meta Data depends on its status - . Optimised processing by complex query (multiple actions at once) - . Default fields value - . Permissions optimisation - . Persistant object: DB postgresql - . Datas conversions - . Multi-level caching system - . 2 different inheritancies - . Fields: - - classicals (varchar, integer, boolean, ...) - - relations (one2many, many2one, many2many) - - functions - """ diff --git a/trytond/res/group.py b/trytond/res/group.py index 31b379b0b3..72ddb5cd2d 100644 --- a/trytond/res/group.py +++ b/trytond/res/group.py @@ -1,9 +1,9 @@ #This file is part of Tryton. The COPYRIGHT file at the top level of this repository contains the full copyright notices and license terms. "Group" -from trytond.osv import fields, OSV +from trytond.model import ModelView, ModelSQL, fields -class Group(OSV): +class Group(ModelSQL, ModelView): "Group" _name = "res.group" _description = __doc__ diff --git a/trytond/res/request.py b/trytond/res/request.py index 5a541c3007..c00cf8b5fd 100644 --- a/trytond/res/request.py +++ b/trytond/res/request.py @@ -1,6 +1,7 @@ -#This file is part of Tryton. The COPYRIGHT file at the top level of this repository contains the full copyright notices and license terms. +#This file is part of Tryton. The COPYRIGHT file at the top level of +#this repository contains the full copyright notices and license terms. "Request" -from trytond.osv import OSV, fields +from trytond.model import ModelView, ModelSQL, fields import time import datetime @@ -17,7 +18,7 @@ _PRIORITIES = [ ('2', 'High'), ] -class Request(OSV): +class Request(ModelSQL, ModelView): "Request" _name = 'res.request' _table = 'res_request' @@ -157,7 +158,7 @@ class Request(OSV): Request() -class RequestLink(OSV): +class RequestLink(ModelSQL, ModelView): "Request link" _name = 'res.request.link' _description = __doc__ @@ -180,7 +181,7 @@ class RequestLink(OSV): RequestLink() -class RequestHistory(OSV): +class RequestHistory(ModelSQL, ModelView): "Request history" _name = 'res.request.history' _description = __doc__ @@ -220,7 +221,7 @@ class RequestHistory(OSV): RequestHistory() -class RequestReference(OSV): +class RequestReference(ModelSQL, ModelView): "Request Reference" _name = 'res.request.reference' _description = __doc__ diff --git a/trytond/res/user.py b/trytond/res/user.py index 891c0fec06..99a720ad93 100644 --- a/trytond/res/user.py +++ b/trytond/res/user.py @@ -2,13 +2,13 @@ #this repository contains the full copyright notices and license terms. "User" import copy -from trytond.osv import fields, OSV -from trytond.wizard import Wizard, WizardOSV +from trytond.model import ModelView, ModelSQL, fields +from trytond.wizard import Wizard from lxml import etree from trytond.tools import Cache -class User(OSV): +class User(ModelSQL, ModelView): "User" _name = "res.user" _description = __doc__ @@ -299,7 +299,7 @@ class User(OSV): User() -class Warning(OSV): +class Warning(ModelSQL, ModelView): 'User Warning' _name = 'res.user.warning' _description = __doc__ @@ -325,7 +325,7 @@ class Warning(OSV): Warning() -class Group(OSV): +class Group(ModelSQL, ModelView): _name = 'res.group' users = fields.Many2Many( 'res.user', 'res_group_user_rel', 'gid', 'uid', 'Users', @@ -334,7 +334,7 @@ class Group(OSV): Group() -class UserConfigInit(WizardOSV): +class UserConfigInit(ModelView): 'User Config Init' _name = 'res.user.config.init' _description = __doc__ diff --git a/trytond/tests/mptt.py b/trytond/tests/mptt.py index b7afa5a944..f0bd80e96a 100644 --- a/trytond/tests/mptt.py +++ b/trytond/tests/mptt.py @@ -1,11 +1,10 @@ #This file is part of Tryton. The COPYRIGHT file at the top level of #this repository contains the full copyright notices and license terms. "Test for Tree" - -from trytond.osv import fields, OSV +from trytond.model import ModelView, ModelSQL, fields -class MPTT(OSV): +class MPTT(ModelSQL, ModelView): 'Modified Preorder Tree Traversal' _name = 'tests.mptt' _description = __doc__ diff --git a/trytond/webdav/webdav.py b/trytond/webdav/webdav.py index 9ee3bf6a18..876f8a20e1 100644 --- a/trytond/webdav/webdav.py +++ b/trytond/webdav/webdav.py @@ -3,12 +3,12 @@ import os import base64 import time -from trytond.osv import fields, OSV +from trytond.model import ModelView, ModelSQL, fields from trytond.version import PACKAGE, VERSION, WEBSITE from trytond.report import Report -class Collection(OSV): +class Collection(ModelSQL, ModelView): "Collection" _name = "webdav.collection" _description = __doc__ @@ -562,7 +562,7 @@ class Collection(OSV): Collection() -class Attachment(OSV): +class Attachment(ModelSQL, ModelView): _name = 'ir.attachment' def __init__(self): diff --git a/trytond/wizard/wizard.py b/trytond/wizard/wizard.py index 2e99eda0ee..570537fce1 100644 --- a/trytond/wizard/wizard.py +++ b/trytond/wizard/wizard.py @@ -198,7 +198,3 @@ class Wizard(object): return self.execute(cursor, user, wiz_id, data, next_state, context=context) return res - - -class WizardOSV(ModelView): - pass diff --git a/trytond/workflow/workflow.py b/trytond/workflow/workflow.py index aa7caafdb7..b20143fc51 100644 --- a/trytond/workflow/workflow.py +++ b/trytond/workflow/workflow.py @@ -1,14 +1,14 @@ #This file is part of Tryton. The COPYRIGHT file at the top level of this repository contains the full copyright notices and license terms. "Workflow" import os -from trytond.osv import fields, OSV +from trytond.model import ModelView, ModelSQL, fields from trytond.report import Report from trytond.tools import exec_command_pipe import expr import base64 -class Workflow(OSV): +class Workflow(ModelSQL, ModelView): "Workflow" _name = "workflow" _table = "wkf" @@ -31,7 +31,7 @@ class Workflow(OSV): Workflow() -class WorkflowActivity(OSV): +class WorkflowActivity(ModelSQL, ModelView): "Workflow activity" _name = "workflow.activity" _table = "wkf_activity" @@ -91,7 +91,7 @@ class WorkflowActivity(OSV): WorkflowActivity() -class WorkflowTransition(OSV): +class WorkflowTransition(ModelSQL, ModelView): "Workflow transition" _table = "wkf_transition" _name = "workflow.transition" @@ -115,7 +115,7 @@ class WorkflowTransition(OSV): WorkflowTransition() -class WorkflowInstance(OSV): +class WorkflowInstance(ModelSQL, ModelView): "Workflow instance" _table = "wkf_instance" _name = "workflow.instance" @@ -231,7 +231,7 @@ class WorkflowInstance(OSV): WorkflowInstance() -class WorkflowWorkitem(OSV): +class WorkflowWorkitem(ModelSQL, ModelView): "Workflow workitem" _table = "wkf_workitem" _name = "workflow.workitem" @@ -436,7 +436,7 @@ class WorkflowWorkitem(OSV): WorkflowWorkitem() -class WorkflowTrigger(OSV): +class WorkflowTrigger(ModelSQL, ModelView): "Workflow trigger" _table = "wkf_trigger" _name = "workflow.trigger"