diff --git a/addons/account/__init__.py b/addons/account/__init__.py index 1b64386f6af..36cc1c85b5a 100644 --- a/addons/account/__init__.py +++ b/addons/account/__init__.py @@ -23,7 +23,7 @@ import account import installer import project import partner -import invoice +import account_invoice import account_bank_statement import account_bank import account_cash_statement diff --git a/addons/account/__openerp__.py b/addons/account/__openerp__.py index 0a75b52213f..19662ea2f33 100644 --- a/addons/account/__openerp__.py +++ b/addons/account/__openerp__.py @@ -103,8 +103,7 @@ module named account_voucher. 'account_end_fy.xml', 'account_invoice_view.xml', 'partner_view.xml', - 'data/account_invoice.xml', - 'data/account_data2.xml', + 'data/account_data.xml', 'account_invoice_workflow.xml', 'project/project_view.xml', 'project/project_report.xml', diff --git a/addons/account/account.py b/addons/account/account.py index 538f9ed3b4e..4273c4c0288 100644 --- a/addons/account/account.py +++ b/addons/account/account.py @@ -672,32 +672,22 @@ class account_journal(osv.osv): return super(account_journal, self).write(cr, uid, ids, vals, context=context) def create_sequence(self, cr, uid, vals, context=None): + """ Create new no_gap entry sequence for every new Joural """ - Create new entry sequence for every new Joural - """ - seq_pool = self.pool.get('ir.sequence') - seq_typ_pool = self.pool.get('ir.sequence.type') - - name = vals['name'] - code = vals['code'].lower() - - types = { - 'name': name, - 'code': code - } - seq_typ_pool.create(cr, uid, types) + # in account.journal code is actually the prefix of the sequence + # whereas ir.sequence code is a key to lookup global sequences. + prefix = vals['code'].upper() seq = { - 'name': name, - 'code': code, - 'active': True, - 'prefix': code + "/%(year)s/", + 'name': vals['name'], + 'implementation':'no_gap', + 'prefix': prefix + "/%(year)s/", 'padding': 4, 'number_increment': 1 } if 'company_id' in vals: seq['company_id'] = vals['company_id'] - return seq_pool.create(cr, uid, seq) + return self.pool.get('ir.sequence').create(cr, uid, seq) def create(self, cr, uid, vals, context=None): if not 'sequence_id' in vals or not vals['sequence_id']: diff --git a/addons/account/invoice.py b/addons/account/account_invoice.py similarity index 100% rename from addons/account/invoice.py rename to addons/account/account_invoice.py diff --git a/addons/account/data/account_data2.xml b/addons/account/data/account_data.xml similarity index 94% rename from addons/account/data/account_data2.xml rename to addons/account/data/account_data.xml index 48630c9899d..e111c453325 100644 --- a/addons/account/data/account_data2.xml +++ b/addons/account/data/account_data.xml @@ -469,66 +469,48 @@ Account Journal Sequences --> - - Account Journal - account.journal - - - Account Journal - account.journal - - - Sale Journal - account.journal + Account Default Sales Journal SAJ/%(year)s/ - Sales Credit Note Journal - account.journal + Account Default Sales Credit Note Journal SCNJ/%(year)s/ - Purchase Journal - account.journal + Account Default Expenses Journal EXJ/%(year)s/ - Expenses Credit Notes Journal - account.journal + Account Default Expenses Credit Notes Journal ECNJ/%(year)s/ - Bank Journal - account.journal + Account Default Bank Journal BNK/%(year)s/ - Checks Journal - account.journal + Account Default Checks Journal CHK/%(year)s/ - Cash Journal - account.journal + Account Default Cash Journal CSH/%(year)s/ - Opening Entries Journal - account.journal + Account Default Opening Entries Journal OPEJ/%(year)s/ - Miscellaneous Journal - account.journal + Account Default Miscellaneous Journal MISJ/%(year)s/ @@ -538,7 +520,7 @@ --> - Account reconcile sequence + Account Reconcile account.reconcile @@ -550,7 +532,7 @@ - Bank Statement + Account Bank Statement account.bank.statement @@ -562,7 +544,7 @@ - Cash Statement + Account Cash Statement account.cash.statement @@ -572,5 +554,30 @@ + + + + Analytic account + account.analytic.account + + + Analytic account sequence + account.analytic.account + + + + + + + Invoice + account.invoice + + + + diff --git a/addons/account/data/account_invoice.xml b/addons/account/data/account_invoice.xml deleted file mode 100644 index 54f5ed6de91..00000000000 --- a/addons/account/data/account_invoice.xml +++ /dev/null @@ -1,75 +0,0 @@ - - - - - Invoice - account.invoice - - - - - Account Invoice Out - account.invoice.out_invoice - - - Account Invoice In - account.invoice.in_invoice - - - Account Refund Out - account.invoice.out_refund - - - Account Refund In - account.invoice.in_refund - - - - - Account Invoice Out - account.invoice.out_invoice - - %(year)s/ - - - Account Invoice In - account.invoice.in_invoice - - %(year)s/ - - - Account Refund Out - account.invoice.out_refund - - %(year)s/ - - - Account Refund In - account.invoice.in_refund - - %(year)s/ - - - - - Analytic account - account.analytic.account - - - - - Analytic account sequence - account.analytic.account - - - - - diff --git a/addons/account/test/account_fiscalyear_close.yml b/addons/account/test/account_fiscalyear_close.yml index 109b098d6a7..1e24d2ca0e7 100644 --- a/addons/account/test/account_fiscalyear_close.yml +++ b/addons/account/test/account_fiscalyear_close.yml @@ -26,7 +26,6 @@ code: NEW type: situation analytic_journal_id: sit - sequence_id: sequence_journal default_debit_account_id: cash default_credit_account_id: cash company_id: base.main_company diff --git a/addons/l10n_ch/journal_data.xml b/addons/l10n_ch/journal_data.xml index ac8c714fbca..c755660d950 100644 --- a/addons/l10n_ch/journal_data.xml +++ b/addons/l10n_ch/journal_data.xml @@ -6,7 +6,6 @@ EXPF purchase - @@ -17,7 +16,6 @@ BCHF cash - @@ -28,7 +26,6 @@ BEUR cash - @@ -40,7 +37,6 @@ CAI cash - @@ -51,7 +47,6 @@ OD general - @@ -63,7 +58,6 @@ situation True - diff --git a/addons/sale/test/data_test.yml b/addons/sale/test/data_test.yml index 7064a549335..0be8474754c 100644 --- a/addons/sale/test/data_test.yml +++ b/addons/sale/test/data_test.yml @@ -122,7 +122,6 @@ default_credit_account_id: account_account_purchases0 default_debit_account_id: account_account_purchases0 name: Purchase Journal - (test) - sequence_id: account.sequence_purchase_journal type: purchase view_id: account.account_journal_view - @@ -134,7 +133,6 @@ default_credit_account_id: account_account_sales0 default_debit_account_id: account_account_sales0 name: Sale Journal - sequence_id: account.sequence_sale_journal type: sale view_id: account.account_journal_view - @@ -146,7 +144,6 @@ default_credit_account_id: account_account_cash0 default_debit_account_id: account_account_cash0 name: Bank Journal - sequence_id: account.sequence_journal type: cash view_id: account.account_journal_bank_view - diff --git a/addons/stock/stock_data.xml b/addons/stock/stock_data.xml index bcde818c78a..c0c872e99f2 100644 --- a/addons/stock/stock_data.xml +++ b/addons/stock/stock_data.xml @@ -2,12 +2,17 @@ + + Stock Journal Sequence + + STJ/%(year)s/ + Stock Journal STJ general - +