diff --git a/CHANGELOG b/CHANGELOG index 9608528645..83de01cf18 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,3 +1,4 @@ +* Remove journal view * Add amount second currency on Account * Enforce second currency on Account * Remove code from Fiscalyear and Period diff --git a/__init__.py b/__init__.py index 3b97f33862..a873f334ee 100644 --- a/__init__.py +++ b/__init__.py @@ -40,8 +40,6 @@ def register(): Configuration, Period, JournalType, - JournalView, - JournalViewColumn, Journal, JournalCashContext, JournalPeriod, diff --git a/doc/index.rst b/doc/index.rst index f14c1ab709..9b89769f37 100644 --- a/doc/index.rst +++ b/doc/index.rst @@ -99,8 +99,6 @@ A Journal contains the following fields: - Name - Code - Active: A checkbox that allow to disable the tax. -- View: Defines how the moves lines on this journal should be - displayed. - Default Credit Account, Default Debit Account: Used as default accounts on move lines for journals of *Cash* type. - Type: By default take one of the following values: *General*, diff --git a/journal.py b/journal.py index 1eca46e56d..8c32d82aae 100644 --- a/journal.py +++ b/journal.py @@ -5,8 +5,7 @@ from decimal import Decimal from sql import Null from sql.aggregate import Sum -from trytond.model import ModelView, ModelSQL, fields, Unique, \ - sequence_ordered +from trytond.model import ModelView, ModelSQL, fields, Unique from trytond.wizard import Wizard, StateTransition from trytond import backend from trytond.pyson import Eval, Bool @@ -14,7 +13,7 @@ from trytond.transaction import Transaction from trytond.pool import Pool from trytond.tools import reduce_ids, grouped_slice -__all__ = ['JournalType', 'JournalView', 'JournalViewColumn', 'Journal', +__all__ = ['JournalType', 'Journal', 'JournalCashContext', 'JournalPeriod', 'CloseJournalPeriod', 'ReOpenJournalPeriod'] @@ -45,47 +44,6 @@ class JournalType(ModelSQL, ModelView): cls._order.insert(0, ('code', 'ASC')) -class JournalView(ModelSQL, ModelView): - 'Journal View' - __name__ = 'account.journal.view' - name = fields.Char('Name', size=None, required=True) - columns = fields.One2Many('account.journal.view.column', 'view', 'Columns') - - @classmethod - def __setup__(cls): - super(JournalView, cls).__setup__() - cls._order.insert(0, ('name', 'ASC')) - - -class JournalViewColumn(sequence_ordered(), ModelSQL, ModelView): - 'Journal View Column' - __name__ = 'account.journal.view.column' - name = fields.Char('Name', size=None, required=True) - field = fields.Many2One('ir.model.field', 'Field', required=True, - domain=[('model.model', '=', 'account.move.line')]) - view = fields.Many2One('account.journal.view', 'View', select=True) - required = fields.Boolean('Required') - readonly = fields.Boolean('Readonly') - - @classmethod - def __register__(cls, module_name): - TableHandler = backend.get('TableHandler') - table = TableHandler(cls, module_name) - - super(JournalViewColumn, cls).__register__(module_name) - - # Migration from 2.4: drop required on sequence - table.not_null_action('sequence', action='remove') - - @staticmethod - def default_required(): - return False - - @staticmethod - def default_readonly(): - return False - - class Journal(ModelSQL, ModelView): 'Journal' __name__ = 'account.journal' @@ -93,7 +51,6 @@ class Journal(ModelSQL, ModelView): code = fields.Char('Code', size=None) active = fields.Boolean('Active', select=True) type = fields.Selection('get_types', 'Type', required=True) - view = fields.Many2One('account.journal.view', 'View') sequence = fields.Property(fields.Many2One('ir.sequence', 'Sequence', domain=[('code', '=', 'account.journal')], context={'code': 'account.journal'}, diff --git a/journal.xml b/journal.xml index 771c657ae4..47b25dcdff 100644 --- a/journal.xml +++ b/journal.xml @@ -72,85 +72,6 @@ this repository contains the full copyright notices and license terms. --> write-off - - account.journal.view - form - journal_view_form - - - account.journal.view - tree - journal_view_tree - - - Journal Views - account.journal.view - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - account.journal.view.column - tree - - journal_view_column_list - - - - account.journal.view.column - tree - - journal_view_column_list_sequence - - - - account.journal.view.column - form - journal_view_column_form - - - - - - - - - - - - - - - - - - account.journal form diff --git a/move.py b/move.py index dc3feeaa47..97207e5128 100644 --- a/move.py +++ b/move.py @@ -1498,43 +1498,6 @@ class Line(ModelSQL, ModelView): }) return toolbar - @classmethod - def fields_view_get(cls, view_id=None, view_type='form'): - Journal = Pool().get('account.journal') - result = super(Line, cls).fields_view_get(view_id=view_id, - view_type=view_type) - if view_type == 'tree' and 'journal' in Transaction().context: - journal = Journal(Transaction().context['journal']) - - if not journal.view: - return result - - xml = '\n' \ - '\n' - fields = set() - for column in journal.view.columns: - fields.add(column.field.name) - attrs = [] - if column.field.name == 'debit': - attrs.append('sum="Debit"') - elif column.field.name == 'credit': - attrs.append('sum="Credit"') - if column.readonly: - attrs.append('readonly="1"') - if column.required: - attrs.append('required="1"') - else: - attrs.append('required="0"') - xml += ('\n' - % (column.field.name, ' '.join(attrs))) - for depend in getattr(cls, column.field.name).depends: - fields.add(depend) - fields.add('state') - xml += '' - result['arch'] = xml - result['fields'] = cls.fields_get(fields_names=list(fields)) - return result - @classmethod def reconcile(cls, lines, journal=None, date=None, account=None, description=None): diff --git a/view/journal_form.xml b/view/journal_form.xml index e9e0031b57..9c014d6b17 100644 --- a/view/journal_form.xml +++ b/view/journal_form.xml @@ -14,9 +14,6 @@ this repository contains the full copyright notices and license terms. -->