diff --git a/account.py b/account.py index fa8dbab2a6..f5d76a15aa 100644 --- a/account.py +++ b/account.py @@ -1,9 +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. "Account" - -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 trytond.report import Report from decimal import Decimal import datetime @@ -12,7 +11,7 @@ import os import mx.DateTime -class TypeTemplate(OSV): +class TypeTemplate(ModelSQL, ModelView): 'Account Type Template' _name = 'account.account.type.template' _description = __doc__ @@ -117,7 +116,7 @@ class TypeTemplate(OSV): TypeTemplate() -class Type(OSV): +class Type(ModelSQL, ModelView): 'Account Type' _name = 'account.account.type' _description = __doc__ @@ -221,7 +220,7 @@ class Type(OSV): Type() -class AccountTemplate(OSV): +class AccountTemplate(ModelSQL, ModelView): 'Account Template' _name = 'account.account.template' _description = __doc__ @@ -414,7 +413,7 @@ class AccountTemplate(OSV): AccountTemplate() -class Account(OSV): +class Account(ModelSQL, ModelView): 'Account' _name = 'account.account' _description = __doc__ @@ -804,7 +803,7 @@ class Account(OSV): Account() -class AccountDeferral(OSV): +class AccountDeferral(ModelSQL, ModelView): ''' Account Deferral @@ -867,7 +866,7 @@ class AccountDeferral(OSV): AccountDeferral() -class OpenChartAccountInit(WizardOSV): +class OpenChartAccountInit(ModelView): 'Open Chart Account Init' _name = 'account.account.open_chart_account.init' _description = __doc__ @@ -925,7 +924,7 @@ class OpenChartAccount(Wizard): OpenChartAccount() -class PrintGeneralLegderInit(WizardOSV): +class PrintGeneralLegderInit(ModelView): 'Print General Ledger' _name = 'account.account.print_general_ledger.init' _description = __doc__ @@ -1138,7 +1137,7 @@ class GeneralLegder(Report): GeneralLegder() -class PrintTrialBalanceInit(WizardOSV): +class PrintTrialBalanceInit(ModelView): 'Print Trial Balance Init' _name = 'account.account.print_trial_balance.init' _description = __doc__ @@ -1303,7 +1302,7 @@ class TrialBalance(Report): TrialBalance() -class OpenBalanceSheetInit(WizardOSV): +class OpenBalanceSheetInit(ModelView): 'Open Balance Sheet Init' _name = 'account.account.open_balance_sheet.init' _description = __doc__ @@ -1392,7 +1391,7 @@ class OpenBalanceSheet(Wizard): OpenBalanceSheet() -class OpenIncomeStatementInit(WizardOSV): +class OpenIncomeStatementInit(ModelView): 'Open Income Statement Init' _name = 'account.account.open_income_statement.init' _description = __doc__ @@ -1516,7 +1515,7 @@ class OpenIncomeStatement(Wizard): OpenIncomeStatement() -class CreateChartAccountInit(WizardOSV): +class CreateChartAccountInit(ModelView): 'Create Chart Account Init' _name = 'account.account.create_chart_account.init' _description = __doc__ @@ -1524,7 +1523,7 @@ class CreateChartAccountInit(WizardOSV): CreateChartAccountInit() -class CreateChartAccountAccount(WizardOSV): +class CreateChartAccountAccount(ModelView): 'Create Chart Account Account' _name = 'account.account.create_chart_account.account' _description = __doc__ @@ -1535,7 +1534,7 @@ class CreateChartAccountAccount(WizardOSV): CreateChartAccountAccount() -class CreateChartAccountPropertites(WizardOSV): +class CreateChartAccountPropertites(ModelView): 'Create Chart Account Properties' _name = 'account.account.create_chart_account.properties' _description = __doc__ @@ -1690,7 +1689,7 @@ class CreateChartAccount(Wizard): CreateChartAccount() -class OpenThirdPartyBalanceInit(WizardOSV): +class OpenThirdPartyBalanceInit(ModelView): 'Open Third Party Balance Init' _name = 'account.account.open_third_party_balance.init' _description = __doc__ @@ -1811,7 +1810,7 @@ class ThirdPartyBalance(Report): ThirdPartyBalance() -class OpenAgedBalanceInit(WizardOSV): +class OpenAgedBalanceInit(ModelView): 'Open Aged Balance Init' _name = 'account.account.open_aged_balance.init' _description = __doc__ diff --git a/fiscalyear.py b/fiscalyear.py index 8b7ad08ab4..b935acc97f 100644 --- a/fiscalyear.py +++ b/fiscalyear.py @@ -1,9 +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. 'Fiscal Year' - -from trytond.osv import fields, OSV -from trytond.wizard import Wizard, WizardOSV +from trytond.model import ModelView, ModelSQL, fields +from trytond.wizard import Wizard import mx.DateTime STATES = { @@ -12,7 +11,7 @@ STATES = { DEPENDS = ['state'] -class FiscalYear(OSV): +class FiscalYear(ModelSQL, ModelView): 'Fiscal Year' _name = 'account.fiscalyear' _description = __doc__ @@ -303,7 +302,7 @@ class FiscalYear(OSV): FiscalYear() -class CloseFiscalYearInit(WizardOSV): +class CloseFiscalYearInit(ModelView): 'Close Fiscal Year Init' _name = 'account.fiscalyear.close_fiscalyear.init' _description = __doc__ diff --git a/journal.py b/journal.py index 7dcd397a8e..3ddd93ee5d 100644 --- a/journal.py +++ b/journal.py @@ -1,9 +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. "Journal" - -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 trytond.backend import TableHandler STATES = { @@ -17,7 +16,7 @@ _ICONS = { } -class Type(OSV): +class Type(ModelSQL, ModelView): 'Journal Type' _name = 'account.journal.type' _description = __doc__ @@ -34,7 +33,7 @@ class Type(OSV): Type() -class View(OSV): +class View(ModelSQL, ModelView): 'Journal View' _name = 'account.journal.view' _description = __doc__ @@ -48,7 +47,7 @@ class View(OSV): View() -class Column(OSV): +class Column(ModelSQL, ModelView): 'Journal View Column' _name = 'account.journal.view.column' _description = __doc__ @@ -73,7 +72,7 @@ class Column(OSV): Column() -class Journal(OSV): +class Journal(ModelSQL, ModelView): 'Journal' _name = 'account.journal' _description = __doc__ @@ -159,7 +158,7 @@ class Journal(OSV): Journal() -class Period(OSV): +class Period(ModelSQL, ModelView): 'Journal - Period' _name = 'account.journal.period' _description = __doc__ diff --git a/move.py b/move.py index 8a5739125a..a90a732af9 100644 --- a/move.py +++ b/move.py @@ -1,9 +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. 'Move' - -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 trytond.report import Report from decimal import Decimal import datetime @@ -19,7 +18,7 @@ _LINE_STATES = { _LINE_DEPENDS = ['state'] -class Move(OSV): +class Move(ModelSQL, ModelView): 'Account Move' _name = 'account.move' _description = __doc__ @@ -332,7 +331,7 @@ class Move(OSV): Move() -class Reconciliation(OSV): +class Reconciliation(ModelSQL, ModelView): 'Account Move Reconciliation Lines' _name = 'account.move.reconciliation' _description = __doc__ @@ -399,7 +398,7 @@ class Reconciliation(OSV): Reconciliation() -class Line(OSV): +class Line(ModelSQL, ModelView): 'Account Move Line' _name = 'account.move.line' _description = __doc__ @@ -1306,7 +1305,7 @@ class Line(OSV): Line() -class Move2(OSV): +class Move2(ModelSQL, ModelView): _name = 'account.move' centralised_line = fields.Many2One('account.move.line', 'Centralised Line', readonly=True) @@ -1314,7 +1313,7 @@ class Move2(OSV): Move2() -class OpenJournalAsk(WizardOSV): +class OpenJournalAsk(ModelView): 'Open Journal Ask' _name = 'account.move.open_journal.ask' _description = __doc__ @@ -1483,7 +1482,7 @@ class OpenAccount(Wizard): OpenAccount() -class ReconcileLinesWriteOff(WizardOSV): +class ReconcileLinesWriteOff(ModelView): 'Reconcile Lines Write-Off' _name = 'account.move.reconcile_lines.writeoff' _description = __doc__ @@ -1563,7 +1562,7 @@ class ReconcileLines(Wizard): ReconcileLines() -class UnreconcileLinesInit(WizardOSV): +class UnreconcileLinesInit(ModelView): 'Unreconcile Lines Init' _name = 'account.move.unreconcile_lines.init' _description = __doc__ @@ -1609,7 +1608,7 @@ class UnreconcileLines(Wizard): UnreconcileLines() -class OpenReconcileLinesInit(WizardOSV): +class OpenReconcileLinesInit(ModelView): 'Open Reconcile Lines Init' _name = 'account.move.open_reconcile_lines.init' _description = __doc__ @@ -1663,7 +1662,7 @@ class OpenReconcileLines(Wizard): OpenReconcileLines() -class FiscalYear(OSV): +class FiscalYear(ModelSQL, ModelView): _name = 'account.fiscalyear' close_lines = fields.Many2Many('account.move.line', 'account_fiscalyear_line_rel', 'fiscalyear', 'line', 'Close Lines') @@ -1671,7 +1670,7 @@ class FiscalYear(OSV): FiscalYear() -class PrintGeneralJournalInit(WizardOSV): +class PrintGeneralJournalInit(ModelView): 'Print General Journal Init' _name = 'account.move.print_general_journal.init' _description = __doc__ diff --git a/party.py b/party.py index 4e86eb248b..29a46ce9af 100644 --- a/party.py +++ b/party.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 fields, OSV +from trytond.model import ModelView, ModelSQL, fields from decimal import Decimal -class Party(OSV): +class Party(ModelSQL, ModelView): _name = 'party.party' account_payable = fields.Property(type='many2one', relation='account.account', string='Account Payable', diff --git a/period.py b/period.py index 0fa153fcf5..096f58c3f1 100644 --- a/period.py +++ b/period.py @@ -1,8 +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. 'Period' - -from trytond.osv import fields, OSV +from trytond.model import ModelView, ModelSQL, fields from trytond.wizard import Wizard _STATES = { @@ -10,7 +9,7 @@ _STATES = { } -class Period(OSV): +class Period(ModelSQL, ModelView): 'Period' _name = 'account.period' _description = __doc__ diff --git a/tax.py b/tax.py index b74fc6d2d7..7c63d19a43 100644 --- a/tax.py +++ b/tax.py @@ -1,14 +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. "Tax" - -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 decimal import Decimal from trytond.tools import Cache -class Group(OSV): +class Group(ModelSQL, ModelView): 'Tax Group' _name = 'account.tax.group' _description = __doc__ @@ -25,7 +24,7 @@ class Group(OSV): Group() -class CodeTemplate(OSV): +class CodeTemplate(ModelSQL, ModelView): 'Tax Code Template' _name = 'account.tax.code.template' _description = __doc__ @@ -111,7 +110,7 @@ class CodeTemplate(OSV): CodeTemplate() -class Code(OSV): +class Code(ModelSQL, ModelView): 'Tax Code' _name = 'account.tax.code' _description = __doc__ @@ -239,7 +238,7 @@ class Code(OSV): Code() -class OpenChartCodeInit(WizardOSV): +class OpenChartCodeInit(ModelView): 'Open Chart Code Init' _name = 'account.tax.open_chart_code.init' _description = __doc__ @@ -309,7 +308,7 @@ class OpenChartCode(Wizard): OpenChartCode() -class TaxTemplate(OSV): +class TaxTemplate(ModelSQL, ModelView): 'Account Tax Template' _name = 'account.tax.template' _description = __doc__ @@ -478,7 +477,7 @@ class TaxTemplate(OSV): TaxTemplate() -class Tax(OSV): +class Tax(ModelSQL, ModelView): ''' Account Tax @@ -747,7 +746,7 @@ class Tax(OSV): Tax() -class Line(OSV): +class Line(ModelSQL, ModelView): 'Tax Line' _name = 'account.tax.line' _description = __doc__ @@ -819,7 +818,7 @@ class OpenCode(Wizard): OpenCode() -class AccountTemplate(OSV): +class AccountTemplate(ModelSQL, ModelView): _name = 'account.account.template' taxes = fields.Many2Many('account.tax.template', 'account_account_template_tax_rel', 'account', 'tax', 'Default Taxes', @@ -828,7 +827,7 @@ class AccountTemplate(OSV): AccountTemplate() -class Account(OSV): +class Account(ModelSQL, ModelView): _name = 'account.account' taxes = fields.Many2Many('account.tax', 'account_account_tax_rel', 'account', 'tax', 'Default Taxes',