- Click to register a new journal item.
+ Select the period and the journal you want to fill.
This view can be used by accountants in order to quickly record
entries in OpenERP. If you want to record a supplier invoice,
From 7e1ffaf6132f39baeb3bc1ec7849a43567f09d8a Mon Sep 17 00:00:00 2001
From: "Denis Ledoux dle@openerp.com" <>
Date: Thu, 22 Nov 2012 11:45:04 +0100
Subject: [PATCH 36/74] [REM]Remove all account.journal.view and
account.journal.column references
bzr revid: dle@openerp.com-20121122104504-ezgj2666zkhgybpj
---
addons/account/account.py | 117 -----
addons/account/account_bank.py | 6 -
addons/account/account_view.xml | 2 +-
addons/account/data/account_data.xml | 406 ------------------
addons/account/demo/account_minimal.xml | 3 -
addons/account/security/ir.model.access.csv | 4 -
.../account/test/account_fiscalyear_close.yml | 1 -
.../test/account_validate_account_move.yml | 10 +-
.../account_analytic_plans_view.xml | 9 -
addons/account_check_writing/account_view.xml | 2 +-
.../account_sequence_data.xml | 41 +-
addons/account_voucher/test/case1_usd_usd.yml | 1 -
.../test/case2_suppl_usd_eur.yml | 2 -
.../test/case2_usd_eur_debtor_in_eur.yml | 2 -
.../test/case2_usd_eur_debtor_in_usd.yml | 2 -
addons/account_voucher/test/case3_eur_eur.yml | 1 -
addons/account_voucher/test/case4_cad_chf.yml | 1 -
.../test/case5_suppl_usd_usd.yml | 2 -
addons/account_voucher/test/case_eur_usd.yml | 1 -
.../hr_expense/security/ir.model.access.csv | 2 -
.../hr_timesheet/security/ir.model.access.csv | 2 -
.../security/ir.model.access.csv | 4 -
addons/stock/stock_data.xml | 1 -
.../test/stock_location_pull_flow.yml | 2 -
24 files changed, 8 insertions(+), 616 deletions(-)
diff --git a/addons/account/account.py b/addons/account/account.py
index 30e0b784de8..8f967760201 100644
--- a/addons/account/account.py
+++ b/addons/account/account.py
@@ -685,44 +685,6 @@ class account_account(osv.osv):
account_account()
-class account_journal_view(osv.osv):
- _name = "account.journal.view"
- _description = "Journal View"
- _columns = {
- 'name': fields.char('Journal View', size=64, required=True, translate=True),
- 'columns_id': fields.one2many('account.journal.column', 'view_id', 'Columns')
- }
- _order = "name"
-
-account_journal_view()
-
-
-class account_journal_column(osv.osv):
-
- def _col_get(self, cr, user, context=None):
- result = []
- cols = self.pool.get('account.move.line')._columns
- for col in cols:
- if col in ('period_id', 'journal_id'):
- continue
- result.append( (col, cols[col].string) )
- result.sort()
- return result
-
- _name = "account.journal.column"
- _description = "Journal Column"
- _columns = {
- 'name': fields.char('Column Name', size=64, required=True),
- 'field': fields.selection(_col_get, 'Field Name', required=True, size=32),
- 'view_id': fields.many2one('account.journal.view', 'Journal View', select=True),
- 'sequence': fields.integer('Sequence', help="Gives the sequence order to journal column.", readonly=True),
- 'required': fields.boolean('Required'),
- 'readonly': fields.boolean('Readonly'),
- }
- _order = "view_id, sequence"
-
-account_journal_column()
-
class account_journal(osv.osv):
_name = "account.journal"
_description = "Journal"
@@ -738,7 +700,6 @@ class account_journal(osv.osv):
" Select 'Opening/Closing Situation' for entries generated for new fiscal years."),
'type_control_ids': fields.many2many('account.account.type', 'account_journal_type_rel', 'journal_id','type_id', 'Type Controls', domain=[('code','<>','view'), ('code', '<>', 'closed')]),
'account_control_ids': fields.many2many('account.account', 'account_account_type_rel', 'journal_id','account_id', 'Account', domain=[('type','<>','view'), ('type', '<>', 'closed')]),
- #'view_id': fields.many2one('account.journal.view', 'Display Mode', required=True, help="Gives the view used when writing or browsing entries in this journal. The view tells OpenERP which fields should be visible, required or readonly and in which order. You can create your own view for a faster encoding in each journal."),
'default_credit_account_id': fields.many2one('account.account', 'Default Credit Account', domain="[('type','!=','view')]", help="It acts as a default account for credit amount"),
'default_debit_account_id': fields.many2one('account.account', 'Default Debit Account', domain="[('type','!=','view')]", help="It acts as a default account for debit amount"),
'centralisation': fields.boolean('Centralised Counterpart', help="Check this box to determine that each entry of this journal won't create a new counterpart but will share the same counterpart. This is used in fiscal year closing."),
@@ -874,37 +835,6 @@ class account_journal(osv.osv):
return self.name_get(cr, user, ids, context=context)
- def onchange_type(self, cr, uid, ids, type, currency, context=None):
- obj_data = self.pool.get('ir.model.data')
- user_pool = self.pool.get('res.users')
-
- type_map = {
- 'sale':'account_sp_journal_view',
- 'sale_refund':'account_sp_refund_journal_view',
- 'purchase':'account_sp_journal_view',
- 'purchase_refund':'account_sp_refund_journal_view',
- 'cash':'account_journal_bank_view',
- 'bank':'account_journal_bank_view',
- 'general':'account_journal_view',
- 'situation':'account_journal_view'
- }
-
- res = {}
- view_id = type_map.get(type, 'account_journal_view')
- user = user_pool.browse(cr, uid, uid)
- if type in ('cash', 'bank') and currency and user.company_id.currency_id.id != currency:
- view_id = 'account_journal_bank_view_multi'
- data_id = obj_data.search(cr, uid, [('model','=','account.journal.view'), ('name','=',view_id)])
- data = obj_data.browse(cr, uid, data_id[0], context=context)
-
- res.update({
- 'centralisation':type == 'situation',
- 'view_id':data.res_id,
- })
- return {
- 'value':res
- }
-
account_journal()
class account_fiscalyear(osv.osv):
@@ -3161,53 +3091,6 @@ class wizard_multi_charts_accounts(osv.osv_memory):
default_account = acc_template_ref.get(template.property_account_income_opening.id)
return default_account
- def _get_view_id(journal_type):
- # Get the journal views
- if journal_type in ('general', 'situation'):
- data = obj_data.get_object_reference(cr, uid, 'account', 'account_journal_view')
- elif journal_type in ('sale_refund', 'purchase_refund'):
- data = obj_data.get_object_reference(cr, uid, 'account', 'account_sp_refund_journal_view')
- else:
- data = obj_data.get_object_reference(cr, uid, 'account', 'account_sp_journal_view')
- return data and data[1] or False
-
- journal_names = {
- 'sale': _('Sales Journal'),
- 'purchase': _('Purchase Journal'),
- 'sale_refund': _('Sales Refund Journal'),
- 'purchase_refund': _('Purchase Refund Journal'),
- 'general': _('Miscellaneous Journal'),
- 'situation': _('Opening Entries Journal'),
- }
- journal_codes = {
- 'sale': _('SAJ'),
- 'purchase': _('EXJ'),
- 'sale_refund': _('SCNJ'),
- 'purchase_refund': _('ECNJ'),
- 'general': _('MISC'),
- 'situation': _('OPEJ'),
- }
-
- obj_data = self.pool.get('ir.model.data')
- analytic_journal_obj = self.pool.get('account.analytic.journal')
- template = self.pool.get('account.chart.template').browse(cr, uid, chart_template_id, context=context)
-
- journal_data = []
- for journal_type in ['sale', 'purchase', 'sale_refund', 'purchase_refund', 'general', 'situation']:
- vals = {
- 'type': journal_type,
- 'name': journal_names[journal_type],
- 'code': journal_codes[journal_type],
- 'company_id': company_id,
- 'centralisation': journal_type == 'situation',
- 'view_id': _get_view_id(journal_type),
- 'analytic_journal_id': _get_analytic_journal(journal_type),
- 'default_credit_account_id': _get_default_account(journal_type, 'credit'),
- 'default_debit_account_id': _get_default_account(journal_type, 'debit'),
- }
- journal_data.append(vals)
- return journal_data
-
def generate_properties(self, cr, uid, chart_template_id, acc_template_ref, company_id, context=None):
"""
This method used for creating properties.
diff --git a/addons/account/account_bank.py b/addons/account/account_bank.py
index 2323f8aaa8a..52b95f1d289 100644
--- a/addons/account/account_bank.py
+++ b/addons/account/account_bank.py
@@ -89,11 +89,6 @@ class bank(osv.osv):
}
acc_bank_id = obj_acc.create(cr,uid,acc,context=context)
- # Get the journal view id
- data_id = obj_data.search(cr, uid, [('model','=','account.journal.view'), ('name','=','account_journal_bank_view')])
- data = obj_data.browse(cr, uid, data_id[0], context=context)
- view_id_cash = data.res_id
-
jour_obj = self.pool.get('account.journal')
new_code = 1
while True:
@@ -112,7 +107,6 @@ class bank(osv.osv):
'analytic_journal_id': False,
'default_credit_account_id': acc_bank_id,
'default_debit_account_id': acc_bank_id,
- 'view_id': view_id_cash
}
journal_id = jour_obj.create(cr, uid, vals_journal, context=context)
diff --git a/addons/account/account_view.xml b/addons/account/account_view.xml
index c9c95cd8d69..0116db16f03 100644
--- a/addons/account/account_view.xml
+++ b/addons/account/account_view.xml
@@ -397,7 +397,7 @@
-
+
diff --git a/addons/account/data/account_data.xml b/addons/account/data/account_data.xml
index dd27cfbab4e..97bea14c1f2 100644
--- a/addons/account/data/account_data.xml
+++ b/addons/account/data/account_data.xml
@@ -59,412 +59,6 @@