diff --git a/addons/account/account.py b/addons/account/account.py index 1520c4f0646..5de913c45a7 100644 --- a/addons/account/account.py +++ b/addons/account/account.py @@ -2019,7 +2019,7 @@ class account_model(osv.osv): } _defaults = { - 'legend': lambda self, cr, uid, context:_('You can specify year, month and date in the name of the model using the following labels:\n\n%(year)s : To Specify Year \n%(month)s : To Specify Month \n%(date)s : Current Date\n\ne.g. My model on %(date)s'), + 'legend': lambda self, cr, uid, context:_('You can specify year, month and date in the name of the model using the following labels:\n\n%(year)s: To Specify Year \n%(month)s: To Specify Month \n%(date)s: Current Date\n\ne.g. My model on %(date)s'), } def generate(self, cr, uid, ids, datas={}, context=None): move_ids = [] @@ -2221,7 +2221,7 @@ class account_subscription_line(osv.osv): account_subscription_line() # --------------------------------------------------------------- -# Account Templates : Account, Tax, Tax Code and chart. + Wizard +# Account Templates: Account, Tax, Tax Code and chart. + Wizard # --------------------------------------------------------------- class account_tax_template(osv.osv): @@ -2394,7 +2394,7 @@ class account_chart_template(osv.osv): 'property_account_income_categ': fields.many2one('account.account.template','Income Category Account'), 'property_account_expense': fields.many2one('account.account.template','Expense Account on Product Template'), 'property_account_income': fields.many2one('account.account.template','Income Account on Product Template'), - 'property_reserve_and_surplus_account': fields.many2one('account.account.template', 'Reserve and Profit/Loss Account', domain=[('type', '=', 'payable')], help='This Account is used for transferring Profit/Loss(If It is Profit : Amount will be added, Loss : Amount will be deducted.), Which is calculated from Profilt & Loss Report'), + 'property_reserve_and_surplus_account': fields.many2one('account.account.template', 'Reserve and Profit/Loss Account', domain=[('type', '=', 'payable')], help='This Account is used for transferring Profit/Loss(If It is Profit: Amount will be added, Loss: Amount will be deducted.), Which is calculated from Profilt & Loss Report'), } account_chart_template() diff --git a/addons/account/account_move_line.py b/addons/account/account_move_line.py index d9b78795998..b10ced65e88 100644 --- a/addons/account/account_move_line.py +++ b/addons/account/account_move_line.py @@ -26,6 +26,7 @@ from osv import fields, osv from tools.translate import _ import decimal_precision as dp import tools +from operator import itemgetter class account_move_line(osv.osv): _name = "account.move.line" @@ -863,9 +864,8 @@ class account_move_line(osv.osv): result['toolbar']['action'] = [] #Restrict the list of journal view in search view - if view_type == 'search': - journal_list = journal_pool.name_search(cr, uid, '', [], context=context) - result['fields']['journal_id']['selection'] = journal_list + if view_type == 'search' and result['fields'].get('journal_id', False): + result['fields']['journal_id']['selection'] = journal_pool.name_search(cr, uid, '', [], context=context) return result if context.get('view_mode', False): @@ -887,21 +887,20 @@ class account_move_line(osv.osv): for field in journal.view_id.columns_id: if not field.field in fields: fields[field.field] = [journal.id] - fld.append((field.field, field.sequence)) + fld.append((field.field, field.sequence, field.name)) flds.append(field.field) common_fields[field.field] = 1 else: fields.get(field.field).append(journal.id) common_fields[field.field] = common_fields[field.field] + 1 - fld.append(('period_id', 3)) - fld.append(('journal_id', 10)) + fld.append(('period_id', 3, 'Period')) + fld.append(('journal_id', 10, 'Journal')) flds.append('period_id') flds.append('journal_id') fields['period_id'] = all_journal fields['journal_id'] = all_journal - from operator import itemgetter fld = sorted(fld, key=itemgetter(1)) widths = { @@ -955,7 +954,7 @@ class account_move_line(osv.osv): if field in widths: attrs.append('width="'+str(widths[field])+'"') - + attrs.append('string="'+field_it[2]+'"') attrs.append("invisible=\"context.get('visible_id') not in %s\"" % (fields.get(field))) xml += '''\n''' % (field,' '.join(attrs)) diff --git a/addons/account/account_view.xml b/addons/account/account_view.xml index fa9d5ba5e95..49de367122b 100644 --- a/addons/account/account_view.xml +++ b/addons/account/account_view.xml @@ -23,8 +23,8 @@
- - + + @@ -59,7 +59,7 @@ - + @@ -237,16 +237,16 @@ - account.treasory.graph - account.account - graph - - - - - + account.treasory.graph + account.account + graph + + + + + - + Accounts account.account @@ -314,13 +314,33 @@ + + account.journal.view.search + account.journal.view + search + + + + + + + + account.journal.view.tree + account.journal.view + tree + + + + + + account.journal.view.form account.journal.view form - + @@ -330,7 +350,9 @@ account.journal.view form tree,form + + + + account.account.type.search + account.account.type + search + + + + + + + + account.account.type.tree account.account.type @@ -705,6 +740,7 @@ account.account.type form tree,form + + + account.tax.code.search + account.tax.code + search + + + + + + + + + account.tax.code.tree account.tax.code @@ -777,10 +826,10 @@
- - - - + + + + @@ -803,6 +852,7 @@ form tree,form + @@ -834,7 +884,6 @@ - @@ -845,8 +894,8 @@ - - + + @@ -1227,24 +1276,24 @@ - - + + - + - + - - + + - + - + @@ -1254,7 +1303,7 @@ - + @@ -1269,7 +1318,7 @@ - + @@ -1355,15 +1404,15 @@ - - - - + + + + - - + + @@ -1471,7 +1520,7 @@ - + @@ -1603,9 +1652,9 @@ form
- - - + + + @@ -1641,7 +1690,7 @@ - + @@ -1723,6 +1772,18 @@ + + account.payment.term.search + account.payment.term + search + + + + + + + + account.payment.term.form account.payment.term @@ -1745,6 +1806,7 @@ account.payment.term form tree,form + account.account.template form tree,form,search + @@ -2243,7 +2306,6 @@ - @@ -2257,6 +2319,7 @@ account.tax.template form tree,form + @@ -2317,6 +2380,7 @@ account.tax.code.template form tree,form,search + @@ -2378,7 +2442,7 @@ new - @@ -2396,13 +2460,24 @@ + + account.fiscal.position.template.search + account.fiscal.position.template + search + + + + + + + account.fiscal.position.template.form account.fiscal.position.template form - + @@ -2444,6 +2519,7 @@ account.fiscal.position.template form tree,form + SAJ/%(year)s/ + + Sales Credit Note Journal + account.journal + + SCNJ/%(year)s/ + Purchase Journal account.journal EXJ/%(year)s/ - + + Expenses Credit Notes Journal + account.journal + + ECNJ/%(year)s/ + + + Bank Journal + account.journal + + BNK/%(year)s/ + + + Checks Journal + account.journal + + CHK/%(year)s/ + + + Cash Journal + account.journal + + CSH/%(year)s/ + diff --git a/addons/account/demo/account_minimal.xml b/addons/account/demo/account_minimal.xml index 764420e6689..87c8a37254d 100644 --- a/addons/account/demo/account_minimal.xml +++ b/addons/account/demo/account_minimal.xml @@ -357,7 +357,7 @@ sale_refund - + @@ -381,7 +381,7 @@ purchase_refund - + @@ -393,7 +393,7 @@ BNK bank - + @@ -404,7 +404,7 @@ CHK bank - + @@ -415,7 +415,7 @@ CSH cash - + diff --git a/addons/account/installer.py b/addons/account/installer.py index 60251a673ae..b85b2dc21e2 100644 --- a/addons/account/installer.py +++ b/addons/account/installer.py @@ -256,7 +256,7 @@ class account_installer(osv.osv_memory): vals_seq = { 'name': _('Bank Journal '), 'code': 'account.journal', - 'prefix': 'BAN/', + 'prefix': 'BNK/%(year)s/', 'padding': 5 } seq_id = obj_sequence.create(cr,uid,vals_seq) @@ -280,17 +280,13 @@ class account_installer(osv.osv_memory): obj_journal.create(cr,uid,vals_journal) for val in record.bank_accounts_id: - seq_prefix = None seq_padding = 5 if val.account_type == 'cash': type = cash_type_id - seq_prefix = "CSH/" elif val.account_type == 'bank': type = bank_type_id - seq_prefix = "BAN/" elif val.account_type == 'check': type = check_type_id - seq_prefix = "CHK/" else: type = check_type_id seq_padding = None @@ -304,9 +300,9 @@ class account_installer(osv.osv_memory): 'company_id': company_id.id } child_bnk_acc = obj_acc.create(cr, uid, vals_bnk) vals_seq_child = { - 'name': _(vals_bnk['name']), + 'name': _(vals_bnk['name'] + ' ' + 'Journal'), 'code': 'account.journal', - 'prefix': seq_prefix, + 'prefix': _((vals_bnk['name'][:3].upper()) + '/%(year)s/'), 'padding': seq_padding } seq_id = obj_sequence.create(cr, uid, vals_seq_child) @@ -314,7 +310,7 @@ class account_installer(osv.osv_memory): #create the bank journal vals_journal = {} vals_journal['name']= vals_bnk['name'] + ' Journal' - vals_journal['code']= _(vals_bnk['name'][:3]) + vals_journal['code']= _(vals_bnk['name'][:3]).upper() vals_journal['sequence_id'] = seq_id vals_journal['type'] = 'cash' if vals.get('currency_id', False): @@ -328,7 +324,6 @@ class account_installer(osv.osv_memory): obj_journal.create(cr,uid,vals_journal) code_cnt += 1 - #reactivate the parent_store functionality on account_account self.pool._init = False self.pool.get('account.account')._parent_store_compute(cr) @@ -352,20 +347,36 @@ class account_installer(osv.osv_memory): seq_sale = { 'name': 'Sale Journal', 'code': 'account.journal', - 'prefix': '%(year)s/', + 'prefix': 'SAJ/%(year)s/', 'padding': 3 } seq_id_sale = obj_sequence.create(cr, uid, seq_sale) seq_purchase = { 'name': 'Purchase Journal', 'code': 'account.journal', - 'prefix': '%(year)s/', + 'prefix': 'EXJ/%(year)s/', 'padding': 3 } seq_id_purchase = obj_sequence.create(cr, uid, seq_purchase) + seq_refund_sale = { + 'name': 'Sales Refund Journal', + 'code': 'account.journal', + 'prefix': 'SCNJ/%(year)s/', + 'padding': 3 + } + seq_id_sale_refund = obj_sequence.create(cr, uid, seq_refund_sale) + seq_refund_purchase = { + 'name': 'Purchase Refund Journal', + 'code': 'account.journal', + 'prefix': 'ECNJ/%(year)s/', + 'padding': 3 + } + seq_id_purchase_refund = obj_sequence.create(cr, uid, seq_refund_purchase) else: seq_id_sale = seq_id seq_id_purchase = seq_id + seq_id_sale_refund = seq_id + seq_id_purchase_refund = seq_id vals_journal['view_id'] = view_id @@ -408,9 +419,6 @@ class account_installer(osv.osv_memory): data = mod_obj.browse(cr, uid, data_id[0]) view_id = data.res_id - seq_id_sale_refund = seq_id_sale - seq_id_purchase_refund = seq_id_purchase - vals_journal['view_id'] = view_id #Sales Refund Journal diff --git a/addons/account/project/project.py b/addons/account/project/project.py index f082672310e..5a58eca97a4 100644 --- a/addons/account/project/project.py +++ b/addons/account/project/project.py @@ -28,11 +28,11 @@ from osv import osv class account_analytic_journal(osv.osv): _name = 'account.analytic.journal' _columns = { - 'name' : fields.char('Journal Name', size=64, required=True), - 'code' : fields.char('Journal Code', size=8), - 'active' : fields.boolean('Active', help="If the active field is set to true, it will allow you to hide the analytic journal without removing it."), + 'name': fields.char('Journal Name', size=64, required=True), + 'code': fields.char('Journal Code', size=8), + 'active': fields.boolean('Active', help="If the active field is set to true, it will allow you to hide the analytic journal without removing it."), 'type': fields.selection([('sale','Sale'), ('purchase','Purchase'), ('cash','Cash'), ('general','General'), ('situation','Situation')], 'Type', size=32, required=True, help="Gives the type of the analytic journal. When it needs for a document (eg: an invoice) to create analytic entries, OpenERP will look for a matching journal of the same type."), - 'line_ids' : fields.one2many('account.analytic.line', 'journal_id', 'Lines'), + 'line_ids': fields.one2many('account.analytic.line', 'journal_id', 'Lines'), 'company_id': fields.many2one('res.company', 'Company', required=True), } _defaults = { diff --git a/addons/account/project/project_view.xml b/addons/account/project/project_view.xml index 809f69673fe..6795ae6a0f8 100644 --- a/addons/account/project/project_view.xml +++ b/addons/account/project/project_view.xml @@ -14,6 +14,8 @@ + + diff --git a/addons/account/project/wizard/account_analytic_cost_ledger_for_journal_report_view.xml b/addons/account/project/wizard/account_analytic_cost_ledger_for_journal_report_view.xml index 82796a75b4f..3bf5d54e8a6 100644 --- a/addons/account/project/wizard/account_analytic_cost_ledger_for_journal_report_view.xml +++ b/addons/account/project/wizard/account_analytic_cost_ledger_for_journal_report_view.xml @@ -8,18 +8,16 @@ form - - - - - - - - -